File tomahawk.spec of Package tomahawk

#
# spec file for package tomahawk
#
# Copyright (c) 2013 SUSE LINUX Products 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 7
%define _tomahawk_patch_version 0

%define _libtomahawk_soname %{_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:        %{_tomahawk_major_version}.%{_tomahawk_minor_version}.%{_tomahawk_patch_version}
Release:        0
Source:         tomahawk-%{version}.tar.bz2
Source2:        tomahawk.SuSEfirewall2
Source3:        Tomahawk.khotkeys
Source99:       tomahawk-rpmlintrc
# PATCH-FIX-UPSTREAM: tomahawk-nobreakpad.patch https://bugs.tomahawk-player.org/browse/TWK-1248 dvaleev@suse.com -- Fix the ppc build with -DWITH_BREAKPAD=OFF
Patch0:         tomahawk-nobreakpad.patch
# PATCH-FIX-UPSTREAM: taken from master, remove for 0.8.x
Patch1:         tomahawk-0.7.0-build-portfwd-statically-and-rename-libtomahawklib-to-libtomahawk.diff

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Url:            http://gettomahawk.com

Requires:       libqt4-sql-sqlite

BuildRequires:  cmake
BuildRequires:  gcc-c++

# Required deps
BuildRequires:  libQtWebKit-devel
BuildRequires:  libqjson-devel
BuildRequires:  libqt4-devel >= 4.7.0

BuildRequires:  boost-devel >= 1.3
BuildRequires:  clucene-core-devel >= 2.3.3.4
BuildRequires:  libattica-devel >= 0.4.0
BuildRequires:  libechonest-devel >= 2.0.3
BuildRequires:  liblastfm-devel >= 1.0.1
BuildRequires:  libqca2-devel
BuildRequires:  quazip-devel
BuildRequires:  sqlite3-devel >= 3.6.22
BuildRequires:  taglib-devel >= 1.6.2

# Audio stuff
BuildRequires:  phonon-devel >= 4.5.0
Requires:       phonon >= 4.5.0
Conflicts:      phonon-backend-vlc < 0.4 phonon-backend-gstreamer < 4.5.0 phonon-backend-xine
Recommends:     phonon-backend-gstreamer >= 4.5.0 phonon-backend-vlc >= 0.4

# Optional deps for additional features
BuildRequires:  libjreen-devel >= 1.0.1
BuildRequires:  libqtweetlib-devel

# KDE integration
BuildRequires:  kde4-filesystem

# 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:kdebase4-workspace)

%description kde
This package makes hotkeys configurable in KDE systemsettings

## Library

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

%description -n libtomahawk%{_libtomahawk_soname}
Library providing the core 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_soname} = %{version}

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

## Plugins

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

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



%prep
%setup -q -n tomahawk-%{version}
%patch0 -p1
%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 \
%ifarch %arm ppc ppc64
    -DWITH_CRASHREPORTER=OFF \
    -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}%{_kde4_appsdir}/khotkeys/Tomahawk.khotkeys

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

%post -n libtomahawk%{_libtomahawk_soname}
/sbin/ldconfig
%desktop_database_post
%icon_theme_cache_post

%postun -n libtomahawk%{_libtomahawk_soname}
/sbin/ldconfig
%desktop_database_postun
%icon_theme_cache_postun

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

%ifnarch %arm ppc ppc64
%{_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 %{_kde4_appsdir}/khotkeys/
%{_kde4_appsdir}/khotkeys/Tomahawk.khotkeys

## Library

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

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

## Plugins

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

%changelog