diff --git a/README.md b/README.md index 21dc957..978b487 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # bluez +Userspace tools for the Bluetooth wireless library for Linux. + diff --git a/bluez-4.59-cf.patch b/bluez-4.59-cf.patch new file mode 100644 index 0000000..c3ef889 --- /dev/null +++ b/bluez-4.59-cf.patch @@ -0,0 +1,12 @@ +diff --git a/scripts/bluetooth-serial.rules b/scripts/bluetooth-serial.rules +index 072335f..f6284ff 100644 +--- a/scripts/bluetooth-serial.rules ++++ b/scripts/bluetooth-serial.rules +@@ -33,3 +33,7 @@ SUBSYSTEM=="tty", SUBSYSTEMS=="pcmcia", ATTRS{prod_id1}=="PCMCIA", ATTRS{prod_id + + # CC&C BT0100M + SUBSYSTEM=="tty", SUBSYSTEMS=="pcmcia", ATTRS{prod_id1}=="Bluetooth BT0100M", ENV{HCIOPTS}="bcsp 115200", RUN+="bluetooth_serial" ++ ++# SocketMobile CF Connection Kit ++SUBSYSTEM=="tty", SUBSYSTEMS=="pcmcia", ATTRS{prod_id1}=="Socket", ATTRS{prod_id2}=="CF+ Personal Network Card Rev 2.5", ENV{HCIOPTS}="socket", RUN+="bluetooth_serial" ++ diff --git a/bluez-4.59-oui.patch b/bluez-4.59-oui.patch new file mode 100644 index 0000000..6743148 --- /dev/null +++ b/bluez-4.59-oui.patch @@ -0,0 +1,33 @@ +Index: src/oui.c +=================================================================== +RCS file: /cvsroot/bluez/utils/common/oui.c,v +retrieving revision 1.2 +diff -u -p -r1.2 oui.c +--- src/oui.c 13 Jan 2007 17:48:12 -0000 1.2 ++++ src/oui.c 25 Jan 2008 12:16:58 -0000 +@@ -38,7 +38,7 @@ + + /* http://standards.ieee.org/regauth/oui/oui.txt */ + +-#define OUIFILE "/var/lib/misc/oui.txt" ++#define OUIFILE "/usr/share/hwdata/oui.txt" + + char *ouitocomp(const char *oui) + { +@@ -46,14 +46,9 @@ char *ouitocomp(const char *oui) + char *str, *map, *off, *end; + int fd; + +- fd = open("oui.txt", O_RDONLY); ++ fd = open(OUIFILE, O_RDONLY); + if (fd < 0) { +- fd = open(OUIFILE, O_RDONLY); +- if (fd < 0) { +- fd = open("/usr/share/misc/oui.txt", O_RDONLY); +- if (fd < 0) +- return NULL; +- } ++ return NULL; + } + + if (fstat(fd, &st) < 0) { diff --git a/bluez-4.59-utf8.patch b/bluez-4.59-utf8.patch new file mode 100644 index 0000000..6a95fb7 --- /dev/null +++ b/bluez-4.59-utf8.patch @@ -0,0 +1,23 @@ +diff --git a/src/security.c b/src/security.c +index 905cf61..67fd266 100644 +--- a/src/security.c ++++ b/src/security.c +@@ -705,8 +705,16 @@ static inline void remote_name_information(int dev, bdaddr_t *sba, void *ptr) + memcpy(name, evt->name, MAX_NAME_LENGTH); + /* It's ok to cast end between const and non-const since + * we know it points to inside of name which is non-const */ +- if (!g_utf8_validate(name, -1, (const char **) &end)) +- *end = '\0'; ++ if (!g_utf8_validate(name, -1, (const char **) &end)) { ++ char *utf8_name; ++ ++ utf8_name = g_convert(name, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL); ++ if (utf8_name) { ++ memcpy(name, utf8_name, 248); ++ g_free(utf8_name); ++ } else ++ *end = '\0'; ++ } + write_device_name(sba, &dba, name); + } + diff --git a/bluez-4.59-wacom.patch b/bluez-4.59-wacom.patch new file mode 100644 index 0000000..4623123 --- /dev/null +++ b/bluez-4.59-wacom.patch @@ -0,0 +1,24 @@ +diff --git a/input/device.c b/input/device.c +index 0090bd4..8d65148 100644 +--- a/input/device.c ++++ b/input/device.c +@@ -658,6 +658,19 @@ static int hidp_add_connection(const struct input_device *idev, + err = write(sk, buf, sizeof(buf)); + } + ++ if (req->vendor == 0x056a && req->product == 0x81) { ++ unsigned char buf[3]; ++ int sk = g_io_channel_unix_get_fd(iconn->ctrl_io); ++ ++ buf[0] = 0x53; /* HIDP_TRANS_SET_REPORT | HIDP_DATA_RTYPE_FEATURE */ ++ buf[1] = 0x03; buf[2] = 0x00; ++ write(sk, buf, sizeof(buf)); ++ ++ buf[0] = 0x71; /* HIDP_TRANS_SET_REPORT | HIDP_DATA_RTYPE_FEATURE */ ++ /* 0x06 - high reporting speed, 0x05 - low speed */ ++ buf[1] = 0x06; buf[2] = 0x00; ++ write(sk, buf, sizeof(buf)); ++ } + err = ioctl_connadd(req); + + cleanup: diff --git a/bluez-utils-2.11-config.patch b/bluez-utils-2.11-config.patch new file mode 100644 index 0000000..25f6ba5 --- /dev/null +++ b/bluez-utils-2.11-config.patch @@ -0,0 +1,60 @@ +diff -ru bluez-utils-2.11.orig/hcid/hcid.conf bluez-utils-2.11/hcid/hcid.conf +--- bluez-utils-2.11.orig/hcid/hcid.conf 2004-11-11 19:42:31.000000000 +0100 ++++ bluez-utils-2.11/hcid/hcid.conf 2004-12-01 09:30:57.000000000 +0100 +@@ -14,7 +14,7 @@ + # auto - Use local PIN for incoming connections + # user - Always ask user for a PIN + # +- security auto; ++ security user; + + # Pairing mode + # none - Pairing disabled +@@ -23,7 +23,7 @@ + pairing multi; + + # PIN helper +- pin_helper /usr/bin/bluepin; ++ pin_helper /usr/lib/kdebluetooth/kbluepin; + + # D-Bus PIN helper + #dbus_pin_helper; +diff -ru bluez-utils-2.11.orig/scripts/bluetooth.init bluez-utils-2.11/scripts/bluetooth.init +--- bluez-utils-2.11.orig/scripts/bluetooth.init 2004-05-08 00:57:34.000000000 +0200 ++++ bluez-utils-2.11/scripts/bluetooth.init 2004-12-01 09:32:35.000000000 +0100 +@@ -2,7 +2,10 @@ + # + # Start/stop the Bluetooth daemons + # +- ++# chkconfig: 2345 95 5 ++# processname: hcid spd hidd ++# description: bluetooth service ++# + set -e + + PATH=/sbin:/bin:/usr/sbin:/usr/bin +@@ -40,7 +43,7 @@ + DUND_OPTIONS="" + PAND_OPTIONS="" + +-[ -e /etc/default/bluetooth ] && . /etc/default/bluetooth ++[ -e /etc/sysconfig/bluetooth ] && . /etc/sysconfig/bluetooth + + case "$1" in + start) +@@ -93,9 +96,13 @@ + echo -n " $HCID_NAME" + echo "." + ;; ++ restart) ++ stop ++ start ++ ;; + *) + N=/etc/init.d/$NAME +- echo "Usage: $N {start|stop}" >&2 ++ echo "Usage: $N {start|stop|restart}" >&2 + exit 1 + ;; + esac diff --git a/bluez-utils-3.9-initscript.patch b/bluez-utils-3.9-initscript.patch new file mode 100644 index 0000000..b944b50 --- /dev/null +++ b/bluez-utils-3.9-initscript.patch @@ -0,0 +1,38 @@ +diff -Nru bluez-utils-3.9.orig/scripts/bluetooth.init bluez-utils-3.9/scripts/bluetooth.init +--- bluez-utils-3.9.orig/scripts/bluetooth.init 2007-01-28 21:16:47.000000000 +0100 ++++ bluez-utils-3.9/scripts/bluetooth.init 2007-03-06 13:57:46.000000000 +0100 +@@ -2,6 +2,10 @@ + # + # Start/stop the Bluetooth daemons + # ++# chkconfig: 2345 98 5 ++# processname: hcid spd hidd ++# description: bluetooth service ++# + + set -e + +@@ -40,7 +44,7 @@ + DUND_OPTIONS="" + PAND_OPTIONS="" + +-[ -e /etc/default/bluetooth ] && . /etc/default/bluetooth ++[ -e /etc/sysconfig/bluetooth ] && . /etc/sysconfig/bluetooth + + case "$1" in + start) +@@ -97,9 +101,13 @@ + echo -n " $HCID_NAME" + echo "." + ;; ++ restart) ++ $0 stop ++ $0 start ++ ;; + *) + N=/etc/init.d/$NAME +- echo "Usage: $N {start|stop}" >&2 ++ echo "Usage: $N {start|stop|restart}" >&2 + exit 1 + ;; + esac diff --git a/bluez.spec b/bluez.spec new file mode 100644 index 0000000..db87486 --- /dev/null +++ b/bluez.spec @@ -0,0 +1,330 @@ +Name: bluez +Version: 4.101 +Release: 2mamba +Summary: Userspace tools for the Bluetooth wireless library for Linux +Group: Applications/Communication +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://www.bluez.org +Source: http://www.kernel.org/pub/linux/bluetooth/bluez-%{version}.tar.xz +Patch0: bluez-utils-2.11-config.patch +Patch1: bluez-utils-3.9-initscript.patch +Patch2: bluez-4.59-oui.patch +Patch3: bluez-4.59-utf8.patch +Patch4: bluez-4.59-wacom.patch +Patch5: bluez-4.59-cf.patch +License: GPL +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libalsa-devel +BuildRequires: libdbus-devel +BuildRequires: libglib-devel +%if "%{stage1}" != "1" +BuildRequires: libgst-plugins-base010-devel +BuildRequires: libgstreamer010-devel +%endif +BuildRequires: libreadline-devel +BuildRequires: libusb-compat-devel +BuildRequires: libxml2-devel +BuildRequires: udev-devel +## AUTOBUILDREQ-END +BuildRequires: flex +BuildRequires: bison +BuildRequires: libcap-ng-devel +Requires: bluez-firmware +Requires: libbluetooth = %{version}-%{release} +Provides: bluez-utils +Obsoletes: bluez-utils +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +Userspace tools for the Bluetooth wireless library for Linux. + +%package -n libbluetooth +Group: System/Libraries +Summary: The Bluetooth wireless library for Linux + +%description -n libbluetooth +The Bluetooth wireless library for Linux. + +%package -n libbluetooth-devel +Group: Development/Libraries +Summary: Static libraries and headers for libbluetooth +Requires: libbluetooth = %{version}-%{release} +Provides: libbluez-devel +Obsoletes: libbluez-devel + +%description -n libbluetooth-devel +The Bluetooth wireless library for Linux. + +This package contains static libraries and header files need for development. + +%prep +%setup -q +#%patch0 -p1 +#%patch1 -p1 +#%patch2 -p0 +#%patch3 -p1 +%patch4 -p1 +%patch5 -p1 + +%build +%configure \ + --libexecdir=/lib \ + --enable-health \ + --enable-pnat \ + --enable-attrib \ +%if "%{stage1}" == "1" + --disable-gstreamer \ +%else + --enable-gstreamer \ +%endif + --enable-alsa \ + --enable-usb \ + --enable-tracer \ + --enable-tools \ + --enable-bccmd \ + --enable-pcmcia \ + --enable-hid2hci \ + --enable-dfutool \ + --enable-hidd \ + --enable-pand \ + --enable-dund \ + --enable-cups \ + --enable-udevrules \ + --enable-configfiles \ + --disable-hal \ + --enable-capng \ + --enable-input \ + --enable-audio \ + --enable-serial \ + --enable-network + +# --enable-initscripts \ +# --enable-pcmciarules + +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall \ + rulesdir=%{_sysconfdir}/udev/rules.d + +install -D -m0644 audio/audio.conf %{buildroot}%{_sysconfdir}/bluetooth/audio.conf +install -D -m0644 input/input.conf %{buildroot}%{_sysconfdir}/bluetooth/input.conf +install -D -m0644 serial/serial.conf %{buildroot}%{_sysconfdir}/bluetooth/serial.conf + +#install -D -m755 scripts/bluetooth.init \ +# %{buildroot}%{_initrddir}/bluetooth +#install -D -m644 scripts/bluetooth.default \ +# %{buildroot}%{_sysconfdir}/sysconfig/bluetooth + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post +# new install +# +# disable service by default as it is started by udev now +/sbin/chkconfig --del bluetooth 2>&1 &>/dev/null +: + +%post -n libbluetooth -p /sbin/ldconfig +%postun -n libbluetooth -p /sbin/ldconfig + +%preun +if [ $1 -eq 0 ]; then + systemctl -q stop bluetooth + systemctl -q disable bluetooth +fi +: + +%posttrans +if [ $1 -ge 1 ]; then + systemctl -q daemon-reload + systemctl -q enable bluetooth + systemctl -q start bluetooth +fi +: + +%files +%defattr(-,root,root) +%config(noreplace) %{_sysconfdir}/bluetooth/* +#%config(noreplace) %{_sysconfdir}/sysconfig/bluetooth +%config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf +#%config %{_sysconfdir}/default/bluetooth +#%{_sysconfdir}/udev/rules.d/97-bluetooth.rules +%{_sysconfdir}/udev/rules.d/97-bluetooth-hid2hci.rules +%{_sysconfdir}/udev/rules.d/97-bluetooth-serial.rules +#%{_initrddir}/bluetooth +/lib/udev/bluetooth_serial +/lib/udev/hid2hci +/lib/systemd/system/bluetooth.service +%{_datadir}/dbus-1/system-services/org.bluez.service +%{_bindir}/* +%{_sbindir}/* +%{_datadir}/alsa/bluetooth.conf +%{_mandir}/man1/* +%{_mandir}/man8/* +%doc AUTHORS COPYING + +%files -n libbluetooth +%defattr(-,root,root) +%{_libdir}/libbluetooth.so.* +#%{_libdir}/bluetooth/plugins/audio.la +#%{_libdir}/bluetooth/plugins/audio.so +#%{_libdir}/bluetooth/plugins/hal.la +#%{_libdir}/bluetooth/plugins/hal.so +#%{_libdir}/bluetooth/plugins/input.la +#%{_libdir}/bluetooth/plugins/input.so +#%{_libdir}/bluetooth/plugins/netlink.la +#%{_libdir}/bluetooth/plugins/netlink.so +#%{_libdir}/bluetooth/plugins/network.la +#%{_libdir}/bluetooth/plugins/network.so +#%{_libdir}/bluetooth/plugins/serial.la +#%{_libdir}/bluetooth/plugins/serial.so +#%{_libdir}/bluetooth/plugins/service.la +#%{_libdir}/bluetooth/plugins/service.so +%{_libdir}/alsa-lib/libasound_module_ctl_bluetooth.la +%{_libdir}/alsa-lib/libasound_module_ctl_bluetooth.so +%{_libdir}/alsa-lib/libasound_module_pcm_bluetooth.la +%{_libdir}/alsa-lib/libasound_module_pcm_bluetooth.so +%{_libdir}/cups/backend/bluetooth +%if "%{stage1}" != "1" +%{_libdir}/gstreamer-0.10/libgstbluetooth.la +%{_libdir}/gstreamer-0.10/libgstbluetooth.so +%endif +%doc ChangeLog README +#%{_prefix}/libexec/udev/bluetooth_serial + +%files -n libbluetooth-devel +%defattr(-,root,root) +%{_includedir}/bluetooth/*.h +%{_libdir}/libbluetooth.la +%{_libdir}/libbluetooth.so +%{_libdir}/pkgconfig/bluez.pc + +%changelog +* Mon Jul 15 2013 Silvan Calarco 4.101-2mamba +- enable and start bluetooth service upon install + +* Wed Jul 10 2013 Silvan Calarco 4.101-1mamba +- update to 4.101 + +* Sun Jun 03 2012 Silvan Calarco 4.99-1mamba +- update to 4.99 + +* Thu Aug 18 2011 Stefano Cotta Ramusino 4.96-1mamba +- update to 4.96 + +* Mon Jul 25 2011 Automatic Build System 4.95-1mamba +- automatic version update by autodist + +* Sat Jun 25 2011 Automatic Build System 4.94-1mamba +- automatic update by autodist + +* Sat Mar 12 2011 Silvan Calarco 4.89-2mamba +- configure options reworked + +* Thu Mar 10 2011 Silvan Calarco 4.89-1mamba +- update to 4.89 + +* Mon Aug 16 2010 Automatic Build System 4.69-1mamba +- automatic update by autodist + +* Fri Jul 09 2010 Automatic Build System 4.67-1mamba +- automatic update by autodist + +* Sat Jun 26 2010 Automatic Build System 4.66-1mamba +- automatic update by autodist + +* Fri Feb 19 2010 Stefano Cotta Ramusino 4.61-1mamba +- update to 4.61 + +* Mon Jan 04 2010 Stefano Cotta Ramusino 4.59-1mamba +- update to 4.59 +- added patches to support more bluetooth devices +- added missing build requirements + +* Thu Oct 15 2009 Automatic Build System 4.56-1mamba +- automatic update by autodist + +* Thu Aug 27 2009 Automatic Build System 4.50-1mamba +- automatic update by autodist + +* Thu Aug 20 2009 Automatic Build System 4.48-1mamba +- automatic update by autodist + +* Fri Aug 07 2009 Automatic Build System 4.47-1mamba +- automatic update by autodist + +* Sat Jul 25 2009 Automatic Build System 4.46-1mamba +- automatic update by autodist + +* Mon Jul 06 2009 Automatic Build System 4.43-1mamba +- automatic update by autodist + +* Sat Jun 27 2009 Automatic Build System 4.42-1mamba +- automatic update by autodist + +* Thu Jun 18 2009 Automatic Build System 4.41-1mamba +- automatic update by autodist + +* Sat May 02 2009 Automatic Build System 4.37-1mamba +- automatic update by autodist + +* Mon Apr 20 2009 Automatic Build System 4.36-1mamba +- automatic update by autodist + +* Sat Apr 18 2009 Silvan Calarco 4.34-4mamba +- removed library duplicates in bluez package + +* Mon Apr 13 2009 Silvan Calarco 4.34-3mamba +- don't obsolete libbluez for compatibility + +* Fri Apr 10 2009 Silvan Calarco 4.34-2mamba +- rebuilt enabling configure options instead of --enable-all + +* Thu Apr 09 2009 Silvan Calarco 4.34-1mamba +- update to 4.34 + +* Wed May 28 2008 Silvan Calarco 3.32-1mamba +- update to 3.32 +- fixed udev rules file location + +* Mon Apr 28 2008 Silvan Calarco 3.30-1mamba +- update to 3.30 +- added requirement for bluez-firmware + +* Tue Mar 06 2007 Silvan Calarco 3.9-1qilnx +- update to version 3.9 by autospec + +* Tue Feb 21 2006 Davide Madrisan 2.25-2qilnx +- start and stop the bluetooth service using 'service' +- enable and start the bluetooth service by default + +* Wed Feb 01 2006 Stefano Cotta Ramusino 2.25-1qilnx +- update to version 2.25 by autospec +- added initscript patch + +* Wed Dec 07 2005 Alessandro Ramazzina 2.22-1qilnx +- update to version 2.22 by autospec + +* Thu Oct 13 2005 Alessandro Ramazzina 2.21-1qilnx +- update to version 2.21 by autospec + +* Fri Aug 26 2005 Davide Madrisan 2.19-1qilnx +- update to version 2.19 by autospec +- also fix security issue QSA-2005-092 (CAN-2005-2547) +- dbus support enabled + +* Wed Dec 01 2004 Silvan Calarco 2.11-2qilnx +- added initscript chkconfig header + +* Mon Nov 29 2004 Silvan Calarco 2.11-1qilnx +- new version build +- added bluetooth initscript + +* Fri Sep 10 2004 Silvan Calarco 2.10-1qilnx +- first build