From 1e336b23d945ed045c19a5d19a844b336dbce10a Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Thu, 11 Sep 2008 02:10:24 +0000 Subject: [PATCH] First import --- .cvsignore | 1 + bluetooth.conf | 6 ++ bluetooth.init | 57 ++++++++++ bluez-4.4-input.patch | 35 +++++++ bluez-utils-oui-usage.patch | 33 ++++++ bluez.spec | 201 ++++++++++++++++++++++++++++++++++++ import.log | 1 + sources | 1 + 8 files changed, 335 insertions(+) create mode 100644 bluetooth.conf create mode 100644 bluetooth.init create mode 100644 bluez-4.4-input.patch create mode 100644 bluez-utils-oui-usage.patch create mode 100644 bluez.spec create mode 100644 import.log diff --git a/.cvsignore b/.cvsignore index e69de29..56dbba3 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +bluez-4.4.tar.gz diff --git a/bluetooth.conf b/bluetooth.conf new file mode 100644 index 0000000..0d6c5fe --- /dev/null +++ b/bluetooth.conf @@ -0,0 +1,6 @@ +# Enable this to use hid2hci to switch a Bluetooth device in USB HID mode +# to HCI mode for Bluetooth operation. +#HID2HCI_ENABLE=true + +# Enable this to switch capable devices back to HID mode on Bluetooth shutdown +#HID2HCI_UNDO=true diff --git a/bluetooth.init b/bluetooth.init new file mode 100644 index 0000000..c645ba6 --- /dev/null +++ b/bluetooth.init @@ -0,0 +1,57 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Required-Start: $syslog messagebus +# Short-Description: Bluetooth services +# Description: Bluetooth services for service discovery, authentication, +# Human Interface Devices, etc. +### END INIT INFO + +# Source function library. +. /etc/rc.d/init.d/functions + +[ -e /etc/sysconfig/bluetooth ] && . /etc/sysconfig/bluetooth + +start() +{ + echo -n $"Starting Bluetooth services:" + [ "$HID2HCI_ENABLE" = "true" ] && hid2hci --tohci > /dev/null 2>&1 || : + touch /var/lock/subsys/bluetooth + echo "" + return $RETVAL +} + +stop() +{ + echo -n "Stopping Bluetooth services:" + [ "$HID2HCI_UNDO" = "true" ] && hid2hci --tohid > /dev/null 2>&1 || : + rm -f /var/lock/subsys/bluetooth + echo "" + return $RETVAL +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + force-reload|restart|reload) + stop + start + ;; + try-restart|condrestart) + [ -e /var/lock/subsys/bluetooth ] && (stop; start) + ;; + status) + status hcid + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" + exit 3 + ;; +esac + +exit $RETVAL diff --git a/bluez-4.4-input.patch b/bluez-4.4-input.patch new file mode 100644 index 0000000..6327ae1 --- /dev/null +++ b/bluez-4.4-input.patch @@ -0,0 +1,35 @@ +commit af3684270a0fe4a753e5199dfa58acd7f9b2038c +Author: Marcel Holtmann +Date: Wed Sep 10 00:19:00 2008 +0200 + + The input connect method takes no parameters + +diff --git a/input/device.c b/input/device.c +index 0283918..d079831 100644 +--- a/input/device.c ++++ b/input/device.c +@@ -912,14 +912,9 @@ static DBusMessage *device_connect(DBusConnection *conn, + struct input_device *idev = data; + struct input_conn *iconn; + struct fake_input *fake; +- const char *svc; + int err; + +- if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &svc, +- DBUS_TYPE_INVALID) == FALSE) +- return NULL; +- +- iconn = find_connection(idev->connections, svc); ++ iconn = find_connection(idev->connections, "HID"); + if (!iconn) + return not_supported(msg); + +@@ -1012,7 +1007,7 @@ static void device_unregister(void *data) + } + + static GDBusMethodTable device_methods[] = { +- { "Connect", "s", "", device_connect, ++ { "Connect", "", "", device_connect, + G_DBUS_METHOD_FLAG_ASYNC }, + { "Disconnect", "", "", device_disconnect }, + { "IsConnected", "", "b", device_is_connected }, diff --git a/bluez-utils-oui-usage.patch b/bluez-utils-oui-usage.patch new file mode 100644 index 0000000..5b0e532 --- /dev/null +++ b/bluez-utils-oui-usage.patch @@ -0,0 +1,33 @@ +Index: common/oui.c +=================================================================== +RCS file: /cvsroot/bluez/utils/common/oui.c,v +retrieving revision 1.2 +diff -u -p -r1.2 oui.c +--- common/oui.c 13 Jan 2007 17:48:12 -0000 1.2 ++++ common/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.spec b/bluez.spec new file mode 100644 index 0000000..3cc1e98 --- /dev/null +++ b/bluez.spec @@ -0,0 +1,201 @@ +Summary: Bluetooth libraries and utilities +Name: bluez +Version: 4.4 +Release: 2%{?dist} +License: GPLv2+ +Group: System Environment/Libraries +Source: http://www.kernel.org/pub/linux/bluetooth/%{name}-%{version}.tar.gz +Source1: bluetooth.init +Source2: bluetooth.conf +Patch1: bluez-utils-oui-usage.patch +Patch2: bluez-4.4-input.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +URL: http://www.bluez.org/ + +BuildRequires: flex +BuildRequires: dbus-devel >= 0.90 +BuildRequires: libusb-devel, glib2-devel, alsa-lib-devel +BuildRequires: gstreamer-plugins-base-devel, gstreamer-devel +BuildRequires: libsndfile-devel + +ExcludeArch: s390 s390x + +%description +Libraries and utilities for use in Bluetooth applications. + +The BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A. + +%package libs +Summary: Libraries for use in Bluetooth applications +Group: System Environment/Libraries + +%package libs-devel +Summary: Development libraries for Bluetooth applications +Group: Development/Libraries +Requires: bluez-libs = %{version} +Requires: pkgconfig +Obsoletes: bluez-sdp-devel < 4.0 + +%package utils-cups +Summary: CUPS printer backend for Bluetooth printers +Group: System Environment/Daemons +Requires: bluez-libs = %{version} +Requires: cups + +%package utils-gstreamer +Summary: GStreamer support for SBC audio format +Group: System Environment/Daemons +Requires: bluez-libs = %{version} + +%package utils-alsa +Summary: ALSA support for Bluetooth audio devices +Group: System Environment/Daemons +Requires: bluez-libs = %{version} + +%package utils +Summary: Bluetooth utilities +Group: Applications/System +Obsoletes: bluez-pan < 4.0, bluez-sdp < 4.0 +Requires: initscripts, bluez-libs = %{version} +Requires: dbus >= 0.60 +Requires: hwdata >= 0.215 +Requires: dbus-bluez-pin-helper +Requires(preun): /sbin/chkconfig, /sbin/service +Requires(post): /sbin/chkconfig, /sbin/service + +%description utils-cups +This package contains the CUPS backend + +%description utils-gstreamer +This package contains gstreamer plugins for the Bluetooth SBC audio format + +%description utils-alsa +This package contains ALSA support for Bluetooth audio devices + +%description libs +Libraries for use in Bluetooth applications. + +%description libs-devel +bluez-libs-devel contains development libraries and headers for +use in Bluetooth applications. + +%description utils +Bluetooth utilities (bluez-utils): + - hcitool + - hciattach + - hciconfig + - hcid + - l2ping + - start scripts (Red Hat) + - pcmcia configuration files + +%prep + +%setup -q +%patch1 -p0 -b .oui +%patch2 -p1 -b .input + +%build +%configure --enable-cups --enable-hid2hci --enable-dfutool --enable-tools --enable-bccmd --enable-gstreamer --enable-hidd --enable-pand --enable-dund +make + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT +/sbin/ldconfig -n $RPM_BUILD_ROOT/%{_libdir} +# Remove autocrap and libtool droppings +rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la \ + $RPM_BUILD_ROOT/%{_libdir}/alsa-lib/*.la \ + $RPM_BUILD_ROOT/%{_libdir}/bluetooth/plugins/*.la \ + $RPM_BUILD_ROOT/%{_libdir}/gstreamer-0.10/*.la +rm -f $RPM_BUILD_ROOT/usr/share/aclocal/bluez.m4 + +install -D -m0755 %SOURCE1 $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/bluetooth +install -D -m0644 %SOURCE2 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/bluetooth + +# Remove the cups backend from libdir, and install it in /usr/lib whatever the install +rm -rf ${RPM_BUILD_ROOT}%{_libdir}/cups +install -D -m0755 cups/bluetooth ${RPM_BUILD_ROOT}/usr/lib/cups/backend/bluetooth + +install -D -m0755 scripts/bluetooth.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 + +%clean +rm -rf $RPM_BUILD_ROOT + +%post libs -p /sbin/ldconfig + +%post utils +/sbin/chkconfig --del hidd >/dev/null 2>&1 || : +/sbin/chkconfig --del dund >/dev/null 2>&1 || : +/sbin/chkconfig --del pand >/dev/null 2>&1 || : + +/sbin/chkconfig --add bluetooth +if [ "$1" -ge "1" ]; then + /sbin/service bluetooth condrestart >/dev/null 2>&1 || : +fi +exit 0 + +%postun libs -p /sbin/ldconfig + +%preun utils +if [ "$1" = "0" ]; then + /sbin/service bluetooth stop >/dev/null 2>&1 || : + /sbin/service dund stop >/dev/null 2>&1 || : + /sbin/service pand stop >/dev/null 2>&1 || : + /sbin/chkconfig --del bluetooth + /sbin/chkconfig --del dund 2>&1 || : + /sbin/chkconfig --del pand 2>&1 || : +fi + +%files utils +%defattr(-, root, root) +%{_bindir}/* +%{_sbindir}/* +%{_mandir}/man1/* +%{_mandir}/man8/* +%dir %{_sysconfdir}/bluetooth/ +%config(noreplace) %{_sysconfdir}/bluetooth/* +%config(noreplace) %{_sysconfdir}/sysconfig/* +%config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf +%{_libdir}/bluetooth/plugins/*.so +/lib/udev/bluetooth_serial +%{_sysconfdir}/udev/rules.d/97-bluetooth-serial.rules +/etc/rc.d/init.d/* + +%files libs +%defattr(-, root, root) +%{_libdir}/libbluetooth.so.* +%doc AUTHORS COPYING INSTALL ChangeLog README + +%files libs-devel +%defattr(-, root, root) +%{_libdir}/libbluetooth.so +%dir %{_includedir}/bluetooth +%{_includedir}/bluetooth/* +%{_libdir}/pkgconfig/bluez.pc + +%files utils-cups +%defattr(-, root, root) +/usr/lib/cups/backend/bluetooth + +%files utils-gstreamer +%defattr(-, root, root) +%{_libdir}/gstreamer-*/*.so + +%files utils-alsa +%defattr(-, root, root) +%{_libdir}/alsa-lib/*.so + +%changelog +* Tue Sep 09 2008 - David Woodhouse - 4.4-2 +- Fix rpmlint problems +- Fix input device handling + +* Tue Sep 09 2008 - Bastien Nocera - 4.4-1 +- Update to 4.4 +- Update source address, and remove unneeded deps (thanks Marcel) + +* Mon Aug 11 2008 - Bastien Nocera - 4.1-1 +- Initial build diff --git a/import.log b/import.log new file mode 100644 index 0000000..94d1b84 --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +bluez-4_4-2_fc10:HEAD:bluez-4.4-2.fc10.src.rpm:1221099001 diff --git a/sources b/sources index e69de29..e341dee 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +0fd526ecea7fa7fb53298e8f335526c6 bluez-4.4.tar.gz