File alsa-utils.spec of Package alsa-utils

# spec file for package alsa-utils
# 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

%if %suse_version > 1130
%define use_systemd	1
BuildRequires:  systemd
%define use_varlib	1
%if %suse_version == 1140
%define _unitdir /lib/systemd/system
%define use_systemd	0
%define use_varlib	0
%if %suse_version > 1200
%define _udevdir %(pkg-config --variable=udevdir udev)
%define _udevdir /lib/udev

Name:           alsa-utils
BuildRequires:  alsa-devel
BuildRequires:  automake
BuildRequires:  libsamplerate-devel
%if %suse_version > 1200
BuildRequires:  libudev-devel
BuildRequires:  ncurses-devel
BuildRequires:  pkgconfig
BuildRequires:  xmlto
%define package_version	1.0.26
Provides:       alsa-conf
Requires:       alsa
Requires:       dialog
Requires:       pciutils
Summary:        Advanced Linux Sound Architecture Utilities
License:        GPL-2.0+
Group:          Productivity/Multimedia/Sound/Players
Version:        1.0.26
Release:        0
Source1:        01beep.conf
# Patch:          alsa-utils-git-fixes.diff
Patch1:         0001-speaker-test-Add-support-for-channel-mapping-API.patch
Patch2:         0002-aplay-Add-support-for-channel-mapping.patch
Patch3:         0003-aplay-More-support-for-channel-map-option.patch
Patch4:         0004-speaker-test-Update-man-page-for-chmap-option.patch
Patch5:         0005-aplay-fix-typo-silence-warning.patch
Patch6:         0006-alsamixer-fix-handling-of-removed-controls.patch
Patch7:         0007-aplay-Show-usage-if-no-parameter-is-passed.patch
Patch8:         0008-amixer-fix-rounding-of-relative-changes.patch
Patch9:         0009-amixer-Fix-parsing-container-TLV-entries.patch
Patch10:        0010-alsaloop-Make-alsaloop-working-without-libsamplerate.patch
Patch11:        0011-alsaloop-Fix-missing-endif.patch
Patch12:        0012-aplay-Add-the-support-for-big-endian-WAV-format-RIFX.patch
Patch13:        0013-configure-Fix-obsolete-AM_CONFIG_HEADER-macro.patch
Patch14:        0014-speaker-test-increase-the-maximum-supported-rate-to-.patch
Patch15:        0015-amixer-Fix-dB-value-outputs-in-amixer-contents.patch
Patch99:        alsa-utils-gettext-version-removal.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

This package contains utility programs supporting ALSA, Advanced Linux
Sound Architecture.

%setup -q -n %{name}-%{package_version}
# fix stupid automake's automatic action
sed -i -e's/EXTRA_DIST= config.rpath /EXTRA_DIST=/'
# rm -f po/Makefile* po/*.gmo po/*.pot po/*.header po/stamp-*
# 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
%if %suse_version < 1020
%patch99 -p1

export AUTOMAKE_JOBS="%{?_smp_mflags}"
%if %suse_version < 1020
gettextize -f
autoreconf -fi
%if %use_systemd
opts="$opts --with-systemdsystemunitdir=%{_unitdir}"
%if ! %use_varlib
opts="$opts --with-asound-state-dir=/etc"
%if %suse_version < 1030
opts="$opts --disable-xmlto"
opts="$opts --with-udev-rules-dir=%{_udevdir}/rules.d"
%configure --with-curses=ncursesw $opts
make %{?_smp_mflags}

mkdir -p $RPM_BUILD_ROOT%{_datadir}/alsa/init/preinit
mkdir -p $RPM_BUILD_ROOT%{_datadir}/alsa/init/postinit
for i in %{_sourcedir}/[0-9]*.conf; do
  install -c -m 0644 $i $RPM_BUILD_ROOT%{_datadir}/alsa/init/postinit
%find_lang %{name} --all-name
%if %use_systemd
ln -s alsa-restore.service %{buildroot}%{_unitdir}/alsasound.service
%if %use_varlib
mkdir -p $RPM_BUILD_ROOT/var/lib/alsa

%files -f %{name}.lang
%defattr(-, root, root)
%doc seq/aconnect/README*
%doc seq/aseqnet/README*
%doc %{_mandir}/man*/*
%doc %{_mandir}/fr
%if %use_systemd
%if %use_varlib

openSUSE Build Service is sponsored by