File cantata.spec of Package cantata

#
# spec file for package cantata
#
# Copyright (c) 2015 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/
#

%if 0%{?suse_version} > 1320 || 0%{?suse_version} == 1315 && 0%{?is_opensuse}
%define qt5 1
%else
%define qt5 0
%endif

Name:           cantata
Version:        2.0.1
Release:        0
Summary:        Client for the Music Player Daemon (MPD)
License:        GPL-2.0+
Group:          Productivity/Multimedia/Sound/Players
Url:            https://code.google.com/p/cantata
Source0:        %{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE  fix-translations-with-qt5.diff  -- Make sure that it finds the right lrelease and lconvert binaries with Qt5
Patch1:         fix-translations-with-qt5.diff
#Source0:        https://github.com/CDrummond/cantata/archive/v%{version}.tar.gz
BuildRequires:  cdparanoia-devel
BuildRequires:  libcddb-devel
%if 0%{?suse_version} > 1320 || 0%{?suse_version} == 1315 && 0%{?is_opensuse}
BuildRequires:  ffmpeg-devel
%endif
BuildRequires:  libmtp-devel
BuildRequires:  libmusicbrainz5-devel
BuildRequires:  libtag-devel
BuildRequires:  speex-devel
BuildRequires:  taglib-extras-devel
BuildRequires:  update-desktop-files
BuildRequires:  gettext-tools
%if %qt5
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Multimedia)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Qml)
BuildRequires:  pkgconfig(Qt5Quick)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5Xml)
BuildRequires:  pkgconfig(Qt5Sql)
BuildRequires:  cmake(Qt5LinguistTools)
%else
BuildRequires:  libkde4-devel
BuildRequires:  libqjson-devel
BuildRequires:  libqt4-devel
%endif
BuildRequires:  pkgconfig(libudev)
BuildRequires:  pkgconfig(udisks2)
BuildRequires:  pkgconfig(zlib)
Suggests:       mpd
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Cantata is a (yet another!) client for the music player daemon (MPD). 
Originally started as a fork of QtMPC, the code is now *very* different. To be 
true to QtMPCs origins, Cantata can be compiled with KDE support, or as a pure 
Qt4 application (however, note that this is not fully tested). The interface 
is very configurable - most views can be shown as either a list or tree 
structure.


%prep
%setup -q
%if %qt5
%patch1 -p1
%endif

%build
%cmake \
      -DENABLE_LIBVLC=OFF \
      -DENABLE_HTTP_STREAM_PLAYBACK=ON \
%if %qt5
      -DENABLE_UDISKS2=OFF \
      -DENABLE_DEVICES_SUPPORT=OFF \
      -DCMAKE_DISABLE_FIND_PROGRAM_MSGFMT=TRUE \
      -DCMAKE_DISABLE_FIND_PROGRAM_GETTEXT_MSGFMT_EXECUTABLE=TRUE \
      -DENABLE_QT5=ON
%else
      -DENABLE_QT5=OFF -DENABLE_KDE=ON
%endif

%make_jobs

%install
  %cmake_install
  %suse_update_desktop_file %{name}

%if !%qt5
  %find_lang %name

%files -f %name.lang
%else
%files
%endif
%defattr(-,root,root,-)
%attr(0755,root,root) %{_bindir}/%{name}
%{_libexecdir}/%{name}/
%{_datadir}/%{name}
%if %qt5
%{_datadir}/applications/%{name}.desktop
%else
%{_datadir}/applications/kde4/%{name}.desktop
%dir %{_datadir}/kde4/apps/solid
%dir %{_datadir}/kde4/apps/solid/actions
%{_datadir}/kde4/apps/solid/actions/cantata-play-audiocd.desktop
%endif
%{_datadir}/icons/hicolor/

%changelog
openSUSE Build Service is sponsored by