alsa/alsa.spec
Takashi Iwai 1e1ad9f5ff Accepting request 158622 from home:tiwai:branches:multimedia:libs
- More backports of fix patches from upstream:
  0051-Add-sys-types.h-to-include-list.patch
  0052-control-Simplify-using-snd_config_get_bool.patch
  0053-Add-workaround-for-conflicting-IEC958-controls-for-H.patch
  0054-snd_mixer_poll_descriptors_revents-should-loop-over-.patch

OBS-URL: https://build.opensuse.org/request/show/158622
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=125
2013-03-12 07:14:20 +00:00

362 lines
12 KiB
RPMSpec

#
# spec file for package alsa
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
Name: alsa
BuildRequires: doxygen
BuildRequires: libtool
BuildRequires: pkg-config
%define package_version 1.0.26
Requires: alsa-utils
Recommends: alsa-plugins alsa-oss
PreReq: %insserv_prereq %fillup_prereq
# bug437293
%ifarch ppc64
Obsoletes: alsa-64bit
%endif
#
Summary: Advanced Linux Sound Architecture
License: LGPL-2.1+
Group: System/Libraries
Version: 1.0.26
Release: 0
Source: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-%{package_version}.tar.bz2
Source2: baselibs.conf
Source8: 40-alsa.rules
Source11: alsasound
Source12: sysconfig.sound
Source13: joystick
Source14: sysconfig.joystick
Source16: set_default_volume
Source17: test.wav
Source20: README.SuSE
Source21: README.testwav
Source30: all_notes_off
Source31: all_notes_off.bin
Source32: all_notes_off.mid
Source33: alsa-info.sh
Source34: alsa-init.sh
Source40: 50-alsa.conf
Source41: install-snd-module
# Patch: alsa-lib-git-fixes.diff
Patch1: 0001-Implement-the-channel-mapping-API.patch
Patch2: 0002-Implement-get_chmap-set_chmap-for-PCM-plug-route-and.patch
Patch3: 0003-Implement-get_chmap-set_chmap-for-PCM-extplug-ioplug.patch
Patch4: 0004-Add-test-chmap-program.patch
Patch5: 0005-Cache-the-chmap-operation-errors.patch
Patch6: 0006-Define-channel-map-position-enum-in-pcm.h.patch
Patch7: 0007-Follow-channel-position-definitions-to-mixer-channel.patch
Patch8: 0008-Add-SND_CHMAP_NA-and-bit-flag-definitions.patch
Patch9: 0009-PCM-Introduce-snd_pcm_chmap_t-and-snd_pcm_chmap_quer.patch
Patch10: 0010-PCM-Implement-snd_pcm_query_chmaps_from_hw.patch
Patch11: 0011-Fix-duplicated-channel-entry-in-test-chmap.c.patch
Patch12: 0012-PCM-Fix-prefix-for-snd_pcm_chmap_type-enum-members.patch
Patch13: 0013-PCM-Add-string-conversion-helper-functions-for-chmap.patch
Patch14: 0014-PCM-Add-SND_CHMAP_API_VERSION-definition.patch
Patch15: 0015-PCM-Add-snd_pcm_chmap_long_name.patch
Patch16: 0016-PCM-Add-query_chmaps-support-to-multi-plugin.patch
Patch17: 0017-PCM-Add-chmap-options-to-hw-and-null-plugins.patch
Patch18: 0018-PCM-Add-the-missing-query_chmaps-for-route-plugin.patch
Patch19: 0019-Add-chmap-override-definitions-for-Emu10k1-Audigy-an.patch
Patch20: 0020-PCM-Use-compounds-for-overriding-enhancing-chmaps.patch
Patch21: 0021-conf-Add-chmap-definitions-to-TRIDENT-and-SI7018-con.patch
Patch22: 0022-test-chmap-Fix-wrong-malloc-size.patch
Patch23: 0023-PCM-Define-MONO-and-other-channel-map-positions.patch
Patch24: 0024-PCM-Fix-the-conversion-from-string-to-chmap-position.patch
Patch25: 0025-PCM-A-few-doxygen-fixes-for-chmap-stuff.patch
Patch26: 0026-PCM-Fill-SND_CHMAP_NA-to-silent-channels-in-route-pl.patch
Patch27: 0027-PCM-Fix-infinite-loop-in-htimestamp-of-dmix-dsnoop-a.patch
Patch28: 0028-test-add-audio_time.patch
Patch30: 0030-PCM-Fix-the-invalid-snd_pcm_close-calls-in-rate-plug.patch
Patch31: 0031-pcm-support-for-audio-timestamps.patch
Patch32: 0032-pcm-fix-64-bit-SNDRV_PCM_IOCTL_STATUS-ABI-breakage.patch
Patch33: 0033-PCM-Fix-memory-leak-for-pcm-empty-and-asym-plugins.patch
Patch34: 0034-Reduce-compilation-warnings.patch
Patch35: 0035-PCM-Avoid-busy-loop-in-snd_pcm_write_areas-with-rate.patch
Patch36: 0036-Merge-kernel-uapi-sound-asound.h-and-asequencer.h.patch
Patch37: 0037-PCM-Add-more-chmap-definitions-for-UAC2.patch
Patch38: 0038-PCM-shut-up-a-compile-unused-parameter-compile-warni.patch
Patch39: 0039-Add-workaround-for-conflicting-snd_seq_event_t-defin.patch
Patch40: 0040-PCM-Fix-conflict-of-_snd_pcm_hw_params-definitions.patch
Patch41: 0041-configure-Quite-AM_CONDITIONAL-arguments.patch
Patch42: 0042-mixer-Don-t-build-simple_abst-when-no-libdl-is-avail.patch
Patch43: 0043-Fix-endian-check-in-local.h.patch
Patch44: 0044-configure-do-not-detect-incorrect-cross-compiler.patch
Patch45: 0045-ucm-Set-uc_mgr-ctl-to-NULL-after-closing-it.patch
Patch46: 0046-snd_pcm_direct_parse_open_conf-use-thread-safe-getgr.patch
Patch47: 0047-Add-snd_lib_error_set_local-to-install-a-thread-loca.patch
Patch48: 0048-snd_device_name_hint-do-not-change-the-global-error-.patch
Patch49: 0049-snd_device_name_hint-do-not-use-global-snd_config.patch
Patch50: 0050-conf-Fix-a-memory-access-violation-resulting-from-im.patch
Patch51: 0051-Add-sys-types.h-to-include-list.patch
Patch52: 0052-control-Simplify-using-snd_config_get_bool.patch
Patch53: 0053-Add-workaround-for-conflicting-IEC958-controls-for-H.patch
Patch54: 0054-snd_mixer_poll_descriptors_revents-should-loop-over-.patch
#
Patch99: alsa-lib-doxygen-avoid-crash-for-11.3.diff
Url: http://www.alsa-project.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
ALSA stands for Advanced Linux Sound Architecture. It supports many
PCI, ISA PnP and USB sound cards.
This package contains the ALSA init scripts to start the sound system
on your Linux box. To set it up, run yast2 or alsaconf.
%package devel
Summary: Include Files and Libraries mandatory for Development
License: LGPL-2.1+
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libasound2 = %{version}
Obsoletes: alsadev
Provides: alsa-lib-devel
Provides: alsadev
%description devel
This package contains all necessary include files and libraries needed
to develop applications that require these.
%package docs
Summary: Additional Package Documentation
License: GPL-2.0+
Group: Documentation/Other
%if %suse_version > 1110
BuildArch: noarch
%endif
%description docs
This package contains optional documentation provided in addition to
this package's base documentation.
%package -n libasound2
Summary: Advanced Linux Sound Architecture Library
License: LGPL-2.1+
Group: System/Libraries
Provides: alsa-lib
%description -n libasound2
This package contains the library for ALSA, Advanced Linux Sound
Architecture.
%prep
%setup -q -n alsa-lib-%{package_version}
# %patch -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
%patch43 -p1
%patch44 -p1
%patch45 -p1
%patch46 -p1
%patch47 -p1
%patch48 -p1
%patch49 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1
%patch53 -p1
%patch54 -p1
%if %suse_version == 1130
%patch99 -p1
%endif
# hack to fix build on older distros
%if %suse_version < 1100
%ifarch %ix86
test -f $RPM_SOURCE_DIR/baselibs.conf && \
sed -i -e'/recommends.*alsa-oss/d' $RPM_SOURCE_DIR/baselibs.conf
%endif
%endif
%build
export AUTOMAKE_JOBS="%{?_smp_mflags}"
# build alsa-lib
autoreconf -fi
%configure \
--disable-static \
--enable-symbolic-functions \
--disable-aload \
--disable-alisp \
--disable-python
make V=1 %{?_smp_mflags}
# run doxygen
make -C doc doc
%install
# install shared library
%makeinstall
# clean up unneeded files
rm -f $RPM_BUILD_ROOT%{_libdir}/*.*a
rm -f $RPM_BUILD_ROOT%{_libdir}/alsa-lib/smixer/*.*a
rm -f $RPM_BUILD_ROOT%{_bindir}/aserver
#
# install helper scripts
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
install -c -m 0755 %{SOURCE16} $RPM_BUILD_ROOT%{_bindir}
install -c -m 0755 %{SOURCE34} $RPM_BUILD_ROOT%{_sbindir}/alsa-init
%if %suse_version < 1140
sed -i -e 's@/var/lib/alsa/asound.state@/etc/asound.state@g' $RPM_BUILD_ROOT%{_bindir}/set_default_volume
sed -i -e 's@/var/lib/alsa/asound.state@/etc/asound.state@g' $RPM_BUILD_ROOT%{_sbindir}/alsa-init
%endif
# install test wave file
mkdir -p $RPM_BUILD_ROOT%{_datadir}/sounds/alsa
install -c -m 0644 %{SOURCE17} $RPM_BUILD_ROOT%{_datadir}/sounds/alsa/test.wav
# install all_notes_off stuff
install -c -m 0755 %{SOURCE30} $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT/usr/lib
install -c -m 0644 %{SOURCE31} $RPM_BUILD_ROOT/usr/lib
install -c -m 0644 %{SOURCE32} $RPM_BUILD_ROOT/usr/lib
#
# install init scripts
#
mkdir -p $RPM_BUILD_ROOT/etc/init.d
install -c -m 0755 %{SOURCE11} $RPM_BUILD_ROOT/etc/init.d
install -c -m 0755 %{SOURCE13} $RPM_BUILD_ROOT/etc/init.d
%if %suse_version < 1140
sed -i -e 's@/var/lib/alsa/asound.state@/etc/asound.state@g' $RPM_BUILD_ROOT/etc/init.d/alsasound
%endif
rm -f $RPM_BUILD_ROOT%{_sbindir}/rcalsasound
ln -s ../../etc/init.d/alsasound $RPM_BUILD_ROOT%{_sbindir}/rcalsasound
rm -f $RPM_BUILD_ROOT%{_sbindir}/rcjoystick
ln -s ../../etc/init.d/joystick $RPM_BUILD_ROOT%{_sbindir}/rcjoystick
#
# udev rules (only for non-systemd)
#
%if %suse_version < 1140
mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d
install -c -m 0644 %{SOURCE8} $RPM_BUILD_ROOT/etc/udev/rules.d
%endif
#
# modprobe config and the module install script for loading OSS-emulation
# and sequencer modules automatically
mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d
install -c -m 0644 %{S:40} $RPM_BUILD_ROOT/etc/modprobe.d
mkdir -p $RPM_BUILD_ROOT/sbin
install -c -m 0755 %{S:41} $RPM_BUILD_ROOT/sbin
#
# install template to update rc.config and sysconfig files:
# (updating the actual files is done in the %post-script)
#
mkdir -p -m 755 $RPM_BUILD_ROOT/var/adm/fillup-templates
mkdir -p -m 755 $RPM_BUILD_ROOT/etc/sysconfig
for i in sound joystick; do
install -m 644 $RPM_SOURCE_DIR/sysconfig.$i $RPM_BUILD_ROOT/var/adm/fillup-templates
done
#
# documents
#
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}
cp $RPM_SOURCE_DIR/README* $RPM_BUILD_ROOT%{_docdir}/%{name}
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}/alsa-lib
cp COPYING ChangeLog INSTALL TODO MEMORY-LEAK $RPM_BUILD_ROOT%{_docdir}/%{name}/alsa-lib
cp doc/asoundrc.txt $RPM_BUILD_ROOT%{_docdir}/%{name}/alsa-lib
# install alsa-info.sh to sbindir
install -c -m 0755 %{SOURCE33} $RPM_BUILD_ROOT%{_sbindir}
%post
%{fillup_and_insserv -ny sound alsasound}
%{fillup_and_insserv -n joystick joystick}
exit 0
%preun
%stop_on_removal alsasound joystick
exit 0
%postun
%restart_on_update alsasound joystick
%insserv_cleanup
exit 0
%post -n libasound2 -p /sbin/ldconfig
%postun -n libasound2 -p /sbin/ldconfig
%files
%defattr(-, root, root)
%doc %{_docdir}/%{name}
/etc/init.d/*
/etc/modprobe.d
/sbin/*
%{_sbindir}/*
%{_bindir}/*
/usr/lib/all_notes_off.*
%{_datadir}/sounds/alsa
/var/adm/fillup-templates/*
%if %suse_version < 1140
/etc/udev
%endif
%files devel
%defattr(-, root, root)
%{_libdir}/libasound.so
%{_includedir}/sys/*
%{_includedir}/alsa
%{_datadir}/aclocal/*.m4
%{_libdir}/pkgconfig/*.pc
%files docs
%defattr(-, root, root)
%doc doc/doxygen/html/*
%files -n libasound2
%defattr(-, root, root)
%{_libdir}/libasound.so.*
%{_libdir}/alsa-lib
%{_datadir}/alsa
%changelog