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/
#


Name:           tomahawk
Summary:        The social media player
License:        GPL-3.0+
Group:          Productivity/Multimedia/Sound/Players
Version:        0.6.0
Release:        0
Source:         tomahawk-%{version}.tar.bz2
Source2:        tomahawk.SuSEfirewall2
Source3:        Tomahawk.khotkeys
Source99:       tomahawk-rpmlintrc
Patch0:         tomahawk-ppc64.patch
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
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
Supplements:    packageand(tomahawk:kdebase4-workspace)

%description kde
This package makes hotkeys configurable in KDE systemsettings

%prep
%setup -q -n tomahawk-%{version}
%patch0 -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
/sbin/ldconfig
%desktop_database_post
%icon_theme_cache_post

%postun
/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

%{_libdir}/libtomahawklib.so
%{_libdir}/libtomahawk_*.so

%{_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

%changelog
openSUSE Build Service is sponsored by