%define lib_name_orig libalsa # The naming scheme in non-Mandriva-based distros %if 0%{!?mklibname:1} %define mklibname(ds) lib%{1}%{?2:%{2}}%{-s:-static}%{-d:-devel} %endif %if 0%{!?mkrel:1} %define mkrel(c) %{1}%{?dist} %endif %define major 2 %define lib_name %mklibname alsa %{major} %define dev_name %mklibname alsa2 -d %define libvers 1.2.13 %define ucmvers 1.2.13 %define tplvers 1.2.5.1 %define beta 0 %if %{beta} %define fname alsa-lib-%{libvers}%{beta} %else %define fname alsa-lib-%{libvers} %endif Summary: Advanced Linux Sound Architecture (ALSA) library Name: libalsa2 Epoch: 2 Version: %{libvers} %if %{beta} Release: %mkrel 0.%{beta}.1 %else Release: %mkrel 1 %endif License: LGPLv2+ Group: Sound/Utilities Url: https://www.alsa-project.org/ Source0: https://www.alsa-project.org/files/pub/lib/%{fname}.tar.bz2 Source1: https://www.alsa-project.org/files/pub/lib/alsa-ucm-conf-%{ucmvers}.tar.bz2 Source2: https://www.alsa-project.org/files/pub/lib/alsa-topology-conf-%{tplvers}.tar.bz2 Source3: README.soundprofiles # patches from openmandriva # (Fix HDMI audio output if EDID information is incorrect) Patch0400: alsa-lib-1.2.7-hdmi-audio.patch BuildRequires: doxygen BuildRequires: pkgconfig(python3) # keep the list below in sync with the lib_name package Provides: alsa-lib = %{epoch}:%{version}-%{release} Provides: %{lib_name_orig} = %{epoch}:%{version}-%{release} Requires: %{lib_name_orig}-data %description Advanced Linux Sound Architecture (ALSA) is a modularized architecture which supports quite a large range of ISA and PCI cards. It's fully compatible with old OSS drivers (either OSS/Lite, OSS/commercial). To use the features of alsa, one can either use: - the old OSS api - the new ALSA api that provides many enhanced features. Using the ALSA api requires to use the ALSA library. %if "%{_lib}" != "lib" %package -n %{lib_name} Summary: Advanced Linux Sound Architecture (ALSA) library Group: Sound/Utilities Provides: alsa-lib = %{epoch}:%{version}-%{release} Provides: %{lib_name_orig} = %{epoch}:%{version}-%{release} Requires: %{lib_name_orig}-data Recommends: %{_lib}alsa-plugins %description -n %{lib_name} Advanced Linux Sound Architecture (ALSA) is a modularized architecture which supports quite a large range of ISA and PCI cards. It's fully compatible with old OSS drivers (either OSS/Lite, OSS/commercial). To use the features of alsa, one can either use: - the old OSS api - the new ALSA api that provides many enhanced features. Using the ALSA api requires to use the ALSA library. %endif %define alt_name soundprofile %define alt_priority 10 %package -n %{lib_name_orig}-data Summary: Config files for Advanced Linux Sound Architecture (ALSA) Group: Sound/Utilities License: BSD BuildArch: noarch Requires(post): update-alternatives Requires(postun): update-alternatives Provides: alsa-ucm = %{epoch}:%{version}-%{release} Provides: alsa-topology = %{epoch}:%{version}-%{release} %description -n %{lib_name_orig}-data Advanced Linux Sound Architecture (ALSA) is a modularized architecture which supports quite a large range of ISA and PCI cards. It's fully compatible with old OSS drivers (either OSS/Lite, OSS/commercial). To use the features of alsa, one can either use: - the old OSS api - the new ALSA api that provides many enhanced features. This package contains config files by ALSA applications. %post -n %{lib_name_orig}-data %{_sbindir}/update-alternatives \ --install %{_sysconfdir}/sound/profiles/current %{alt_name} %{_sysconfdir}/sound/profiles/alsa %{alt_priority} %postun -n %{lib_name_orig}-data if [ ! -f %{_sysconfdir}/sound/profiles/alsa/profile.conf ]; then /usr/sbin/update-alternatives --remove %{alt_name} %{_sysconfdir}/sound/profiles/alsa fi %package -n %{dev_name} Summary: Development files for Advanced Linux Sound Architecture (ALSA) Group: Development/C Requires: %{lib_name} = %{epoch}:%{version} Provides: libalsa1-devel = %{epoch}:%{version}-%{release} Provides: alsa-lib-devel = %{epoch}:%{version}-%{release} Provides: %{lib_name_orig}-devel = %{epoch}:%{version}-%{release} %description -n %{dev_name} Advanced Linux Sound Architecture (ALSA) is a modularized architecture which supports quite a large range of ISA and PCI cards. It's fully compatible with old OSS drivers (either OSS/Lite, OSS/commercial). To use the features of alsa, one can either use: - the old OSS api - the new ALSA api that provides many enhanced features. This package contains files needed in order to develop an application that made use of ALSA. %package docs Summary: Documentation for Advanced Linux Sound Architecture (ALSA) Group: Documentation Requires: alsa-lib = %{epoch}:%{version} BuildArch: noarch %description docs Advanced Linux Sound Architecture (ALSA) is a modularized architecture which supports quite a large range of ISA and PCI cards. It's fully compatible with old OSS drivers (either OSS/Lite, OSS/commercial). To use the features of alsa, one can either use: - the old OSS api - the new ALSA api that provides many enhanced features. The Advanced Linux Sound Architecture comes with a kernel API and library API. This document describes the library API and how it interfaces with the kernel API. Application programmers should use the library API rather than kernel API. The Library offers 100% of the functionally of the kernel API, but add next major improvements in usability, making the application code simpler and better looking. This package contains the documentation that describe tha ALSA lib API. %prep %autosetup -p1 -n %{fname} %build %define _lto_cflags %{nil} autoreconf -if %configure --enable-shared --enable-python # Force definition of -DPIC so that VERSIONED_SYMBOLS are used # FIXME: alsa people should not depend on PIC to determine a DSO build... perl -pi -e 's,(^pic_flag=.+)(-fPIC),\1-DPIC \2,' libtool %make_build %make_build -C doc doc %install %make_install # (cg) For sound profile support mkdir -p %{buildroot}%{_sysconfdir}/sound/profiles/alsa echo "SOUNDPROFILE=alsa" >%{buildroot}%{_sysconfdir}/sound/profiles/alsa/profile.conf echo "# This file is left blank to allow alsa to default to dmix" >%{buildroot}%{_sysconfdir}/sound/profiles/alsa/alsa-default.conf install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sound/profiles/README mkdir -p %{buildroot}%{_sysconfdir}/alsa/conf.d ln -s %{_sysconfdir}/sound/profiles/current/alsa-default.conf %{buildroot}%{_sysconfdir}/alsa/conf.d/99-default.conf tar -xjvf %{SOURCE1} -C %{buildroot}%{_datadir}/alsa --strip-components=1 --wildcards "*/ucm" "*/ucm2" tar -xjvf %{SOURCE2} -C %{buildroot}%{_datadir}/alsa --strip-components=1 --wildcards "*/topology" # (blino) not very useful, Debian also dropped it (Debian bugs #290735, #285320) rm -f %{buildroot}%{_bindir}/aserver rm -f %{buildroot}%{_libdir}/alsa-lib/smixer/*.la rm -f %{buildroot}%{_libdir}/*.la %files -n %{lib_name_orig}-data %doc COPYING %dir %{_sysconfdir}/sound/profiles %dir %{_sysconfdir}/sound/profiles/alsa %{_sysconfdir}/sound/profiles/README %{_sysconfdir}/sound/profiles/alsa/profile.conf %{_sysconfdir}/sound/profiles/alsa/alsa-default.conf %dir %{_sysconfdir}/alsa/ %dir %{_sysconfdir}/alsa/conf.d/ %{_sysconfdir}/alsa/conf.d/* %dir %{_datadir}/alsa/ %dir %{_datadir}/alsa/cards/ %dir %{_datadir}/alsa/pcm/ %{_datadir}/alsa/cards/* %{_datadir}/alsa/ctl/default.conf %{_datadir}/alsa/pcm/* %{_datadir}/alsa/alsa.conf %{_datadir}/alsa/topology %{_datadir}/alsa/ucm %{_datadir}/alsa/ucm2 %files -n %{lib_name} %doc COPYING %{_libdir}/*.so.%{major}{,.*} %files docs %doc COPYING doc/doxygen/html/* doc/asoundrc.txt %files -n %{dev_name} %doc COPYING %dir %{_includedir}/alsa/ %{_includedir}/alsa/* %{_includedir}/sys/asoundlib.h %{_includedir}/asoundlib.h %{_datadir}/aclocal/alsa.m4 %{_libdir}/*.so %{_libdir}/pkgconfig/*.pc