bluez/bluez.spec

290 lines
8 KiB
RPMSpec
Raw Normal View History

2012-02-01 14:28:20 +04:00
%define major 3
%define libname %mklibname %{name} %{major}
%define devname %mklibname -d %{name}
2012-08-21 13:12:03 +04:00
%bcond_without systemd
2012-02-01 14:28:20 +04:00
Name: bluez
Summary: Official Linux Bluetooth protocol stack
2012-08-21 13:12:03 +04:00
Version: 4.101
Release: 9
2012-02-01 14:28:20 +04:00
License: GPLv2+
Group: Communications
2012-08-21 13:12:03 +04:00
URL: http://www.bluez.org/
Source0: http://www.kernel.org/pub/linux/bluetooth/%{name}-%{version}.tar.xz
2012-02-01 14:28:20 +04:00
Source6: pand.conf
Source7: dund.conf
Source8: hidd.conf
Source9: rfcomm.conf
2012-08-21 13:12:03 +04:00
Source10: bluez-uinput.modules
2012-02-01 14:28:20 +04:00
2012-08-21 13:12:03 +04:00
# http://thread.gmane.org/gmane.linux.bluez.kernel/8645
Patch0: 0002-systemd-unitdir-enable.patch
2013-02-28 15:49:54 +04:00
Patch1: bluez-4.101-automake-1.13.patch
2012-08-21 13:12:03 +04:00
Patch4: bluez-socket-mobile-cf-connection-kit.patch
# http://thread.gmane.org/gmane.linux.bluez.kernel/2396
Patch5: 0001-Add-sixaxis-cable-pairing-plugin.patch
# PS3 BD Remote patches
Patch6: 0001-input-Add-helper-function-to-request-disconnect.patch
Patch7: 0002-fakehid-Disconnect-from-PS3-remote-after-10-mins.patch
Patch8: 0003-fakehid-Use-the-same-constant-as-declared.patch
Patch9: bluez-4.101-fix-c++11-compatibility.patch
2012-02-01 14:28:20 +04:00
2013-03-11 16:31:13 +04:00
Patch0503: 0503-systemd-Fix-unit-to-correct-path-to-bluetoothd.patch
2012-02-01 14:28:20 +04:00
BuildRequires: flex
BuildRequires: bison
2013-03-18 11:21:48 +04:00
BuildRequires: systemd
2012-08-21 13:12:03 +04:00
BuildRequires: readline-devel
2012-02-01 14:28:20 +04:00
BuildRequires: expat-devel
2012-08-21 13:12:03 +04:00
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(gstreamer-plugins-base-0.10)
BuildRequires: pkgconfig(gstreamer-0.10)
BuildRequires: pkgconfig(libcap-ng)
BuildRequires: pkgconfig(libusb)
2013-02-28 15:49:54 +04:00
BuildRequires: pkgconfig(libusb-1.0)
2012-08-21 13:12:03 +04:00
BuildRequires: pkgconfig(udev) >= 186
2012-02-01 14:28:20 +04:00
Requires: bluez-pin
2012-08-21 13:12:03 +04:00
Suggests: obex-data-server
2012-02-01 14:28:20 +04:00
Suggests: bluez-firmware
%description
These are the official Bluetooth communication libraries for Linux.
%post
update-alternatives --install /bin/bluepin bluepin /usr/bin/bluepin 5
#migrate old configuration
if [ "$1" = "2" -a -d %{_var}/lib/lib/bluetooth ]; then
mv -f %{_var}/lib/lib/bluetooth/* %{_var}/lib/bluetooth/ > /dev/null 2>&1 || exit 0
rmdir %{_var}/lib/lib/bluetooth/ > /dev/null 2>&1 || exit 0
rmdir %{_var}/lib/lib/ > /dev/null 2>&1 || exit 0
fi
2012-08-21 13:12:03 +04:00
if [ $1 -eq 1 ]; then
/bin/systemctl enable bluetooth.service >/dev/null 2>&1 || :
fi
2012-02-01 14:28:20 +04:00
%postun
if [ "$1" = "0" ]; then
update-alternatives --remove bluepin /usr/bin/bluepin
fi
2012-08-21 13:12:03 +04:00
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
/bin/systemctl try-restart bluetooth.service >/dev/null 2>&1 || :
fi
%triggerun -- bluez < 4.94-4
/bin/systemctl --no-reload enable bluetooth.service >/dev/null 2>&1 || :
2012-02-01 14:28:20 +04:00
%files
2012-08-21 13:12:03 +04:00
%{_bindir}/ciptool
%{_bindir}/dfutool
%{_bindir}/gatttool
%{_bindir}/hcitool
%{_bindir}/hidd
%{_bindir}/l2ping
%{_bindir}/rfcomm
%{_bindir}/sdptool
### compat
%{_bindir}/dund
%{_bindir}/pand
###
%{_sbindir}/bccmd
%{_sbindir}/hciattach
%{_sbindir}/hciconfig
%{_sbindir}/bluetoothd
/bin/hidd
2012-02-01 14:28:20 +04:00
/sbin/bluetoothd
2012-08-21 13:12:03 +04:00
%if %{with systemd}
2013-02-28 15:49:54 +04:00
%{_unitdir}/*.service
2012-02-01 14:28:20 +04:00
%endif
%{_mandir}/man?/*
%config(noreplace) %{_sysconfdir}/sysconfig/*
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/*.conf
%config(noreplace) %{_sysconfdir}/bluetooth
%{_datadir}/dbus-1/system-services/org.bluez.service
/lib/udev/bluetooth_serial
/lib/udev/hid2hci
%{_sysconfdir}/udev/rules.d/97-bluetooth-serial.rules
%{_sysconfdir}/udev/rules.d/97-bluetooth-hid2hci.rules
%{_localstatedir}/lib/bluetooth
#--------------------------------------------------------------------
2012-08-21 13:12:03 +04:00
%package cups
Summary: CUPS printer backend for Bluetooth printers
Group: System/Servers
Requires: cups
2012-02-01 14:28:20 +04:00
2012-08-21 13:12:03 +04:00
%description cups
2012-02-01 14:28:20 +04:00
This package contains the CUPS backend for Bluetooth printers.
2012-08-21 13:12:03 +04:00
%files cups
2012-02-01 14:28:20 +04:00
%{_prefix}/lib/cups/backend/bluetooth
#--------------------------------------------------------------------
2012-08-21 13:12:03 +04:00
%package gstreamer
Summary: Gstreamer support for SBC audio format
Group: Sound
2012-02-01 14:28:20 +04:00
2012-08-21 13:12:03 +04:00
%description gstreamer
2012-02-01 14:28:20 +04:00
This package contains gstreamer plugins for the Bluetooth SBC audio format
2012-08-21 13:12:03 +04:00
%files gstreamer
2012-02-01 14:28:20 +04:00
%{_libdir}/gstreamer-*/*.so
#--------------------------------------------------------------------
2012-08-21 13:12:03 +04:00
%package alsa
Summary: ALSA support for Bluetooth audio devices
Group: Sound
2012-02-01 14:28:20 +04:00
2012-08-21 13:12:03 +04:00
%description alsa
2012-02-01 14:28:20 +04:00
This package contains ALSA support for Bluetooth audio devices
2012-08-21 13:12:03 +04:00
%files alsa
2012-02-01 14:28:20 +04:00
%{_libdir}/alsa-lib/*.so
%{_datadir}/alsa/bluetooth.conf
#--------------------------------------------------------------------
%package -n %{libname}
Summary: Official Linux Bluetooth protocol stack
Group: System/Libraries
%description -n %{libname}
These are the official Bluetooth communication libraries for Linux.
%files -n %{libname}
/%{_lib}/lib*.so.%{major}*
#--------------------------------------------------------------------
2012-08-21 13:12:03 +04:00
%package test
Summary: Tools for testing of various Bluetooth-functions
Group: System/Servers
Requires: python-dbus
Requires: python-gobject
%description test
Contains a few tools for testing various bluetooth functions. The
BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A.
%files test
%{_bindir}/simple-agent
%{_bindir}/test-*
#--------------------------------------------------------------------
2012-02-01 14:28:20 +04:00
%package -n %{devname}
2012-08-21 13:12:03 +04:00
Summary: Headers for developing programs that will use %{name}
2012-02-01 14:28:20 +04:00
Group: Development/C++
Requires: %{libname} = %{version}
Provides: %{name}-devel = %{version}-%{release}
%description -n %{devname}
This package contains the headers that programmers will need to develop
applications which will use libraries from %{name}.
2012-08-21 13:12:03 +04:00
%files -n %{devname}
2012-02-01 14:28:20 +04:00
%doc AUTHORS ChangeLog README
%dir %{_includedir}/bluetooth
%{_includedir}/bluetooth/*.h
/%{_lib}/*.so
%{_libdir}/pkgconfig/bluez.pc
#--------------------------------------------------------------------
%prep
2012-08-21 13:12:03 +04:00
%setup -q
%apply_patches
2012-02-01 14:28:20 +04:00
2012-08-21 13:12:03 +04:00
libtoolize -f -c
autoreconf -fi
2012-02-01 14:28:20 +04:00
%build
2012-08-21 13:12:03 +04:00
%configure2_5x \
--libdir=/%{_lib} \
%if !%{with systemd}
--without-systemdsystemunitdir \
2012-02-01 14:28:20 +04:00
%endif
2012-08-21 13:12:03 +04:00
--enable-cups \
--enable-dfutool \
--enable-audio \
--enable-health \
--disable-hal \
--enable-pnat \
--enable-wiimote \
--enable-tools \
--enable-bccmd \
--enable-gstreamer \
--enable-hidd \
--enable-pand \
--enable-dund \
--enable-hid2hci \
--enable-pcmcia \
--with-systemdsystemunitdir=/lib/systemd/system
2012-02-01 14:28:20 +04:00
%make
%install
%makeinstall_std rulesdir=%{_sysconfdir}/udev/rules.d udevdir=/lib/udev
mkdir -p %{buildroot}%{_libdir}
mv %{buildroot}/%{_lib}/gstreamer-0.10 %{buildroot}%{_libdir}
cat << EOF > %{buildroot}%{_sysconfdir}/bluetooth/pin
1234
EOF
chmod 600 %{buildroot}%{_sysconfdir}/bluetooth/pin
2012-08-21 13:12:03 +04:00
rm -f %{buildroot}%{_sysconfdir}/default/bluetooth %{buildroot}%{_sysconfdir}/init.d/bluetooth
install -m644 %{SOURCE6} -D %{buildroot}%{_sysconfdir}/sysconfig/pand
install -m644 %{SOURCE7} -D %{buildroot}%{_sysconfdir}/sysconfig/dund
install -m644 %{SOURCE8} -D %{buildroot}%{_sysconfdir}/sysconfig/hidd
install -m644 %{SOURCE9} -D %{buildroot}%{_sysconfdir}/sysconfig/rfcomm
2012-02-01 14:28:20 +04:00
rm -rf %{buildroot}/%{_lib}/pkgconfig
install -m644 bluez.pc -D %{buildroot}%{_libdir}/pkgconfig/bluez.pc
# Remove the cups backend from libdir, and install it in /usr/lib whatever the install
if test -d %{buildroot}/%{_lib}/cups ; then
2012-08-21 13:12:03 +04:00
install -D -m0755 %{buildroot}/%{_lib}/cups/backend/bluetooth %{buildroot}%{_prefix}/lib/cups/backend/bluetooth
2012-02-01 14:28:20 +04:00
rm -rf %{buildroot}/%{_lib}/cups
fi
cp test/test-* %{buildroot}%{_bindir}
cp test/simple-agent %{buildroot}%{_bindir}/simple-agent
2012-08-21 13:12:03 +04:00
rm -f %{buildroot}%{_bindir}/test-*.c
2012-02-01 14:28:20 +04:00
2012-08-21 13:12:03 +04:00
mkdir -p %{buildroot}/{bin,sbin}
mv %{buildroot}%{_bindir}/hidd %{buildroot}/bin
mv %{buildroot}%{_sbindir}/bluetoothd %{buildroot}/sbin
# sym link just to be safe
pushd %{buildroot}
ln -s /bin/hidd %{buildroot}%{_bindir}/hidd
ln -s /sbin/bluetoothd %{buildroot}%{_sbindir}/bluetoothd
popd
2012-02-01 14:28:20 +04:00
#install more config files
install -m0644 audio/audio.conf %{buildroot}%{_sysconfdir}/bluetooth/
install -m0644 network/network.conf %{buildroot}%{_sysconfdir}/bluetooth/
install -m0644 input/input.conf %{buildroot}%{_sysconfdir}/bluetooth/
install -m0644 serial/serial.conf %{buildroot}%{_sysconfdir}/bluetooth/
2012-08-21 13:12:03 +04:00
mkdir -p %{buildroot}%{_libdir}/alsa-lib/
mv %{buildroot}/%{_lib}/alsa-lib/*.so %{buildroot}%{_libdir}/alsa-lib/
2012-02-01 14:28:20 +04:00
2012-08-21 13:12:03 +04:00
install -d -m0755 %{buildroot}%{_localstatedir}/lib/bluetooth
2012-02-01 14:28:20 +04:00
2013-02-28 15:49:54 +04:00
ln -s bluetooth.service %{buildroot}%{_unitdir}/dbus-org.bluez.service
2012-02-01 14:28:20 +04:00
# (akdengi) enable auto for a2pd
2012-02-01 14:28:20 +04:00
sed -e 's/#AutoConnect=true/AutoConnect=true/' -i %{buildroot}%{_sysconfdir}/bluetooth/audio.conf