File alsa-utils.spec of Package alsa-utils

# spec file for package alsa-utils
# Copyright (c) 2016 SUSE LINUX 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

%define package_version	1.1.2
%if 0%{?suse_version} > 1130
%define use_systemd	1
%define use_varlib	1
%if 0%{?suse_version} == 1140
%define _unitdir /lib/systemd/system
BuildRequires:  systemd
%define use_systemd	0
%define use_varlib	0
%if 0%{?suse_version} > 1200
%define _udevdir %(pkg-config --variable=udevdir udev)
%define _udevdir /lib/udev
Name:           alsa-utils
Version:        1.1.2
Release:        0
Summary:        Advanced Linux Sound Architecture Utilities
License:        GPL-2.0+
Group:          Productivity/Multimedia/Sound/Players
Source1:        01beep.conf
# Patch:          alsa-utils-git-fixes.diff
Patch99:        alsa-utils-gettext-version-removal.diff
BuildRequires:  alsa-devel
BuildRequires:  automake
BuildRequires:  fftw3-devel
BuildRequires:  libsamplerate-devel
BuildRequires:  ncurses-devel
BuildRequires:  pkgconfig
BuildRequires:  xmlto
Requires:       alsa
Requires:       dialog
Requires:       pciutils
Provides:       alsa-conf
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1200
BuildRequires:  pkgconfig(udev)

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

%package -n alsabat
Summary:        Command-line sound tester for ALSA sound card driver
Group:          Productivity/Multimedia/Sound/Utilities
Requires:       alsa-utils = %{version}
Obsoletes:      bat <= 1.1.0

%description -n alsabat
BAT (Basic Audio Tester) is a simple command-line utility intended
to help automate audio driver and sound server testing with little human
interaction. BAT can be used to test audio quality, stress test features
and test audio before and after PM state changes.

%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
%if 0%{?suse_version} < 1020
%patch99 -p1

export AUTOMAKE_JOBS="%{?_smp_mflags}"
%if 0%{?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 0%{?suse_version} < 1030
opts="$opts --disable-xmlto"
opts="$opts --with-udev-rules-dir=%{_udevdir}/rules.d"
%configure --with-curses=ncursesw $opts
make %{?_smp_mflags}

make DESTDIR=%{buildroot} install %{?_smp_mflags}
mkdir -p %{buildroot}%{_datadir}/alsa/init/preinit
mkdir -p %{buildroot}%{_datadir}/alsa/init/postinit
for i in %{_sourcedir}/[0-9]*.conf; do
  install -c -m 0644 $i %{buildroot}%{_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 %{buildroot}%{_localstatedir}/lib/alsa

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

%files -n alsabat
%defattr(-, root, root)

openSUSE Build Service is sponsored by