File pulseaudio-modules-bt.spec of Package pulseaudio-modules-bt

#
# spec file for package pulseaudio-modules-bt
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2020 Tejas Guruswamy <tejas.guruswamy@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define pulseversion 14.2
Name:           pulseaudio-modules-bt
Version:        1.4
Release:        0
Summary:        Bluetooth support for the PulseAudio with LDAC, APTX, APTX-HD support
License:        GPL-3.0-only
Group:          System/Sound Daemons
URL:            https://github.com/EHfive/pulseaudio-modules-bt
Source:         %{name}-%{version}.tar.gz
Source1:        pulseaudio-%{pulseversion}.tar.gz
Patch1:         0001-bluetooth-use-consistent-profile-names.patch
Patch2:         0002-bluetooth-separate-HSP-and-HFP.patch
Patch3:         0003-bluetooth-add-a-new-PA_BLUETOOTH_PROFILE_HFP_AG.patch
Patch4:         0004-bluetooth-use-HFP-profiles-in-ofono-not-HSP.patch
Patch5:         0005-bluetooth-add-correct-HFP-rfcomm-negotiation.patch
Patch6:         0006-bluetooth-make-native-the-default-backend.patch
Patch7:         0007-bluetooth-support-soft-volume-control-for-HFP.patch
Patch8:         0008-bluetooth-reshuffle-profile-priorities.patch
Patch9:         0009-Add-dlopen-ed-fdk-aac-library-loading-hack.patch
Patch101:       0101-bluetooth-ffmpeg-lib-name.patch
BuildRequires:  cmake
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  pulseaudio = %{pulseversion}
BuildRequires:  pkgconfig(bluez) >= 5.0
BuildRequires:  pkgconfig(dbus-1)
# LDAC support
BuildRequires:  pkgconfig(ldacBT-abr)
BuildRequires:  pkgconfig(ldacBT-enc)
# APTX, APTX-HD support
BuildRequires:  pkgconfig(libavcodec) >= 58
BuildRequires:  pkgconfig(libavutil) >= 56
BuildRequires:  pkgconfig(libpulse)
# BuildRequires:  pkgconfig(fdk-aac)
BuildRequires:  pkgconfig(sbc)
Requires:       bluez
Requires:       dbus-1
Requires:       pulseaudio = %{pulseversion}
Requires:       sbc
Recommends:     libldac2
# Recommends:   libfdk-aac2
Conflicts:      pulseaudio-module-bluetooth
%if 0%{?suse_version} > 1500
Recommends:     libavcodec58_91
Recommends:     libavutil56_51
%else
Recommends:     libavcodec58
Recommends:     libavutil56
%endif

%description
A fork of the PulseAudio Bluetooth modules which adds support for the Sony LDAC,
APTX and APTX-HD codecs to PulseAudio on Linux.

%prep
%setup -q
%setup -qD -a 1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch101
mv -T pulseaudio-%{pulseversion} pa

%build
%cmake -DCMAKE_SKIP_RPATH:BOOL=FALSE
%cmake_build

%install
%cmake_install

%post
# notify restart pulseaudio
mkdir -p %{_localstatedir}/adm/update-messages
cat > %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}-something << EOF
INFO: You may need to restart your pulseaudio manually:
INFO:   pulseaudio -k && pulseaudio --start
EOF

%files
%license LICENSE
%doc README.md
%dir %{_libdir}/pulse-%{pulseversion}
%dir %{_libdir}/pulse-%{pulseversion}/modules
%{_libdir}/pulse-%{pulseversion}/modules/module-bluetooth-policy.so
%{_libdir}/pulse-%{pulseversion}/modules/module-bluetooth-discover.so
%{_libdir}/pulse-%{pulseversion}/modules/libbluez5-util.so
%{_libdir}/pulse-%{pulseversion}/modules/module-bluez5-device.so
%{_libdir}/pulse-%{pulseversion}/modules/module-bluez5-discover.so

%changelog
openSUSE Build Service is sponsored by