File clementine.spec of Package clementine

#
# spec file for package clementine
#
# Copyright (c) 2014 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.2.3
Release:        0
Summary:        A cross-platform Music Player based on Amarok 1
License:        GPL-3.0+
Group:          Productivity/Multimedia/Sound/Players
Url:            http://www.clementine-player.org/
Source:         https://github.com/clementine-player/Clementine/archive/%{version}.tar.gz

Patch0:         clementine-1.2.2-dont-use-hacks-but-proper-sintax-for-non-wrapping-in-namespace.patch
BuildRequires:  boost-devel
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  freeglut-devel
BuildRequires:  gcc-c++
BuildRequires:  gettext-tools
BuildRequires:  help2man
BuildRequires:  hicolor-icon-theme
BuildRequires:  liblastfm-devel
BuildRequires:  libqxt-devel
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(QJson)
BuildRequires:  pkgconfig(QtCore)
BuildRequires:  pkgconfig(QtGui)
BuildRequires:  pkgconfig(QtSql)
BuildRequires:  pkgconfig(QtWebKit)
BuildRequires:  pkgconfig(fftw3)
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(glew)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gstreamer-0.10)
BuildRequires:  pkgconfig(gstreamer-plugins-base-0.10)
BuildRequires:  pkgconfig(libcdio)
BuildRequires:  pkgconfig(libchromaprint)
BuildRequires:  pkgconfig(libechonest)
BuildRequires:  pkgconfig(libgpod-1.0)
BuildRequires:  pkgconfig(libmtp)
BuildRequires:  pkgconfig(libnotify)
BuildRequires:  pkgconfig(libprojectM)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(protobuf)
BuildRequires:  pkgconfig(qca2)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(taglib) >= 1.8
Requires:       libtag1 >= 1.8
# plasma_runner dropped in clementine 1.1.0
Provides:       %{name}-kde = %{version}
Obsoletes:      %{name}-kde < %{version}
# gnome indicator - while we don't have it in OSS we don't build it
# BuildRequires:  libindicator-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} >= 1310
BuildRequires:  pkgconfig(libmygpo-qt) >= 1.0.7
%endif
%if 0%{?suse_version} >= 1230
BuildRequires:  pkgconfig(libsparsehash)
%endif

%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)

%prep
%setup -q -n Clementine-%{version}
%patch0 -p1

### NOTE built against system version of libraries
rm -rvf 3rdparty/chromaprint
rm -rvf 3rdparty/libechonest
rm -rvf 3rdparty/taglib
%if 0%{?suse_version} >= 1310
rm -rvf 3rdparty/libmygpo-qt
%endif

%build

%if 0%{?suse_version} == 1230
cmake \
    -DBUILD_WERROR=OFF \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    -DUSE_SYSTEM_PROJECTM=ON \
    -DBUNDLE_PROJECTM_PRESETS=OFF \
    -DUSE_SYSTEM_QXT=ON \
    -DUSE_BUILTIN_TAGLIB=OFF \
    -DENABLE_GOOGLE_DRIVE=ON \
    -DENABLE_MOODBAR=ON \
    -DENABLE_DBUS=ON
make %{?_smp_mflags}
%install
%make_install

%else
%cmake \
      -DBUILD_WERROR=OFF \
      -DUSE_SYSTEM_PROJECTM=ON \
      -DBUNDLE_PROJECTM_PRESETS=OFF \
      -DUSE_SYSTEM_QXT=ON \
      -DUSE_BUILTIN_TAGLIB=OFF \
%if 0%{?suse_version} >= 1230
      -DENABLE_GOOGLE_DRIVE=ON \
%endif
      -DENABLE_MOODBAR=ON \
      -DENABLE_DBUS=ON
make %{?_smp_mflags}

%install
%cmake_install
%endif

%suse_update_desktop_file clementine Qt KDE AudioVideo Audio Player

# 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

%fdupes -s %{buildroot}

%post
%desktop_database_post
%icon_theme_cache_post

%postun
%desktop_database_postun
%icon_theme_cache_postun

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

%changelog
openSUSE Build Service is sponsored by