File tomahawk.spec of Package tomahawk

#
# spec file for package tomahawk
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2011 Dominik Schmidt
#
# 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 _tomahawk_major_version 0
%define _tomahawk_minor_version 8
%define _tomahawk_patch_version 99

%define _libtomahawk_soversion %{_tomahawk_major_version}_%{_tomahawk_minor_version}_%{_tomahawk_patch_version}

Name:           tomahawk
Summary:        The social media player
License:        GPL-3.0+
Group:          Productivity/Multimedia/Sound/Players
Version:        0.8.99~git20170808T143449
Release:        0
Source:         tomahawk-%{version}.tar.xz
Source2:        tomahawk.SuSEfirewall2
Source3:        Tomahawk.khotkeys
Source99:       tomahawk-rpmlintrc
# PATCH-FIX-UPSTREAM
Patch1:         0001-Fix-control-reaches-end-of-non-void-function-in-Dele.patch

Url:            http://gettomahawk.com

Requires:       libQt5Sql5-sqlite

BuildRequires:  cmake
BuildRequires:  gcc-c++

# Required deps
%if 0%{?suse_version} > 1325
BuildRequires:  libboost_filesystem-devel
%else
BuildRequires:  boost-devel
%endif
BuildRequires:  attica-qt5-devel >= 0.4.0
BuildRequires:  libechonest-qt5-devel >= 2.3.0
BuildRequires:  libgnutls-devel
BuildRequires:  liblastfm-qt5-devel >= 1.0.1
BuildRequires:  libqca-qt5-devel
BuildRequires:  libqjson-devel
BuildRequires:  lucene++-devel
BuildRequires:  qtkeychain-qt5-devel
BuildRequires:  quazip-qt5-devel
BuildRequires:  sparsehash-devel
BuildRequires:  sqlite3-devel >= 3.6.22
BuildRequires:  taglib-devel >= 1.6.2
BuildRequires:  telepathy-qt5-devel
BuildRequires:  vlc-devel
BuildRequires:  websocketpp-devel
BuildRequires:  cmake(Qt5Concurrent)
BuildRequires:  cmake(Qt5DBus)
BuildRequires:  cmake(Qt5LinguistTools)
BuildRequires:  cmake(Qt5Svg)
BuildRequires:  cmake(Qt5UiTools)
BuildRequires:  cmake(Qt5WebKitWidgets)
BuildRequires:  cmake(Qt5Widgets)
BuildRequires:  cmake(Qt5X11Extras)
BuildRequires:  cmake(Qt5Xml)

# Audio stuff
BuildRequires:  phonon4qt5-devel
Recommends:     phonon4qt5-backend-gstreamer
Recommends:     phonon4qt5-backend-vlc

# Optional deps for additional features
BuildRequires:  libjreen-qt5-devel

# Other
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files

%description
Tomahawk is a multi-source, socially-connected, cross-platform and open-source music player

%package kde
Summary:        KDE integration for Tomahawk
Group:          Productivity/Multimedia/Sound/Players
Requires:       tomahawk = %{version}
Supplements:    packageand(tomahawk:plasma5-workspace)

%description kde
This package makes hotkeys configurable in KDE systemsettings

## Library

%package -n libtomahawk%{_libtomahawk_soversion}
Summary:        Library providing the core functionality of Tomahawk Player
Group:          Productivity/Multimedia/Sound/Players
Requires:       libtomahawk-plugins = %{version}

%description -n libtomahawk%{_libtomahawk_soversion}
Library providing the core functionality of Tomahawk Player a multi-source, socially-connected, cross-platform and open-source music player

%package -n libtomahawk-playdarapi%{_libtomahawk_soversion}
Summary:        Library providing the Playdar API functionality of Tomahawk Player
Group:          Productivity/Multimedia/Sound/Players

%description -n libtomahawk-playdarapi%{_libtomahawk_soversion}
Library providing the Playdar API functionality of Tomahawk Player a multi-source, socially-connected, cross-platform and open-source music player

%package -n libtomahawk-widgets%{_libtomahawk_soversion}
Summary:        Library providing widgets of Tomahawk Player
Group:          Productivity/Multimedia/Sound/Players

%description -n libtomahawk-widgets%{_libtomahawk_soversion}
Library providing the Playdar API functionality of Tomahawk Player a multi-source, socially-connected, cross-platform and open-source music player

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

%description -n libtomahawk-devel
Library providing widgets of Tomahawk Player a multi-source, socially-connected, cross-platform and open-source music player

## Plugins

%package -n libtomahawk-plugins-telepathy
Summary:        Plugin providing the Telepathy functionality of Tomahawk Player
Group:          Productivity/Multimedia/Sound/Players

%description -n libtomahawk-plugins-telepathy
Plugin providing the Telepathy functionality of Tomahawk Player a multi-source, socially-connected, cross-platform and open-source music player

%package -n libtomahawk-plugins
Summary:        Plugins providing the core functionality of Tomahawk Player
Group:          Productivity/Multimedia/Sound/Players

%description -n libtomahawk-plugins
Plugins providing the core functionality of Tomahawk Player a multi-source, socially-connected, cross-platform and open-source music player

%prep
%setup -q
%patch1 -p1

%build
cmake . \
    -DCMAKE_C_FLAGS="%{optflags}" \
    -DCMAKE_CXX_FLAGS="%{optflags}" \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    -DCMAKE_INSTALL_LIBEXECDIR=lib \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCMAKE_VERBOSE_MAKEFILE=ON \
    -DCMAKE_SKIP_RPATH=ON \
    -DWITH_CRASHREPORTER=OFF \
%ifarch %arm ppc ppc64 ppc64le
    -DWITH_BREAKPAD=OFF \
%endif
    -DBUILD_RELEASE=ON

%__make %{?_smp_mflags} || %__make

%install
%make_install

# install firewall service file
%__install -D -m 644 %{_sourcedir}/tomahawk.SuSEfirewall2 \
        %{buildroot}/etc/sysconfig/SuSEfirewall2.d/services/tomahawk

# update desktop file
%suse_update_desktop_file -r tomahawk AudioVideo Player

# install hotkey integration for kde
%__install -D -m 644 %{_sourcedir}/Tomahawk.khotkeys \
        %{buildroot}%{_datadir}/khotkeys/Tomahawk.khotkeys

# currently not "supported" on openSUSE:
%__rm -rf "%{buildroot}%{_datadir}/icons/hicolor/1024x1024"
%__rm -rf "%{buildroot}%{_datadir}/icons/hicolor/512x512"
%__rm -rf "%{buildroot}%{_datadir}/icons/hicolor/128x128-grayscale/"

%post
%desktop_database_post
%icon_theme_cache_post

%postun
%desktop_database_postun
%icon_theme_cache_postun

%post -n libtomahawk%{_libtomahawk_soversion}
/sbin/ldconfig

%postun -n libtomahawk%{_libtomahawk_soversion}
/sbin/ldconfig

%post -n libtomahawk-playdarapi%{_libtomahawk_soversion}
/sbin/ldconfig

%postun -n libtomahawk-playdarapi%{_libtomahawk_soversion}
/sbin/ldconfig

%post -n libtomahawk-widgets%{_libtomahawk_soversion}
/sbin/ldconfig

%postun -n libtomahawk-widgets%{_libtomahawk_soversion}
/sbin/ldconfig

%files
%defattr(-,root,root,0755)
%doc LICENSE.txt README.md ChangeLog AUTHORS
%{_bindir}/tomahawk

%ifnarch %arm ppc ppc64 ppc64le
# %%{_libexecdir}/tomahawk_crash_reporter
%endif

%{_datadir}/applications/tomahawk.desktop
%{_datadir}/icons/*/*/apps/tomahawk.*

%config /etc/sysconfig/SuSEfirewall2.d/services/tomahawk

%files kde
%defattr(-,root,root,0755)
%dir %{_datadir}/khotkeys/
%{_datadir}/khotkeys/Tomahawk.khotkeys

## Library

%files -n libtomahawk%{_libtomahawk_soversion}
%defattr(-,root,root,0755)
%{_libdir}/libtomahawk.so.*

%files -n libtomahawk-playdarapi%{_libtomahawk_soversion}
%defattr(-,root,root,0755)
%{_libdir}/libtomahawk-playdarapi.so.*

%files -n libtomahawk-widgets%{_libtomahawk_soversion}
%defattr(-,root,root,0755)
%{_libdir}/libtomahawk-widgets.so.*

%files -n libtomahawk-devel
%defattr(-,root,root,0755)
%{_includedir}/libtomahawk/
%{_libdir}/cmake/Tomahawk/
%{_libdir}/libtomahawk.so
%{_libdir}/libtomahawk-playdarapi.so
%{_libdir}/libtomahawk-widgets.so

## Plugins
%files -n libtomahawk-plugins
%defattr(-,root,root,0755)
%{_libdir}/libtomahawk_account_*.so
%{_libdir}/libtomahawk_infoplugin_*.so
%{_libdir}/libtomahawk_viewpage_*.so

%files -n libtomahawk-plugins-telepathy
%defattr(-,root,root,0755)
%{_libdir}/libtomahawk_configstorage_telepathy.so

%changelog