diff --git a/bluez-4.42-make-udev-helper-build.patch b/bluez-4.42-make-udev-helper-build.patch new file mode 100644 index 0000000..71a2853 --- /dev/null +++ b/bluez-4.42-make-udev-helper-build.patch @@ -0,0 +1,75 @@ +--- bluez-4.42/tools/hid2hci.c.old 2009-11-02 17:13:56.000000000 +0000 ++++ bluez-4.42/tools/hid2hci.c 2009-11-02 17:24:39.000000000 +0000 +@@ -25,6 +25,7 @@ + #include + #include + #include ++#define _GNU_SOURCE 1 + #include + #include + #include +@@ -32,7 +33,63 @@ + #include + + #include "libudev.h" +-#include "libudev-private.h" ++ ++/* ++ * Concatenates strings. In any case, terminates in _all_ cases with '\0' ++ * and moves the @dest pointer forward to the added '\0'. Returns the ++ * remaining size, and 0 if the string was truncated. ++ */ ++size_t util_strpcpy(char **dest, size_t size, const char *src) ++{ ++ size_t len; ++ ++ len = strlen(src); ++ if (len >= size) { ++ if (size > 1) ++ *dest = mempcpy(*dest, src, size-1); ++ size = 0; ++ *dest[0] = '\0'; ++ } else { ++ if (len > 0) { ++ *dest = mempcpy(*dest, src, len); ++ size -= len; ++ } ++ *dest[0] = '\0'; ++ } ++ return size; ++} ++ ++/* concatenates list of strings, moves dest forward */ ++size_t util_strpcpyl(char **dest, size_t size, const char *src, ...) ++{ ++ va_list va; ++ ++ va_start(va, src); ++ do { ++ size = util_strpcpy(dest, size, src); ++ src = va_arg(va, char *); ++ } while (src != NULL); ++ va_end(va); ++ ++ return size; ++} ++ ++/* concatenates list of strings */ ++size_t util_strscpyl(char *dest, size_t size, const char *src, ...) ++{ ++ va_list va; ++ char *s; ++ ++ va_start(va, src); ++ s = dest; ++ do { ++ size = util_strpcpy(&s, size, src); ++ src = va_arg(va, char *); ++ } while (src != NULL); ++ va_end(va); ++ ++ return size; ++} + + enum mode { + HCI = 0, diff --git a/bluez.spec b/bluez.spec index a9ebbd5..567b3ca 100644 --- a/bluez.spec +++ b/bluez.spec @@ -25,6 +25,7 @@ Patch8: 0001-Allow-lp-CUPS-to-talk-to-bluetoothd.patch Patch9: 0002-Mark-Bluetooth-printers-as-being-local.patch # Updated from udev-extras master Patch10: bluez-4.42-update-hid2hci-rules.patch +Patch11: bluez-4.42-make-udev-helper-build.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root URL: http://www.bluez.org/ @@ -120,11 +121,17 @@ use in Bluetooth applications. %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 %build -%configure --enable-cups --enable-hid2hci --enable-dfutool --enable-tools --enable-bccmd --enable-gstreamer --enable-hidd --enable-pand --enable-dund +%configure --enable-cups --disable-hid2hci --enable-dfutool --enable-tools --enable-bccmd --enable-gstreamer --enable-hidd --enable-pand --enable-dund make +# Build by hand... +pushd tools +gcc -o hid2hci -DUTIL_PATH_SIZE=4096 `pkg-config --libs --cflags libudev libusb` hid2hci.c +popd + %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT @@ -145,7 +152,10 @@ fi install -D -m0644 scripts/bluetooth-serial.rules ${RPM_BUILD_ROOT}/%{_sysconfdir}/udev/rules.d/97-bluetooth-serial.rules install -D -m0755 scripts/bluetooth_serial ${RPM_BUILD_ROOT}/lib/udev/bluetooth_serial -mv ${RPM_BUILD_ROOT}/%{_sysconfdir}/udev/bluetooth-hid2hci.rules ${RPM_BUILD_ROOT}/%{_sysconfdir}/udev/rules.d/ + +# Install hid2hci +install -D -m0644 scripts/bluetooth-hid2hci.rules ${RPM_BUILD_ROOT}/lib/udev/rules.d/70-hid2hci.rules +install -D -m0755 tools/hid2hci ${RPM_BUILD_ROOT}/lib/udev/hid2hci install -D -m0755 %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/modules/bluez-uinput.modules @@ -183,7 +193,8 @@ fi %{_libdir}/bluetooth/ /lib/udev/bluetooth_serial %{_sysconfdir}/udev/rules.d/97-bluetooth-serial.rules -%{_sysconfdir}/udev/rules.d/bluetooth-hid2hci.rules +/lib/udev/rules.d/*.rules +/lib/udev/hid2hci /etc/rc.d/init.d/* %{_localstatedir}/lib/bluetooth %{_sysconfdir}/sysconfig/modules/bluez-uinput.modules