File clementine-qt5.spec of Package clementine-qt5

#
# spec file for package clementine-qt5
#
# Copyright (c) 2018 SUSE LINUX 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/
#

%define rtime 1568884805
%define rhash 88131ec5f
%define version_path 99
Name:           clementine
Version:        1.3.%{version_path}.git.%{rtime}.%{rhash}
Release:        0
Summary:        A cross-platform Music Player based on Amarok 1.4
License:        GPL-3.0+
Group:          Productivity/Multimedia/Sound/Players
Url:            http://www.clementine-player.org/
Source0:        %{name}-%{version}.tar.xz
# Patch fix factory build, add -fPIC to moodbar build
Patch3:         clementine-moodbar-fpic.patch
# PATCH-FEATURE-OPENSUSE
Patch6:         use_system_qxtglobalshortcut.patch
# PATCH-FEATURE-UPSTREAM
Patch7:         deviceview_2_line_text_color.patch
# PATCH-FIX-UPSTREAM revert queue changes
Patch17:        revert_gst_queue.patch
# PATCH-FIX-UPSTREAM Fix memory leaks in database
Patch18:        6375.patch
# PATCH-FIX-UPSTREAM Fix memory leaks
Patch19:        6376.patch
# PATCH-FIX-UPSTREAM Fix ratings not saved to file tag (Fix #6385)
Patch20:        6386.patch
# PATCH-FIX-UPSTREAM Fix misc. source comment typos
Patch21:        6393.patch
%if 0%{?suse_version} > 1325
BuildRequires:  libboost_headers-devel
%else
BuildRequires:  boost-devel
%endif
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  freeglut-devel
BuildRequires:  gcc-c++
BuildRequires:  gettext-tools
BuildRequires:  help2man
BuildRequires:  hicolor-icon-theme
BuildRequires:  libindicator-devel
BuildRequires:  liblastfm-qt5-devel
BuildRequires:  libmygpo-qt5-devel
BuildRequires:  qxtglobalshortcut-devel
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Xml)
BuildRequires:  pkgconfig(Qt5Sql)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5X11Extras)
BuildRequires:  pkgconfig(Qt5OpenGL)
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Test)
BuildRequires:  pkgconfig(Qt5WebKitWidgets)
BuildRequires:  cmake(Qt5LinguistTools)
BuildRequires:  libQt5Gui-private-headers-devel
BuildRequires:  pkgconfig(cryptopp)
BuildRequires:  pkgconfig(fftw3)
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(glew)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gstreamer-1.0)
BuildRequires:  pkgconfig(gstreamer-plugins-base-1.0)
BuildRequires:  pkgconfig(libcdio)
BuildRequires:  pkgconfig(libchromaprint)
BuildRequires:  pkgconfig(libgpod-1.0)
BuildRequires:  pkgconfig(libmtp)
BuildRequires:  pkgconfig(libmygpo-qt) >= 1.0.7
BuildRequires:  pkgconfig(libnotify)
BuildRequires:  pkgconfig(libprojectM)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(libsparsehash)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(protobuf)
BuildRequires:  pkgconfig(qca2)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(taglib) >= 1.8
Recommends: 	gstreamer-plugins-libav
Requires:       libtag1 >= 1.8
# plasma_runner dropped in clementine 1.1.0
Provides:       %{name}-kde = %{version}
Obsoletes:      %{name}-kde < %{version}

%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 Qt5.

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-player
%patch3
%patch6 -p1
%patch7 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1

### NOTE built against system version of libraries
rm -rvf 3rdparty/chromaprint
rm -rvf 3rdparty/taglib
rm -rvf 3rdparty/qxt
# clementine may want a non-release version of that
%if 0%{?suse_version} >= 1310
rm -rvf 3rdparty/libmygpo-qt
%endif

sed -i -e '/set(CLEMENTINE_VERSION_PATCH / s/[[:digit:]][[:digit:]]*/%{version_path}.%{rhash}/' cmake/Version.cmake

%build
%cmake \
      -DBUILD_WERROR=OFF \
      -DUSE_SYSTEM_QXT=ON \
      -DUSE_SYSTEM_PROJECTM=ON \
      -DBUNDLE_PROJECTM_PRESETS=OFF \
%if 0%{?suse_version} >= 1230
      -DENABLE_GOOGLE_DRIVE=ON \
%endif
      -DENABLE_MOODBAR=ON \
      -DENABLE_DBUS=ON \
      -DENABLE_DEVICEKIT=ON \
      -DENABLE_GIO=ON \
      -DUSE_SYSTEM_TAGLIB=ON \
      -DFORCE_GIT_REVISION="qt5-%{release}-g%{version}"
make %{?_smp_mflags} V=1

%install
%cmake_install

%suse_update_desktop_file %{name} Qt KDE AudioVideo Player
%fdupes -s %{buildroot}

%if 0%{?suse_version} < 1500
%post
%desktop_database_post
%icon_theme_cache_post

%postun
%desktop_database_postun
%icon_theme_cache_postun
%endif

%files
%defattr(-,root,root)
%license COPYING
%doc Changelog
%{_bindir}/%{name}
%{_bindir}/%{name}-tagreader
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/*/*%{name}*.*
%dir %{_datadir}/kservices5/
%{_datadir}/kservices5/%{name}-*.protocol

%changelog