Modernize the spec file

- Use bconds for conditional build logic
- Use autosetup macro for unpacking + patch application
- Use standard macros for building and installing files
- Minor formatting fixups
- Stop installing license files as documentation
- Remove unnecessary scriptlets
This commit is contained in:
Neal Gompa 2021-05-10 06:27:10 +00:00 committed by Jaroslav Kysela
parent 874eabbcff
commit 8495dc43dd

View File

@ -1,7 +1,7 @@
%if 0%{?rhel}
%define with_jack 0
%bcond_with jack
%else
%define with_jack 1
%bcond_without jack
%endif
Name: alsa-plugins
@ -24,13 +24,14 @@ functionality to the Linux operating system.
This package includes plugins for ALSA.
%if 0%{?with_jack}
%if %{with jack}
%package jack
Requires: alsa-utils
Requires: jack-audio-connection-kit
BuildRequires: jack-audio-connection-kit-devel
Summary: Jack PCM output plugin for ALSA
License: LGPLv2+
%description jack
This plugin converts the ALSA API over JACK (Jack Audio Connection
Kit, http://jackit.sf.net) API. ALSA native applications can work
@ -43,6 +44,7 @@ Requires: alsa-utils
BuildRequires: alsa-lib-devel
Summary: Oss PCM output plugin for ALSA
License: LGPLv2+
%description oss
This plugin converts the ALSA API over OSS API. With this plugin,
ALSA native apps can run on OSS drivers.
@ -55,6 +57,7 @@ Requires: pulseaudio-daemon
BuildRequires: pulseaudio-libs-devel
Summary: Alsa to PulseAudio backend
License: LGPLv2+
%description pulseaudio
This plugin allows any program that uses the ALSA API to access a PulseAudio
sound daemon. In other words, native ALSA applications can play and record
@ -66,6 +69,7 @@ Requires: alsa-utils
BuildRequires: libsamplerate-devel
Summary: External rate converter plugin for ALSA
License: GPLv2+
%description samplerate
This plugin is an external rate converter using libsamplerate by Erik de
Castro Lopo.
@ -75,6 +79,7 @@ Requires: alsa-utils
BuildRequires: libsamplerate-devel
Summary: Upmixer channel expander plugin for ALSA
License: LGPLv2+
%description upmix
The upmix plugin is an easy-to-use plugin for upmixing to 4 or
6-channel stream. The number of channels to be expanded is determined
@ -85,6 +90,7 @@ Requires: alsa-utils
BuildRequires: libsamplerate-devel
Summary: Downmixer to stereo plugin for ALSA
License: LGPLv2+
%description vdownmix
The vdownmix plugin is a downmixer from 4-6 channels to 2-channel
stereo headphone output. This plugin processes the input signals with
@ -94,6 +100,7 @@ surround".
%package usbstream
Summary: USB stream plugin for ALSA
License: LGPLv2+
%description usbstream
The usbstream plugin is for snd-usb-us122l driver. It converts PCM
stream to USB specific stream.
@ -101,6 +108,7 @@ stream to USB specific stream.
%package arcamav
Summary: Arcam AV amplifier plugin for ALSA
License: LGPLv2+
%description arcamav
This plugin exposes the controls for an Arcam AV amplifier
(see: http://www.arcam.co.uk/) as an ALSA mixer device.
@ -110,6 +118,7 @@ Requires: speex speexdsp
BuildRequires: speex-devel speexdsp-devel
Summary: Rate Converter Plugin Using Speex Resampler
License: LGPLv2+
%description speex
The rate plugin is an external rate converter using the Speex resampler
(aka Public Parrot Hack) by Jean-Marc Valin. The pcm plugin provides
@ -120,13 +129,13 @@ BuildRequires: dbus-devel
BuildRequires: make
Summary: Maemo plugin for ALSA
License: LGPLv2+
%description maemo
This plugin converts the ALSA API over PCM task nodes protocol. In this way,
ALSA native applications can run over DSP Gateway and use DSP PCM task nodes.
%prep
%setup -q -n %{name}-%{version}%{?prever}
%patch0 -p1 -b .alsa-git
%autosetup -n %{name}-%{version}%{?prever} -p1
%build
autoreconf -vif
@ -134,10 +143,10 @@ autoreconf -vif
--with-speex=lib \
--enable-maemo-plugin \
--enable-maemo-resource-manager
make %{?_smp_mflags}
%make_build
%install
make install DESTDIR=%{buildroot}
%make_install
mv %{buildroot}%{_sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf.example \
%{buildroot}%{_sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf
@ -145,13 +154,10 @@ mv %{buildroot}%{_sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf.example \
find %{buildroot} -name "*.la" -exec rm {} \;
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%if 0%{?with_jack}
%if %{with jack}
%files jack
%doc COPYING COPYING.GPL doc/README-jack
%license COPYING COPYING.GPL
%doc doc/README-jack
%dir %{_sysconfdir}/alsa/conf.d
%config(noreplace) %{_sysconfdir}/alsa/conf.d/50-jack.conf
%dir %{_datadir}/alsa/alsa.conf.d
@ -161,7 +167,8 @@ find %{buildroot} -name "*.la" -exec rm {} \;
%endif
%files oss
%doc COPYING COPYING.GPL doc/README-pcm-oss
%license COPYING COPYING.GPL
%doc doc/README-pcm-oss
%dir %{_sysconfdir}/alsa/conf.d
%config(noreplace) %{_sysconfdir}/alsa/conf.d/50-oss.conf
%dir %{_datadir}/alsa/alsa.conf.d
@ -171,7 +178,8 @@ find %{buildroot} -name "*.la" -exec rm {} \;
%{_libdir}/alsa-lib/libasound_module_pcm_oss.so
%files pulseaudio
%doc COPYING COPYING.GPL doc/README-pulse
%license COPYING COPYING.GPL
%doc doc/README-pulse
%dir %{_libdir}/alsa-lib
%{_libdir}/alsa-lib/libasound_module_pcm_pulse.so
%{_libdir}/alsa-lib/libasound_module_ctl_pulse.so
@ -183,7 +191,8 @@ find %{buildroot} -name "*.la" -exec rm {} \;
%{_datadir}/alsa/alsa.conf.d/50-pulseaudio.conf
%files samplerate
%doc COPYING COPYING.GPL doc/samplerate.txt
%license COPYING COPYING.GPL
%doc doc/samplerate.txt
%dir %{_sysconfdir}/alsa/conf.d
%config(noreplace) %{_sysconfdir}/alsa/conf.d/10-samplerate.conf
%dir %{_datadir}/alsa/alsa.conf.d
@ -196,7 +205,8 @@ find %{buildroot} -name "*.la" -exec rm {} \;
%{_libdir}/alsa-lib/libasound_module_rate_samplerate_order.so
%files upmix
%doc COPYING COPYING.GPL doc/upmix.txt
%license COPYING COPYING.GPL
%doc doc/upmix.txt
%dir %{_sysconfdir}/alsa/conf.d
%config(noreplace) %{_sysconfdir}/alsa/conf.d/60-upmix.conf
%dir %{_datadir}/alsa/alsa.conf.d
@ -205,7 +215,8 @@ find %{buildroot} -name "*.la" -exec rm {} \;
%{_libdir}/alsa-lib/libasound_module_pcm_upmix.so
%files vdownmix
%doc COPYING COPYING.GPL doc/vdownmix.txt
%license COPYING COPYING.GPL
%doc doc/vdownmix.txt
%dir %{_sysconfdir}/alsa/conf.d
%config(noreplace) %{_sysconfdir}/alsa/conf.d/60-vdownmix.conf
%dir %{_datadir}/alsa/alsa.conf.d
@ -214,7 +225,7 @@ find %{buildroot} -name "*.la" -exec rm {} \;
%{_libdir}/alsa-lib/libasound_module_pcm_vdownmix.so
%files usbstream
%doc COPYING COPYING.GPL
%license COPYING COPYING.GPL
%dir %{_sysconfdir}/alsa/conf.d
%config(noreplace) %{_sysconfdir}/alsa/conf.d/98-usb-stream.conf
%dir %{_datadir}/alsa/alsa.conf.d
@ -223,7 +234,8 @@ find %{buildroot} -name "*.la" -exec rm {} \;
%{_libdir}/alsa-lib/libasound_module_pcm_usb_stream.so
%files arcamav
%doc COPYING COPYING.GPL doc/README-arcam-av
%license COPYING COPYING.GPL
%doc doc/README-arcam-av
%dir %{_sysconfdir}/alsa/conf.d
%config(noreplace) %{_sysconfdir}/alsa/conf.d/50-arcam-av-ctl.conf
%dir %{_datadir}/alsa/alsa.conf.d
@ -232,7 +244,8 @@ find %{buildroot} -name "*.la" -exec rm {} \;
%{_libdir}/alsa-lib/libasound_module_ctl_arcam_av.so
%files speex
%doc COPYING COPYING.GPL doc/speexdsp.txt doc/speexrate.txt
%license COPYING COPYING.GPL
%doc doc/speexdsp.txt doc/speexrate.txt
%dir %{_sysconfdir}/alsa/conf.d
%config(noreplace) %{_sysconfdir}/alsa/conf.d/10-speexrate.conf
%config(noreplace) %{_sysconfdir}/alsa/conf.d/60-speex.conf
@ -246,7 +259,8 @@ find %{buildroot} -name "*.la" -exec rm {} \;
%{_libdir}/alsa-lib/libasound_module_rate_speexrate_medium.so
%files maemo
%doc COPYING COPYING.GPL doc/README-maemo
%license COPYING COPYING.GPL
%doc doc/README-maemo
%dir %{_sysconfdir}/alsa/conf.d
%config(noreplace) %{_sysconfdir}/alsa/conf.d/98-maemo.conf
%dir %{_datadir}/alsa/alsa.conf.d