File alsa-tools.spec of Package alsa-tools

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


#
%if %suse_version >  1140
%define have_gtk3	1
%else
%define have_gtk3	0
%endif

Name:           alsa-tools
BuildRequires:  alsa-devel
BuildRequires:  fdupes
BuildRequires:  fltk-devel
BuildRequires:  gcc-c++
BuildRequires:  gtk2-devel
BuildRequires:  libtool
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-devel
%if %{have_gtk3}
BuildRequires:  gtk3-devel
%endif
%define package_version	1.0.27
Url:            http://www.alsa-project.org/
Summary:        Various ALSA Tools
License:        GPL-2.0+
Group:          Productivity/Multimedia/Sound/Utilities
Version:        1.0.27
Release:        0
Requires:       alsa-firmware
Requires:       fxload
Source:         ftp://ftp.alsa-project.org/pub/tools/alsa-tools-%{package_version}.tar.bz2
Source1:        README.SuSE
Source2:        sbipatches.tar.bz2
Source3:        envy24control.desktop
Source4:        rmedigicontrol.desktop
Source7:        rme.png
Source8:        envy24.png
# upstream fixes
Patch1:         0001-Add-a-distclean-target-to-example-Makefile.patch
Patch2:         0002-Fix-spelling-of-successfully.patch
Patch3:         0003-Fix-bashisms.patch
Patch4:         0004-Fix-build-errors-caused-by-Werror-format-security.patch
Patch5:         0005-Add-AM_MAINTAINER_MODE-enable-macro-to-all-configure.patch
Patch6:         0006-hdajackretask-Fix-killing-PulseAudio-on-newer-PulseA.patch
# build fixes
Patch100:       alsa-tools-desktop-fix.dif
Patch101:       alsa-tools-no_m4_dir.dif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Various tools for ALSA including DSP loaders.

%package gui
Summary:        Various ALSA Tools with GUI
Group:          Productivity/Multimedia/Sound/Utilities
Requires:       pyalsa
Requires:       python-gtk

%description gui
Various tools for ALSA with GUI for controlling the configuration and
the mixer of sepcific sound cards.

%package devel
Summary:        Include Files and Libraries mandatory for Development
Group:          Development/Languages/C and C++
Requires:       alsa-tools = %{version}

%description devel
This package contains all necessary include files and libraries needed
to develop applications that require these.

%prep
%setup -q -a 2 -n %{name}-%{package_version}
cp %{SOURCE1} .
# upstream fixes
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
# build fixes
%patch100 -p1
%patch101 -p1

%build
export AUTOMAKE_JOBS="%{?_smp_mflags}"
ALL_PACKS="envy24control seq/sbiload hdspconf hdsploader hdspmixer rmedigicontrol echomixer usx2yloader us428control as10k1 ld10k1 hwmixvolume hda-verb"
%ifarch %{ix86}
ALL_PACKS="$ALL_PACKS sb16_csp sscape_ctl"
%endif
%if %{have_gtk3}
ALL_PACKS="$ALL_PACKS hdajackretask"
%endif
for d in $ALL_PACKS; do
  (cd $d
  # aclocal
  # test -f Makefile.am && automake -a --foreign
  # autoconf
  autoreconf -fi
  %configure
  make %{?_smp_mflags}
  )
done
# compile as10k1 examples
make -C as10k1/examples dsp

%install
ALL_PACKS="envy24control seq/sbiload hdspconf hdsploader hdspmixer rmedigicontrol echomixer usx2yloader us428control as10k1 ld10k1 hwmixvolume hda-verb"
%ifarch %{ix86}
ALL_PACKS="$ALL_PACKS sb16_csp sscape_ctl"
%endif
%if %{have_gtk3}
ALL_PACKS="$ALL_PACKS hdajackretask"
%endif
for d in $ALL_PACKS; do
  (cd $d
  make DESTDIR="$RPM_BUILD_ROOT" install
  )
done
rm -f $RPM_BUILD_ROOT%{_libdir}/liblo10k1.la
# remove obsolete hotplug files
rm -rf $RPM_BUILD_ROOT/etc/hotplug
# install pixmaps
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
cp %{SOURCE7} $RPM_BUILD_ROOT%{_datadir}/pixmaps
cp %{SOURCE8} $RPM_BUILD_ROOT%{_datadir}/pixmaps
cp hdspmixer/pixmaps/hdspmixer.png $RPM_BUILD_ROOT%{_datadir}/pixmaps
cp hdspconf/pixmaps/hdspconf.png $RPM_BUILD_ROOT%{_datadir}/pixmaps
# install desktop files
%suse_update_desktop_file -i envy24control AudioVideo Mixer GTK
%suse_update_desktop_file -i rmedigicontrol AudioVideo Mixer GTK
%suse_update_desktop_file hdspconf AudioVideo Utility
%suse_update_desktop_file hdspmixer AudioVideo Mixer
# install documents
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}
for d in $ALL_PACKS; do
  (cd $d
  n=${d##*/}
  mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}/$n
  for f in AUTHORS COPYING* ChangeLog NEWS README* TODO; do
    test -s $f || continue
    install -c -m 0644 $f $RPM_BUILD_ROOT%{_docdir}/%{name}/$n
  done
  )
done
# extra doc for ld10k1
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}/ld10k1/doc
cp ld10k1/doc/README $RPM_BUILD_ROOT%{_docdir}/%{name}/ld10k1/doc
cp ld10k1/doc/*.txt $RPM_BUILD_ROOT%{_docdir}/%{name}/ld10k1/doc
cp ld10k1/doc/*_usage $RPM_BUILD_ROOT%{_docdir}/%{name}/ld10k1/doc
# opl3 sounds
mkdir -p $RPM_BUILD_ROOT%{_datadir}/sounds/opl3
install -c -m 0644 *.o3 *.sb $RPM_BUILD_ROOT%{_datadir}/sounds/opl3
(cd as10k1
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}/as10k1/examples
cp examples/*.asm examples/*.emu10k1 $RPM_BUILD_ROOT%{_docdir}/%{name}/as10k1/examples
)
%fdupes -s $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-, root, root)
%doc %{_docdir}/%{name}
%{_bindir}/sbiload
%ifarch %{ix86}
%{_bindir}/sscape_ctl
%{_bindir}/cspctl
%endif
%{_bindir}/hdsploader
%{_bindir}/usx2yloader
%{_bindir}/us428control
%{_mandir}/man?/*
%{_datadir}/sounds/opl3
%{_bindir}/as10k1
%{_sbindir}/ld10k1
%{_sbindir}/ld10k1d
%{_sbindir}/dl10k1
%{_bindir}/lo10k1
%{_bindir}/init_*
%{_bindir}/hda-verb
%{_datadir}/ld10k1
%{_libdir}/liblo10k1.so.*

%files gui
%defattr(-, root, root)
%{_bindir}/envy24control
%{_bindir}/rmedigicontrol
%{_bindir}/hdspconf
%{_bindir}/hdspmixer
%{_bindir}/echomixer
%{_bindir}/hwmixvolume
%if %{have_gtk3}
%{_bindir}/hdajackretask
%endif
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/*

%files devel
%defattr(-, root, root)
%{_includedir}/lo10k1
%{_libdir}/liblo10k1.so
%{_datadir}/aclocal/*.m4

%changelog
openSUSE Build Service is sponsored by