# Original SPEC file taken from https://copr.fedorainfracloud.org/coprs/lucamagrone/pi4/package/bluez-alsa/. %if 0%{!?mkrel:1} %define mkrel(c) %{1}%{?dist} %endif %if "%{_vendor}" != "openEuler" %bcond_without aac %else %bcond_with aac %endif # Luca built libfreeaptx for his repo (he built for Fedora 36, CentOS 9, and # EPEL 9, all of which lack it). It seems to be available only for Mageia 10+, # OpenMandriva 6+, and Fedora RPM Fusion. libopenaptx is available # for OpenMandriva 6+. %if 0%{?mageia} >= 10 || "%{_vendor}" == "openmandriva" %bcond_without aptx # Use --with libopenaptx to build with libopenaptx instead of libfreeaptx. %bcond_with libopenaptx %else %bcond_with aptx %endif %if 0%{?centos} %bcond_with hcitop %else %bcond_without hcitop %endif %if "%{_vendor}" == "openEuler" %bcond_with lc3 %bcond_with spandsp %else %bcond_without lc3 %bcond_without spandsp %endif # ldacBT requires a little-endian CPU to build %ifarch %ix86 x86_64 %arm32 %arm64 %if 0%{?centos} || 0%{?epel} %bcond_with ldac %else %bcond_without ldac %endif %else %bcond_with ldac %endif Name: bluez-alsa Version: 4.3.1 Release: %mkrel 1.1 Summary: Bluetooth Audio ALSA Backend License: MIT URL: https://github.com/Arkq/bluez-alsa Source: https://github.com/Arkq/bluez-alsa/archive/v%{version}/bluez-alsa-v%{version}.tar.gz#/%{name}-%{version}.tar.gz # Absolute minimum requirements BuildRequires: automake BuildRequires: autoconf >= 2.62 BuildRequires: make BuildRequires: libtool BuildRequires: gcc BuildRequires: glibc-devel BuildRequires: pkgconfig(alsa) >= 1.0.27 BuildRequires: pkgconfig(bluez) >= 5.51 BuildRequires: pkgconfig(glib-2.0) >= 2.58.2, pkgconfig(gio-unix-2.0) BuildRequires: pkgconfig(sbc) >= 1.5 BuildRequires: python3dist(docutils) # Optional features %if %{with aac} BuildRequires: pkgconfig(fdk-aac) >= 0.1.1 %endif %if %{with lc3} BuildRequires: pkgconfig(lc3) >= 1.0.0 %endif %if %{with ldac} BuildRequires: pkgconfig(ldacBT-abr) >= 1.0.0, pkgconfig(ldacBT-enc) >= 2.0.0 %endif # Mageia 9 doesn't have a recent enough version for pkgconfig(lame) BuildRequires: (pkgconfig(lame) >= 3.100 or lame-devel) BuildRequires: pkgconfig(libmpg123) >= 1.0.0 %if %{with aptx} BuildRequires: (pkgconfig(libfreeaptx) >= 0.1.1 or pkgconfig(libopenaptx) >= 0.2.0) %endif BuildRequires: pkgconfig(opus) >= 1.0.0 %if %{with spandsp} BuildRequires: pkgconfig(spandsp) >= 0.0.6 %endif BuildRequires: pkgconfig(check) >= 0.11.0, pkgconfig(sndfile) >= 1.0 # For utils BuildRequires: pkgconfig(dbus-1) >= 1.6 BuildRequires: pkgconfig(readline) %if %{with hcitop} BuildRequires: pkgconfig(libbsd) >= 0.8 BuildRequires: pkgconfig(ncurses) %endif BuildRequires: pkgconfig(systemd) >= 200 %description BlueALSA can achieve the same Bluetooth audio profile support as with PulseAudio, but with fewer dependencies and at a lower level in the software stack. BlueALSA registers all the classic Bluetooth audio profiles in BlueZ, and also the BLE-MIDI profile, but the other BLE audio profiles are not (yet) supported. So in theory every Bluetooth device (with classic audio capabilities) can be connected. BlueALSA is designed specifically for use on small, low-powered, dedicated audio or audio/visual systems where the high-level audio management features of PulseAudio or PipeWire are not required. The target system must be able to function correctly with all its audio applications interfacing directly with ALSA. In such systems BlueALSA adds Bluetooth audio support to the existing ALSA sound card support. %prep %autosetup -p1 %build autoreconf --install %configure \ --enable-manpages \ %if %{with aac} --enable-aac \ %endif --enable-faststream \ %if %{with lc3} --enable-lc3-swb \ %endif %if %{with ldac} --enable-ldac \ %endif %if %{with aptx} --enable-aptx \ --enable-aptx-hd \ %dnl bluez-asla uses the commercial openaptx by default, so you have to use %dnl --with-libfreeaptx or --with-libopenaptx to build with a free library. %if %{with libopenaptx} --with-libopenaptx \ %else --with-libfreeaptx \ %endif %endif --enable-mp3lame \ --enable-mpg123 \ %if %{with spandsp} --enable-msbc --enable-asha \ %endif --enable-opus \ --enable-rfcomm \ %if %{with hcitop} --enable-hcitop \ %endif --enable-midi \ %if "%{version}" <= "4.3.1" %dnl --enable-cli is removed after 4.3.1, in which you have to use %dnl --disable-ctl to disable the command-line tool. --enable-cli \ %endif --enable-systemd \ %if "%{version}" > "4.3.1" %dnl --all-codecs was added after bluez-alsa 4.3.1; it causes the daemon in %dnl older versions not to start. --with-systemdbluealsadargs=" -S -p a2dp-source -p hfp-ag -p hsp-ag -p a2dp-sink -p hsp-hs -p hfp-hf --all-codecs" \ %else --with-systemdbluealsaargs=" -S -p a2dp-source -p hfp-ag -p a2dp-sink" \ %endif --with-bluealsaduser=${LOGNAME-root} \ --enable-a2dpconf \ --enable-upower \ --enable-test \ --disable-static \ --with-bash-completion %make_build %install %make_install %post libtool --finish %{_libdir}/alsa-lib/ systemctl daemon-reload systemctl enable bluealsa systemctl start bluealsa %postun libtool --finish %{_libdir}/alsa-lib/ if [ "$1" -eq 0 ]; then systemctl stop bluealsa systemctl disable bluealsa systemctl daemon-reload fi %files %license LICENSE %doc AUTHORS NEWS README.md %{_bindir}/a2dpconf %{_bindir}/bluealsa %{_bindir}/bluealsa-aplay %{_bindir}/bluealsa-cli %{_bindir}/bluealsa-rfcomm %if %{with hcitop} %{_bindir}/hcitop %endif %{_unitdir}/bluealsa.service %{_unitdir}/bluealsa-aplay.service %{_sysconfdir}/alsa/conf.d/20-bluealsa.conf %{_datadir}/dbus-1/system.d/bluealsa.conf %{_mandir}/man1/* %{_mandir}/man7/* %{_mandir}/man8/* %{_libdir}/alsa-lib/*.so %ghost %{_libdir}/alsa-lib/*.la %{_datadir}/bash-completion/completions/a2dpconf %{_datadir}/bash-completion/completions/bluealsa %{_datadir}/bash-completion/completions/bluealsa-aplay %{_datadir}/bash-completion/completions/bluealsa-cli %{_datadir}/bash-completion/completions/bluealsa-rfcomm %{_datadir}/bash-completion/completions/hcitop %changelog * Tue Nov 08 2022 Luca Magrone - 4.0.0-1 - Initial package release