]> git.pld-linux.org Git - packages/alsa-lib.git/blobdiff - alsa-lib.spec
up to 1.2.11
[packages/alsa-lib.git] / alsa-lib.spec
index 15c8ad50965f2bf3821391693b4da9de1f58104d..0ed7514f1220eef6a33c5de21e3aecc14e59d354 100644 (file)
@@ -1,9 +1,11 @@
 #
 # Conditional build:
 %bcond_without static_libs     # don't build static library
+%bcond_without apidocs         # do not build and package API docs
 %bcond_without python          # smixer-python binding
+%bcond_with    python2         # python 2.x instead of python 3.x for smixer pymodules
 %bcond_with    resmgr          # Resource Manager support
-#
+
 Summary:       Advanced Linux Sound Architecture (ALSA) - Library
 Summary(es.UTF-8):     Advanced Linux Sound Architecture (ALSA) - Biblioteca
 Summary(pl.UTF-8):     Advanced Linux Sound Architecture (ALSA) - Biblioteka
@@ -11,24 +13,43 @@ Summary(pt_BR.UTF-8):       Biblioteca para o ALSA (Advanced Linux Sound Architecture)
 Summary(ru.UTF-8):     Библиотека API для работы с драйвером ALSA
 Summary(uk.UTF-8):     Бібліотека API для роботи з драйвером ALSA
 Name:          alsa-lib
-Version:       1.0.20
-Release:       2
+Version:       1.2.11
+# alsa-*-conf tarballs are not released for each patch version
+%define        topology_confver        1.2.5.1
+%define        ucm_confver             1.2.11
+Release:       1
 License:       LGPL v2.1+
 Group:         Libraries
 Source0:       ftp://ftp.alsa-project.org/pub/lib/%{name}-%{version}.tar.bz2
-# Source0-md5: 6e9080ba1faa5d3739d14dd76c62d8dc
+# Source0-md5: 1c5870770047b6a520d18a43f49e42ea
 Source1:       %{name}-modprobe.conf
 Source2:       %{name}-asound.conf
-URL:           http://www.alsa-project.org/
-BuildRequires: alsa-driver-devel
+Source3:       smixer.conf
+Source4:       ftp://ftp.alsa-project.org/pub/lib/alsa-topology-conf-%{topology_confver}.tar.bz2
+# Source4-md5: 066d6a980e09a2fa44b4cc1d06ecc0ea
+Source5:       ftp://ftp.alsa-project.org/pub/lib/alsa-ucm-conf-%{ucm_confver}.tar.bz2
+# Source5-md5: 125060f9693e27ed9a57e29a2e88c32f
+Patch0:                version-script-path.patch
+URL:           https://www.alsa-project.org/
 BuildRequires: autoconf >= 2.59
 BuildRequires: automake
 BuildRequires: doxygen
-BuildRequires: libtool
-%{?with_python:BuildRequires:  python-devel >= 1:2.4}
+BuildRequires: libtool >= 1.4
+%if %{with python}
+%if %{with python2}
+BuildRequires: python-devel >= 1:2.4
+BuildRequires: python-modules >= 1:2.4
+%else
+BuildRequires: python3-devel >= 1:3.2
+BuildRequires: python3-modules >= 1:3.2
+%endif
+%endif
 %{?with_resmgr:BuildRequires:  resmgr-devel}
+BuildRequires: rpm-build >= 4.6
+BuildRequires: tar >= 1:1.15
 BuildConflicts:        alsa-lib <= 0.4.0
-Obsoletes:     alsa-libs
+Obsoletes:     alsa-libs < 0.5.2
+Conflicts:     alsa-utils < 1.0.20-3
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -105,9 +126,8 @@ Summary(ru.UTF-8):  Библиотека API для работы с драйве
 Summary(uk.UTF-8):     Бібліотека API для роботи з драйвером ALSA - файли програміста
 Group:         Development/Libraries
 Requires:      %{name} = %{version}-%{release}
-Requires:      alsa-driver-devel
-Obsoletes:     alsa-devel
-Obsoletes:     alsa-lib-devel-doc
+Obsoletes:     alsa-devel < 0.9
+Obsoletes:     alsa-lib-devel-doc < 0.9
 
 %description devel
 Advanced Linux Sound Architecture (ALSA) - header files.
@@ -157,6 +177,18 @@ Bibliotecas estáticas para desenvolvimento com a alsa-lib
 %description static -l uk.UTF-8
 Статична бібліотека API для роботи з драйвером ALSA.
 
+%package apidocs
+Summary:       ALSA Library API documentation
+Summary(pl.UTF-8):     Dokumentacja API biblioteki ALSA
+Group:         Documentation
+BuildArch:     noarch
+
+%description apidocs
+API and internal documentation for ALSA Library.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API biblioteki ALSA.
+
 %package smixer-python
 Summary:       Python binding module for ALSA Mixer Interface
 Summary(pl.UTF-8):     Moduł wiązania Pythona dla interfejsu miksera architektury ALSA
@@ -171,35 +203,69 @@ Moduł wiązania Pythona dla interfejsu miksera architektury ALSA.
 
 %prep
 %setup -q
+cp -p %{SOURCE3} src/conf
+%patch0 -p1
 
 %build
 %{__libtoolize}
-%{__aclocal}
+%{__aclocal} -I m4
 %{__autoconf}
 %{__autoheader}
 %{__automake}
-%configure \
-       --enable-static \
+configure_opts="\
+       --disable-silent-rules \
        %{!?with_python:--disable-python} \
+       %{?with_python2:--enable-python2} \
        %{?with_resmgr:--enable-resmgr} \
-       %{!?with_static_libs:--disable-static}
+       --enable-mixer-modules \
+       --enable-mixer-pymods
+"
 
+%if %{with static_libs}
+install -d build-static
+cd build-static
+../%configure $configure_opts \
+       --disable-shared \
+       --enable-static
 %{__make}
-%{__make} doc
+cd ..
+%endif
+
+install -d build-shared
+cd build-shared
+../%configure $configure_opts \
+       --enable-shared \
+       --disable-static
+
+%{__make}
+%{?with_apidocs:%{__make} doc}
+cd ..
 
 %install
 rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/alsa/conf.d,%{_datadir}/alsa/alsa.conf.d,/etc/modprobe.d}
 
-install -d $RPM_BUILD_ROOT/etc/{alsa,modprobe.d}
+%if %{with static_libs}
+%{__make} -C build-static/src install-libLTLIBRARIES \
+       DESTDIR=$RPM_BUILD_ROOT
+%endif
 
-%{__make} install \
+%{__make} -C build-shared install \
        DESTDIR=$RPM_BUILD_ROOT
 
+%{__mv} $RPM_BUILD_ROOT%{_libdir}/libasound.so.* $RPM_BUILD_ROOT/%{_lib}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libasound.so
+ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo libasound.so.*.*) \
+       $RPM_BUILD_ROOT%{_libdir}/libasound.so
+
+tar xf %{SOURCE4} --strip-components=1 -C $RPM_BUILD_ROOT%{_datadir}/alsa alsa-topology-conf-%{topology_confver}/topology
+tar xf %{SOURCE5} --strip-components=1 -C $RPM_BUILD_ROOT%{_datadir}/alsa alsa-ucm-conf-%{ucm_confver}/ucm alsa-ucm-conf-%{ucm_confver}/ucm2
+
 install -D utils/alsa.m4 $RPM_BUILD_ROOT%{_aclocaldir}/alsa.m4
 install %{SOURCE1} $RPM_BUILD_ROOT/etc/modprobe.d/alsa-base.conf
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/asound.conf
+install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/asound.conf
 
-rm -f $RPM_BUILD_ROOT%{_libdir}/alsa-lib/smixer/*.{a,la}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/alsa-lib/smixer/*.la
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -211,27 +277,44 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %doc doc/asoundrc.txt
 %attr(755,root,root) %{_bindir}/aserver
-%attr(755,root,root) %{_libdir}/libasound.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libasound.so.2
+%attr(755,root,root) /%{_lib}/libasound.so.*.*.*
+%attr(755,root,root) %ghost /%{_lib}/libasound.so.2
+%attr(755,root,root) /%{_libdir}/libatopology.so.*.*.*
+%attr(755,root,root) %ghost /%{_libdir}/libatopology.so.2
 %dir %{_libdir}/alsa-lib
 %dir %{_libdir}/alsa-lib/smixer
 %attr(755,root,root) %{_libdir}/alsa-lib/smixer/smixer-ac97.so
 %attr(755,root,root) %{_libdir}/alsa-lib/smixer/smixer-hda.so
 %attr(755,root,root) %{_libdir}/alsa-lib/smixer/smixer-sbase.so
-%{_datadir}/alsa
-%{_sysconfdir}/alsa
+%dir %{_datadir}/alsa
+%{_datadir}/alsa/cards
+%{_datadir}/alsa/ctl
+%{_datadir}/alsa/pcm
+%{_datadir}/alsa/topology
+%{_datadir}/alsa/ucm
+%{_datadir}/alsa/ucm2
+%{_datadir}/alsa/alsa.conf
+# directory for "global" config files (not accessed directly, but through symlinks in %{_sysconfdir}/alsa/conf.d)
+%dir %{_datadir}/alsa/alsa.conf.d
+%{_datadir}/alsa/smixer.conf
+%dir %{_sysconfdir}/alsa
+# directory for "local" config files (loaded from %{_datadir}/alsa/alsa.conf)
+%dir %{_sysconfdir}/alsa/conf.d
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asound.conf
-%attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/alsa-base.conf
+%config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/alsa-base.conf
 
 %files devel
 %defattr(644,root,root,755)
-%doc doc/doxygen/html/*
 %attr(755,root,root) %{_libdir}/libasound.so
+%attr(755,root,root) %{_libdir}/libatopology.so
 %{_libdir}/libasound.la
+%{_libdir}/libatopology.la
 %{_includedir}/sys/asoundlib.h
 %{_includedir}/alsa
+%{_includedir}/asoundlib.h
 %{_aclocaldir}/alsa.m4
 %{_pkgconfigdir}/alsa.pc
+%{_pkgconfigdir}/alsa-topology.pc
 
 %if %{with static_libs}
 %files static
@@ -239,6 +322,12 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/libasound.a
 %endif
 
+%if %{with apidocs}
+%files apidocs
+%defattr(644,root,root,755)
+%doc build-shared/doc/doxygen/html/*
+%endif
+
 %if %{with python}
 %files smixer-python
 %defattr(644,root,root,755)
This page took 0.092778 seconds and 4 git commands to generate.