%global gh_name hsphfpd-prototype %global commit d294d064879591e9570ca3f444fa3eee2f269df8 %global date 20201205 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global selinuxtype targeted %bcond_without selinux Name: hsphfpd Version: 0 Release: 0.4%{?date:.%{date}git%{shortcommit}}%{?dist} Summary: Bluetooth HSP/HFP daemon BuildArch: noarch # Perl license: # https://github.com/pali/hsphfpd-prototype/issues/8 License: GPL+ or Artistic URL: https://github.com/pali/hsphfpd-prototype Source0: %{url}/archive/%{commit}/%{gh_name}-%{version}%{?date:-%{date}git%{shortcommit}}.tar.gz Source1: get-snapshot.sh Source100: hsphfpd.service Source101: org.hsphfpd.service # SELinux policy Source150: %{name}.fc Source151: %{name}.if Source152: %{name}.te # Allow access to hsphfpd to anyone, same as org.bluez policy Patch0: %{name}-dbus-policy.patch BuildRequires: systemd-rpm-macros Requires: dbus-common Requires: perl(Net::DBus) %if %{with selinux} # This ensures that the *-selinux package and all it’s dependencies are not pulled # into containers and other systems that do not use SELinux Requires: (%{name}-selinux = %{version}-%{release} if selinux-policy-%{selinuxtype}) %endif %description hsphfpd is specification with some prototype implementation used for connecting Bluetooth devices with HSP and HFP profiles on Linux operating system. These two Bluetooth profiles are used by Bluetooth headphones, headsets or other equipments and are they only standard way how to transfer sound from microphone to computer. %if %{with selinux} %package selinux Summary: %{name} SELinux policy BuildArch: noarch Requires: selinux-policy-%{selinuxtype} Requires(post): selinux-policy-%{selinuxtype} BuildRequires: selinux-policy-devel %{?selinux_requires} %description selinux Custom SELinux policy module for %{name} %endif %prep %autosetup -n %{gh_name}-%{commit} %if %{with selinux} %build mkdir selinux pushd selinux cp -p %{SOURCE150} %{SOURCE151} %{SOURCE152} . make -f %{_datadir}/selinux/devel/Makefile NAME=%{selinuxtype} %{name}.pp bzip2 -9 %{name}.pp popd %endif %install install -D -m 755 -pv hsphfpd.pl %{buildroot}%{_bindir}/%{name} install -D -m 644 -pv sco_features.pl %{buildroot}%{_bindir}/sco_features.pl install -D -m 644 -pv telephony_client.pl %{buildroot}%{_datadir}/%{name}/telephony_client.pl install -D -m 644 -pv org.hsphfpd.conf %{buildroot}%{_datadir}/dbus-1/system.d/org.hsphfpd.conf install -D -m 644 -pv %{SOURCE100} %{buildroot}%{_unitdir}/%{name}.service install -D -m 644 -pv %{SOURCE101} %{buildroot}%{_datadir}/dbus-1/system-services/org.hsphfpd.service %if %{with selinux} install -D -m 0644 -vp selinux/%{name}.pp.bz2 \ %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2 %endif %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun %{name}.service %if %{with selinux} %pre selinux %selinux_relabel_pre -s %{selinuxtype} %post selinux %selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2 %postun selinux %selinux_modules_uninstall -s %{selinuxtype} %{name} %posttrans selinux %selinux_relabel_post -s %{selinuxtype} %endif %files #license LICENSE %doc README hsphfpd.txt %{_bindir}/%{name} %{_bindir}/sco_features.pl %{_datadir}/%{name}/telephony_client.pl %{_datadir}/dbus-1/system.d/org.hsphfpd.conf %{_datadir}/dbus-1/system-services/org.hsphfpd.service %{_unitdir}/%{name}.service %if %{with selinux} %files selinux %{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.* %ghost %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{name} %endif %changelog * Fri Dec 04 2020 Aleksei Bavshin - 0-0.4.20201204git19d44e8 - Allow access to hsphfpd to anyone, same as org.bluez Fedora policy - Reenable DBus activation - Add initial SELinux policy * Fri Dec 04 2020 Aleksei Bavshin - 0-0.3.20201204git19d44e8 - Update snapshot - Move optional scripts to /usr/share/hsphfpd * Wed Nov 25 2020 Aleksei Bavshin - 0-0.2.20201121git6341793 - Disable DBus activation * Tue Nov 24 2020 Aleksei Bavshin - 0-0.1.20201121git6341793 - Initial package