File apulse.spec of Package apulse

# spec file for package apulse
# Copyright (c) 2021 SUSE LLC
# 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

# integer of major pulse version
%define pulse_major %(sed -n '/^#define.*PA_MAJOR/{s/^.* //;p}' %{_includedir}/pulse/version.h)
%define __provides_exclude_from ^%{_libdir}/apulse/.*.so.*$
Name:           apulse
Version:        0.1.13
Release:        0
Summary:        PulseAudio emulation for ALSA
License:        MIT
Source1:        baselibs.conf
Source2:        %{name}.py
Source3:        %{name}.conf
%if %{pulse_major} > 12
# PATCH-FIX-OPENSUSE apulse-fix-pulse-13.patch -- Fix PulseAudio 13+ compatibility.
Patch0:         apulse-fix-pulse-13.patch
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(libpulse) >= 5.0

PulseAudio emulation intended to be used with Firefox and Skype.

%autosetup -p1

%cmake \
  -DAPULSEPATH=%{_libdir}/%{name}      \

rm %{buildroot}%{_libdir}/%{name}/libpulse*.so
install -Dpm 0755 %{SOURCE2} %{buildroot}%{_bindir}/%{name}
install -Dpm 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/%{name}.conf

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%license LICENSE.MIT
%config(noreplace) %{_sysconfdir}/%{name}.conf
%dir %{_libdir}/%{name}/

openSUSE Build Service is sponsored by