File qmmp.spec of Package qmmp

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

%bcond_with ffmpeg
%bcond_with mad
%bcond_with faad

%define soname 0

Name:           qmmp
Version:        0.5.5
Release:        0
Summary:        XMMS-like audio player
License:        GPL-2.0+
Group:          Productivity/Multimedia/Sound/Players
Patch0:         qmmp-0.5.5-libcdio_mess.patch
# Already in trunk
Patch1:         qmmp-0.5.5-ffmpeg_011.patch
# PATCH-FEATURE-OPENSUSE qmmp-0.5.5-default_pulse.patch -- Use PulseAudio instead of ALSA by default
Patch2:         qmmp-0.5.5-default_pulse.patch
BuildRequires:  cmake
BuildRequires:  desktop-file-utils
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  libmpcdec-devel
BuildRequires:  pkgconfig(QtCore)
BuildRequires:  pkgconfig(QtDBus)
BuildRequires:  pkgconfig(QtGui)
BuildRequires:  pkgconfig(QtNetwork)
BuildRequires:  pkgconfig(QtOpenGL)
BuildRequires:  pkgconfig(QtXml)
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(enca) >= 1.9
BuildRequires:  pkgconfig(flac)
# Standard Jack version is not new enough until openSUSE 12.1
%if 0%{?suse_version} > 1140
BuildRequires:  pkgconfig(jack)
BuildRequires:  pkgconfig(libbs2b)
BuildRequires:  pkgconfig(libcddb)
BuildRequires:  pkgconfig(libcdio)
BuildRequires:  pkgconfig(libcdio_cdda)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libgme)
BuildRequires:  pkgconfig(libmms)
BuildRequires:  pkgconfig(libmodplug)
BuildRequires:  pkgconfig(libprojectM)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(libpulse-simple)
BuildRequires:  pkgconfig(samplerate)
BuildRequires:  pkgconfig(sndfile)
BuildRequires:  pkgconfig(taglib)
BuildRequires:  pkgconfig(vorbisfile)
BuildRequires:  pkgconfig(wavpack)
%if %{with ffmpeg}
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
%if %{with mad}
BuildRequires:  pkgconfig(mad)
%if %{with faad}
BuildRequires:  libfaad-devel

This program is an audio-player, written with help of Qt library. The program
has user interface, similar winamp or xmms.

%package -n libqmmp%{soname}
Summary:        Qmmp library
Group:          System/Libraries
Recommends:     libqmmp%{soname}-plugin-mplayer
Recommends:     libqmmp%{soname}-plugins

%description -n libqmmp%{soname}
Qmmp library.

%package -n libqmmp%{soname}-plugins
Summary:        Plugins for libqmmp
Group:          System/Libraries

%description -n libqmmp%{soname}-plugins
Plugins for libqmmp.

%package -n libqmmp%{soname}-plugin-mplayer
Summary:        MPlayer plugin for libqmmp
Group:          System/Libraries
Requires:       %{_bindir}/mplayer

%description -n libqmmp%{soname}-plugin-mplayer
MPlayer plugin for libqmmp.

%package -n libqmmp-devel
Summary:        Development files for libqmmp
Group:          Development/Libraries/C and C++
Requires:       libqmmp%{soname} = %{version}

%description -n libqmmp-devel
Development files for libqmmp.

%setup -q

mkdir build
cd build
export CFLAGS='%{optflags}'
export CXXFLAGS='%{optflags}'
make %{?_smp_mflags}

cd build



%post -n libqmmp%{soname} -p /sbin/ldconfig

%postun -n libqmmp%{soname} -p /sbin/ldconfig

%post -n libqmmp%{soname}-plugins

%postun -n libqmmp%{soname}-plugins

%attr(0755,root,root) %{_bindir}/qmmp

%files -n libqmmp%{soname}

%files -n libqmmp%{soname}-plugins
%exclude %{_libdir}/qmmp/Engines/

%files -n libqmmp%{soname}-plugin-mplayer

%files -n libqmmp-devel