File clementine.spec of Package clementine

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


Name:           clementine
Version:        1.0.1.git
Release:        0
Summary:        A cross-platform Music Player based on Amarok 1
License:        GPL-3.0+
Group:          Productivity/Multimedia/Sound/Players
Url:            http://code.google.com/p/clementine-player/
Source:         %{name}-%{version}.tar.bz2
# http://clementine-player.googlecode.com/files/
# PATCH-FIX-OPENSUSE clementine-desktop-fix.patch fisiu@opensuse.org -- remove unity related shortcuts
Patch0:         clementine-desktop-fix.patch
BuildRequires:  boost-devel
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  gettext-tools
BuildRequires:  git
BuildRequires:  help2man
BuildRequires:  hicolor-icon-theme
BuildRequires:  libkde4-devel
BuildRequires:  liblastfm-devel
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(fftw3)
BuildRequires:  pkgconfig(glew)
BuildRequires:  pkgconfig(libgpod-1.0)
# No gnutls means no gloox with license problem (GPL-2.0 only)
#BuildRequires:  pkgconfig(gnutls)
%if 0%{?suse_version} > 1120
BuildRequires:  pkgconfig(libimobiledevice-1.0)
BuildRequires:  pkgconfig(libplist)
BuildRequires:  pkgconfig(libusbmuxd)
%if 0%{?suse_version} <= 1210
BuildRequires:  libprotobuf-lite6
%endif
%endif
# Enabled protobuf, now required in git version.
BuildRequires:  protobuf-devel
BuildRequires:  pkgconfig(QJson)
BuildRequires:  pkgconfig(QtCore)
BuildRequires:  pkgconfig(QtGui)
BuildRequires:  pkgconfig(QtSql)
BuildRequires:  pkgconfig(QtWebKit)
BuildRequires:  pkgconfig(gstreamer-0.10)
BuildRequires:  pkgconfig(gstreamer-plugins-base-0.10)
BuildRequires:  pkgconfig(libcdio)
BuildRequires:  pkgconfig(libmtp)
BuildRequires:  pkgconfig(libnotify)
BuildRequires:  pkgconfig(qca2)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(taglib)
# gnome indicator - while we don't have it in OSS we don't build it
# BuildRequires:  libindicator-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires(post): desktop-file-utils

%description
Clementine is a modern music player and library organiser. Clementine is a
port of Amarok 1.4, with some features rewritten to take advantage of Qt4.

Features:

    * Search and play your local music library
    * Listen to internet radio from Last.fm and SomaFM
    * Edit tags on MP3 and OGG files, organise your music
    * Cross-platform - works on Windows, Mac OS X and Linux
    * Native desktop notifications on Linux (libnotify) and Mac OS X (Growl)

%package kde
Summary:        Clementine's support for plasma search
Group:          System/GUI/KDE
%kde4_runtime_requires

%description kde
Clementine is a modern music player and library organiser. Clementine is a
port of Amarok 1.4, with some features rewritten to take advantage of Qt4.

This package provides clementine's support for plasma global search.

%prep
%setup -q
%patch0
rm -rf --verbose 3rdparty/gloox
# 3rdparty/qxt

%build
export CXXFLAGS="%{optflags}"
export CFLAGS="$CXXFLAGS"
# Remote control support cannot be enabled without the owner of gloox (http://camaya.net/gloox)
# first giving permission for relicensing to GPLv2 or later. See bnc#695820
mkdir build && cd build && \
cmake -DCMAKE_VERBOSE_MAKEFILE=ON \
      -DCMAKE_INSTALL_PREFIX=%{_prefix} \
      -DENABLE_PLASMARUNNER=ON \
      -DENABLE_BREAKPAD=OFF \
      -DWITH_FFTW3:BOOL=ON ..

      make %{?_smp_mflags}

%install
cd build
%make_install
%suse_update_desktop_file -r clementine AudioVideo Player

%if 0%{?suse_version} >= 1140
# Generate man page with help2man
mkdir -p %{buildroot}%{_mandir}/man1
pushd %{buildroot}%{_mandir}/man1
cp -v %{buildroot}%{_bindir}/%{name} ./
help2man \
	--version-string="%{version}" \
	-N -o %{name}.1 ./%{name}
rm %{name}
popd
%endif

%fdupes -s %{buildroot}

%post
update-desktop-database > /dev/null

%postun
update-desktop-database > /dev/null

%files
%defattr(-,root,root)
%doc Changelog COPYING
%{_bindir}/clementine
%{_datadir}/applications/clementine.desktop
%{_datadir}/clementine
%{_datadir}/icons/hicolor/64x64/apps/application-x-clementine.png
%{_datadir}/icons/hicolor/scalable/apps/application-x-clementine.svg
%{_bindir}/clementine-tagreader
%{_datadir}/kde4/services/clementine-feed.protocol
%{_datadir}/kde4/services/clementine-itms.protocol
%{_datadir}/kde4/services/clementine-itpc.protocol
%{_datadir}/kde4/services/clementine-zune.protocol
%if 0%{?suse_version} >= 1140
%{_mandir}/man1/%{name}.1.gz
%endif

%files kde
%defattr(-,root,root)
%dir /usr/lib/kde4
/usr/lib/kde4/plasma_runner_clementine.so
%{_datadir}/kde4/services/plasma-runner-clementine.desktop

%changelog
openSUSE Build Service is sponsored by