File ffado-mixer.spec of Package ffado

#
# spec file for package ffado-mixer
#
# Copyright (c) 2012 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/
#


# The python_sitelib macro doesn't seem to be available in 11.1 and 11.0
%if 0%{?suse_version} < 1120
%define python_sitelib %{_libexecdir}/python%{py_ver}/site-packages
%endif

Name:           ffado-mixer
%define tname libffado
Version:        2.0.1.2040
Release:        0
Summary:        FireWire 1394 support for audio devices, svn snapshot
License:        GPL-2.0+
Group:          Productivity/Multimedia/Other
Url:            http://www.ffado.org/
Source0:        %{tname}-%{version}.tar.bz2
Patch1:         ffado-gcc47.patch
Patch2:         libffado-bswap.patch
BuildRequires:  alsa-devel
BuildRequires:  dbus-1-python-devel
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  ffado
BuildRequires:  gcc-c++
BuildRequires:  graphviz-gnome
BuildRequires:  libavc1394-devel
BuildRequires:  libconfig++-devel
BuildRequires:  libdbus-c++-devel
BuildRequires:  libexpat-devel
BuildRequires:  libiec61883-devel >= 1.1.0
BuildRequires:  libqt4-devel
BuildRequires:  libraw1394-devel >= 1.3.0
BuildRequires:  libxml++-devel
BuildRequires:  pkg-config
BuildRequires:  scons
BuildRequires:  subversion
BuildRequires:  update-desktop-files
BuildRequires:  xdg-utils
BuildRequires:  xorg-x11-fonts
BuildRequires:  pkgconfig(dbus-1) >= 1.0
%if 0%{?suse_version} > 1110
BuildRequires:  python-qt4-devel
%else
BuildRequires:  python-qt4
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%{py_requires}

%description
FFADO aims to provide a generic, open-source solution
to support FireWire(IEEE1394, iLink) based (semi-)
professional audio interfaces.
It's the successor of the FreeBoB project. FFADO is a
volunteer-based community effort, trying to provide Linux
with at least the same level of functionality that is
present on the other operating systems.
The range of FireWire Audio Devices that we would like
to support is broad: from pure audio interfaces over
mixed audio-control devices to DSP algorithm devices.
This is a snapshot of svn revision 2040

%package -n ffado-doc
Summary:        API documentation for ffado
Group:          Documentation/HTML
%if 0%{?suse_version} >= 1120
BuildArch:      noarch
%endif

%description -n ffado-doc
This package contains the libffado API documentation.

%prep
%setup -n %{tname}-%{version} -q
%patch1 -p1
%patch2 -p1

%build
scons %{?jobs:--jobs=%jobs} \
  PREFIX=%{_prefix} \
  LIBDIR=%{_libdir} \
  ENABLE_GENERICAVC=yes \
  SERIALIZE_USE_EXPAT=no \
  DEBUG=no \
  ENABLE_ALL=yes \
  PYPKGDIR=%{python_sitelib} \
  ENABLE_OPTIMIZATIONS=yes \
  BUILD_TESTS=yes \
  COMPILE_FLAGS="%{optflags} -fno-strict-aliasing -ggdb"

%install
scons   DESTDIR=%{buildroot} \
  install

# Build API documentation
export top_srcdir=$PWD
pushd doc
doxygen -u reference.doxygen.in
doxygen reference.doxygen.in
mkdir -p %{buildroot}%{_docdir}/%{tname}
cp -r reference %{buildroot}%{_docdir}/%{tname}
popd

mv %{buildroot}%{_datadir}/%{tname}/icons %{buildroot}%{_datadir}/
rm %{buildroot}%{_libdir}/%tname.*
rm -r %{buildroot}%{_includedir}/libffado
rm -r %{buildroot}%{_libdir}/pkgconfig

rpm -ql ffado | while read file; do
  rm -v "%{buildroot}$file" || true
done

mkdir -p %{buildroot}%{_datadir}/applications/
 mkdir -p %{buildroot}%{_datadir}/pixmaps
 cp support/xdg/hi64-apps-ffado.png %{buildroot}%{_datadir}/pixmaps/ffadomixer.png
%suse_update_desktop_file -c ffadomixer FfadoMixer "Mixer for ffado" ffado-mixer ffadomixer "AudioVideo;Mixer;HardwareSettings;Qt"

# This problem seems to have been fixed in svn builds
%if 0 == 1
chmod 755 %{buildroot}%{_datadir}/%{tname}/python/ffado_configuration.py
chmod 755 %{buildroot}%{_datadir}/%{tname}/python/ffado_panelmanager.py
chmod 755 %{buildroot}%{_datadir}/%{tname}/python/ffado_dbus_util.py
%endif

find ./ -empty -delete
%fdupes -s %{buildroot}%{_datadir}

%files
%defattr(-,root,root)
%doc README AUTHORS ChangeLog LICENSE.GPLv2 LICENSE.GPLv3
%{_bindir}/ffado-mixer
%{_datadir}/%{tname}/
%{_datadir}/icons/*
%{_datadir}/pixmaps/ffadomixer.png
%{_datadir}/applications/*
%{python_sitelib}/*

%files -n ffado-doc
%defattr(-,root,root)
%{_docdir}/%{tname}

%changelog
openSUSE Build Service is sponsored by