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