diff --git a/bluez-5.64.tar.xz b/bluez-5.64.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..f00ada070b22a065a5414074ef50626ca6f8e1c2 Binary files /dev/null and b/bluez-5.64.tar.xz differ diff --git a/bluez.spec b/bluez.spec new file mode 100644 index 0000000000000000000000000000000000000000..2581a06cd4aee42a85b655bfb6a46950daf40762 --- /dev/null +++ b/bluez.spec @@ -0,0 +1,311 @@ +%define anolis_release 1 + +%bcond_with deprecated + +Name: bluez +Version: 5.64 +Release: %{anolis_release}%{?dist} +Summary: Bluetooth utilities +License: GPLv2+ +URL: http://www.bluez.org/ + +Source0: http://www.kernel.org/pub/linux/bluetooth/%{name}-%{version}.tar.xz + +BuildRequires: dbus-devel >= 1.6 +BuildRequires: glib2-devel +BuildRequires: libell-devel >= 0.37 +BuildRequires: libical-devel +BuildRequires: make +BuildRequires: readline-devel +# For bluetooth mesh +BuildRequires: json-c-devel +# For cable pairing +BuildRequires: systemd-devel +# For printing +BuildRequires: cups-devel +# For autoreconf +BuildRequires: libtool automake autoconf +# For man pages +BuildRequires: python3-docutils + +Requires: dbus >= 1.6 +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd + +%description +Utilities for use in Bluetooth applications: + - avinfo + - bluemoon + - bluetoothctl + - bluetoothd + - btattach + - btmon + - hex2hcd + - l2ping + - l2test + - mpris-proxy + - rctest + +The BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A. + +%package cups +Summary: CUPS printer backend for Bluetooth printers +Requires: bluez%{?_isa} = %{version}-%{release} +Requires: cups + +%description cups +This package contains the CUPS backend + +%if %{with deprecated} +%package deprecated +Summary: Deprecated Bluetooth applications +Requires: bluez%{?_isa} = %{version}-%{release} +Obsoletes: bluez < 5.55 + +%description deprecated +Bluetooth applications that have bee deprecated by upstream. They have been +replaced by funcationality in the core bluetoothctl and will eventually +be dropped by upstream. Utilities include: + - ciptool + - gatttool + - hciattach + - hciconfig + - hcidump + - hcitool + - rfcomm + - sdptool +%endif + +%package libs +Summary: Libraries for use in Bluetooth applications + +%description libs +Libraries for use in Bluetooth applications. + +%package libs-devel +Summary: Development libraries for Bluetooth applications +Requires: bluez-libs%{?_isa} = %{version}-%{release} + +%description libs-devel +bluez-libs-devel contains development libraries and headers for +use in Bluetooth applications. + +%package hid2hci +Summary: Put HID proxying bluetooth HCI's into HCI mode +Requires: bluez%{?_isa} = %{version}-%{release} + +%description hid2hci +Most allinone PC's and bluetooth keyboard / mouse sets which include a +bluetooth dongle, ship with a so called HID proxying bluetooth HCI. +The HID proxying makes the keyboard / mouse show up as regular USB HID +devices (after connecting using the connect button on the device + keyboard), +which makes them work without requiring any manual configuration. + +The bluez-hid2hci package contains the hid2hci utility and udev rules to +automatically switch supported Bluetooth devices into regular HCI mode. + +Install this package if you want to use the bluetooth function of the HCI +with other bluetooth devices like for example a mobile phone. + +Note that after installing this package you will first need to pair your +bluetooth keyboard and mouse with the bluetooth adapter before you can use +them again. Since you cannot use your bluetooth keyboard and mouse until +they are paired, this will require the use of a regular (wired) USB keyboard +and mouse. + +%package mesh +Summary: Bluetooth mesh +Requires: bluez%{?_isa} = %{version}-%{release} +Requires: bluez-libs%{?_isa} = %{version}-%{release} + +%description mesh +Services for bluetooth mesh + +%package obexd +Summary: Object Exchange daemon for sharing content +Requires: bluez%{?_isa} = %{version}-%{release} +Requires: bluez-libs%{?_isa} = %{version}-%{release} + +%description obexd +Object Exchange daemon for sharing files, contacts etc over bluetooth + +%prep +%autosetup -p1 + +%build +autoreconf -vif +%configure --enable-tools --enable-library --disable-optimization \ +%if %{with deprecated} + --enable-deprecated \ +%endif + --enable-sixaxis --enable-cups --enable-nfc --enable-mesh \ + --enable-hid2hci --enable-testing \ + --with-systemdsystemunitdir=%{_unitdir} \ + --with-systemduserunitdir=%{_userunitdir} + +%{make_build} + +%install +%{make_install} + +%if %{with deprecated} +# "make install" fails to install gatttool, necessary for Bluetooth Low Energy +# Red Hat Bugzilla bug #1141909, Debian bug #720486 +install -m0755 attrib/gatttool $RPM_BUILD_ROOT%{_bindir} +%endif + +# "make install" fails to install avinfo +# Red Hat Bugzilla bug #1699680 +install -m0755 tools/avinfo $RPM_BUILD_ROOT%{_bindir} + +# btmgmt is not installed by "make install", but it is useful for debugging +# some issues and to set the MAC address on HCIs which don't have their +# MAC address configured +install -m0755 tools/btmgmt $RPM_BUILD_ROOT%{_bindir} + +# Remove libtool archive +find $RPM_BUILD_ROOT -name '*.la' -delete + +# Remove the cups backend from libdir, and install it in /usr/lib whatever the install +if test -d ${RPM_BUILD_ROOT}/usr/lib64/cups ; then + install -D -m0755 ${RPM_BUILD_ROOT}/usr/lib64/cups/backend/bluetooth ${RPM_BUILD_ROOT}%_cups_serverbin/backend/bluetooth + rm -rf ${RPM_BUILD_ROOT}%{_libdir}/cups +fi + +rm -f ${RPM_BUILD_ROOT}/%{_sysconfdir}/udev/*.rules ${RPM_BUILD_ROOT}/usr/lib/udev/rules.d/*.rules +install -D -p -m0644 tools/hid2hci.rules ${RPM_BUILD_ROOT}/%{_udevrulesdir}/97-hid2hci.rules + +install -d -m0755 $RPM_BUILD_ROOT/%{_localstatedir}/lib/bluetooth +install -d -m0755 $RPM_BUILD_ROOT/%{_localstatedir}/lib/bluetooth/mesh + +mkdir -p $RPM_BUILD_ROOT/%{_libdir}/bluetooth/ + +#copy bluetooth config file and setup auto enable +install -D -p -m0644 src/main.conf ${RPM_BUILD_ROOT}/etc/bluetooth/main.conf +install -D -p -m0644 mesh/mesh-main.conf ${RPM_BUILD_ROOT}/etc/bluetooth/mesh-main.conf +sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' ${RPM_BUILD_ROOT}/%{_sysconfdir}/bluetooth/main.conf + +# Install the HCI emulator, useful for testing +install emulator/btvirt ${RPM_BUILD_ROOT}/%{_libexecdir}/bluetooth/ + +%check +make check + +%ldconfig_scriptlets libs + +%post +%systemd_post bluetooth.service + +%preun +%systemd_preun bluetooth.service + +%postun +%systemd_postun_with_restart bluetooth.service + +%post hid2hci +/sbin/udevadm trigger --subsystem-match=usb + +%post mesh +%systemd_user_post bluetooth-mesh.service + +%preun mesh +%systemd_user_preun bluetooth-mesh.service + +%post obexd +%systemd_user_post obex.service + +%preun obexd +%systemd_user_preun obex.service + +%files +%license COPYING +%doc AUTHORS ChangeLog +%dir %{_sysconfdir}/bluetooth +%config %{_sysconfdir}/bluetooth/main.conf +%config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf +%{_bindir}/avinfo +%{_bindir}/bluemoon +%{_bindir}/bluetoothctl +%{_bindir}/btattach +%{_bindir}/btmgmt +%{_bindir}/btmon +%{_bindir}/hex2hcd +%{_bindir}/l2ping +%{_bindir}/l2test +%{_bindir}/mpris-proxy +%{_bindir}/rctest +%{_mandir}/man1/btattach.1.* +%{_mandir}/man1/btmon.1.* +%{_mandir}/man1/l2ping.1.* +%{_mandir}/man1/rctest.1.* +%{_mandir}/man8/bluetoothd.8.* +%dir %{_libexecdir}/bluetooth +%{_libexecdir}/bluetooth/bluetoothd +%{_libdir}/bluetooth/ +%{_localstatedir}/lib/bluetooth +%{_datadir}/dbus-1/system-services/org.bluez.service +%{_unitdir}/bluetooth.service +%{_datadir}/zsh/site-functions/_bluetoothctl + +%if %{with deprecated} +%files deprecated +%{_bindir}/ciptool +%{_bindir}/gatttool +%{_bindir}/hciattach +%{_bindir}/hciconfig +%{_bindir}/hcidump +%{_bindir}/hcitool +%{_bindir}/rfcomm +%{_bindir}/sdptool +%{_mandir}/man1/ciptool.1.* +%{_mandir}/man1/hciattach.1.* +%{_mandir}/man1/hciconfig.1.* +%{_mandir}/man1/hcidump.1.* +%{_mandir}/man1/hcitool.1.* +%{_mandir}/man1/rfcomm.1.* +%{_mandir}/man1/sdptool.1.* +%endif + +%files libs +%{!?_licensedir:%global license %%doc} +%license COPYING +%{_libdir}/libbluetooth.so.* + +%files libs-devel +%doc doc/*txt +%{_libdir}/libbluetooth.so +%{_includedir}/bluetooth +%{_libdir}/pkgconfig/bluez.pc +%dir %{_libexecdir}/bluetooth +%{_libexecdir}/bluetooth/btvirt + +%files cups +%_cups_serverbin/backend/bluetooth + +%files hid2hci +/usr/lib/udev/hid2hci +%{_mandir}/man1/hid2hci.1* +%{_udevrulesdir}/97-hid2hci.rules + +%files mesh +%doc tools/mesh-gatt/*.json +%config %{_sysconfdir}/bluetooth/mesh-main.conf +%config %{_sysconfdir}/dbus-1/system.d/bluetooth-mesh.conf +%{_bindir}/meshctl +%{_bindir}/mesh-cfgclient +%{_bindir}/mesh-cfgtest +%{_datadir}/dbus-1/system-services/org.bluez.mesh.service +%{_libexecdir}/bluetooth/bluetooth-meshd +%{_unitdir}/bluetooth-mesh.service +%{_localstatedir}/lib/bluetooth/mesh +%{_mandir}/man8/bluetooth-meshd.8* + +%files obexd +%{_libexecdir}/bluetooth/obexd +%{_datadir}/dbus-1/services/org.bluez.obex.service +%{_userunitdir}/obex.service + +%changelog +* Fri Apr 8 2022 Zhongling He 5.64-1 +- Init package from upstream v5.64