-Summary: Bluetooth utilities
-Name: bluez-utils
-Version: 2.2
-Release: 2
-Copyright: GPL
-Group: Applications/System
-Source: http://bluez.sourceforge.net/%{name}-%{version}.tar.gz
-Patch: bluez-utils-build.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-URL: http://bluez.sourceforge.net
-BuildRequires: bluez-libs-devel >= 2.0
-ExcludeArch: s390 s390x
+# TODO:
+# - check init script, add support for rfcomm bind on startup
+#
+Summary: Bluetooth utilities
+Summary(pl): Narzêdzia Bluetooth
+Name: bluez-utils
+Version: 2.7
+Release: 2
+License: GPL v2
+Group: Applications/System
+Source0: http://bluez.sourceforge.net/download/%{name}-%{version}.tar.gz
+# Source0-md5: 5b67e008efa785175cdbc3c8dcdebab2
+Source1: %{name}.init
+Source2: %{name}.sysconfig
+Patch0: %{name}-opt.patch
+Patch1: %{name}-etc_dir.patch
+Patch2: %{name}-cups.patch
+URL: http://bluez.sourceforge.net/
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: bison
+BuildRequires: bluez-libs-devel >= 2.7
+BuildRequires: libtool
+PreReq: rc-scripts
+Requires: bluez-libs >= 2.7
+Obsoletes: bluez-sdp
+ExcludeArch: s390 s390x
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-Bluetooth utilities (bluez-utils):
- - hcitool
- - hciattach
- - hciconfig
- - hcid
- - l2ping
- - start scripts (RedHat)
- - pcmcia configuration files
+Bluetooth utilities:
+ - hcitool
+ - hciattach
+ - hciconfig
+ - hcid
+ - l2ping
+ - start scripts (PLD)
+ - PCMCIA configuration files
The BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A.
+%description -l pl
+Narzêdzia Bluetooth:
+ - hcitool
+ - hciattach
+ - hciconfig
+ - hcid
+ - l2ping
+ - skrypty startowe (PLD)
+ - pliki konfiguracji PCMCIA
-%prep
-rm -rf $RPM_BUILD_ROOT
+%package -n cups-backend-bluetooth
+Summary: Bluetooth backend for CUPS
+Summary(pl): Backend Bluetooth dla CUPS-a
+Group: Applications/Printing
+Requires: bluez-libs >= 2.7
+Requires: cups
+
+%description -n cups-backend-bluetooth
+Bluetooth backend for CUPS.
+
+%description -n cups-backend-bluetooth -l pl
+Backend Bluetooth dla CUPS-a.
+%package init
+Summary: Init script for Bluetooth subsystem
+Summary(pl): Skrypt init dla podsystemu Bluetooth
+Group: Applications/System
+Requires: %{name} = %{epoch}:%{version}
+Requires(post,preun): /sbin/chkconfig
+
+%description init
+Init script for Bluetooth subsystem.
+
+%description init -l pl
+Skrypt init dla podsystemu Bluetooth.
+
+%prep
%setup -q
-%patch -p1
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+
+# fix path (default prefix was /)
+sed -e "s@pin_helper.*bluepin;@pin_helper %{_bindir}/bluepin;@" \
+ hcid/hcid.conf > hcid.conf.tmp
+mv -f hcid.conf.tmp hcid/hcid.conf
%build
-%configure --with-bluez-libs=%{_libdir}
-make
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__automake}
+%configure \
+ --enable-pcmcia \
+ --with-cups=/usr
+%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/bluetooth
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/bluetooth
%clean
rm -rf $RPM_BUILD_ROOT
-%files
-%defattr(-, root, root)
-%doc AUTHORS COPYING INSTALL ChangeLog NEWS README
-/etc/rc.d/init.d/bluetooth
-%{_bindir}/*
-%{_sbindir}/*
-%{_mandir}/man*/*
-%dir %{_sysconfdir}/bluetooth/
-%config %{_sysconfdir}/bluetooth/*
-%config %{_sysconfdir}/pcmcia/bluetooth.conf
-%config %{_sysconfdir}/pcmcia/bluetooth
+%post init
+/sbin/chkconfig --add bluetooth
+if [ -f /var/lock/subsys/bluetooth ]; then
+ /etc/rc.d/init.d/bluetooth restart >&2
+else
+ echo "Run \"/etc/rc.d/init.d/bluetooth\" to start bluetooth." >&2
+fi
-%changelog
-* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
-- rebuilt
+%postun init
+if [ "$1" = "0" ]; then
+ if [ -f /var/lock/subsys/bluetooth ]; then
+ /etc/rc.d/init.d/bluetooth stop 1>&2
+ fi
+ /sbin/chkconfig --del bluetooth
+fi
-* Sun Jan 19 2003 Matt Wilson <msw@redhat.com> 2.2-1
-- configure with --with-bluez-libs=%%{_libdir}
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog README
+%attr(755,root,root) %{_bindir}/*
+%attr(755,root,root) %{_sbindir}/*
+%{_mandir}/man*/*
+%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/bluetooth
+%dir %{_sysconfdir}/bluetooth
+%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/bluetooth/*
+%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pcmcia/bluetooth.conf
+%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pcmcia/bluetooth
-* Fri Jan 17 2003 Bill Nottingham <notting@redhat.com> 2.2-1
-- adapt upstream rpm
+%files -n cups-backend-bluetooth
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_prefix}/lib/cups/backend/bluetooth
-* Tue Aug 13 2002 Sebastian Frankfurt <sf@infesto.de>
-- Initial RPM
+%files init
+%defattr(644,root,root,755)
+%attr(754,root,root) /etc/rc.d/init.d/bluetooth