clementine/clementine.spec
2018-11-03 21:16:20 +01:00

156 lines
5.3 KiB
RPMSpec

######################
# Hardcode PLF build
%bcond_with plf
######################
%if %{with plf}
# make EVR of plf build higher than regular to allow update, needed with rpm5 mkrel
%define extrarelsuffix plf
%endif
%define gstapi 1.0
%define oname Clementine
# The last official release was in April 2016, but in the devel tree
# there are commits as recents as August 2018: let's build a devel snapshot
# to pick up a boatload of changes and fixes
%define gitdate 20180812
Summary: A cross-platform music player based on Amarok 1.4
Name: clementine
Version: 1.3.2
Release: 0.%{gitdate}.1%{?extrarelsuffix}
License: GPLv3+
Group: Sound
Url: http://www.clementine-player.org/
#Source0: https://github.com/clementine-player/Clementine/archive/%%{oname}-%%{version}.tar.gz
Source0: %{name}-%{gitdate}.tar.xz
Source1: %{oname}.conf
Source100: %{name}.rpmlintrc
# The sources version is still 1.3.1: fake a new one...
Patch0: clementine-fake-new-version.patch
Patch1: clementine-1.3.2-use-system-libmygpo_qt.patch
# Search albums at metal-archives.com (Encyclopaedia Metallum) from:
# - Now Playing widget (album art context menu) - current album
# - Playlist (selected songs context menu) - unique selected albums
Patch2: clementine-1.3.2-metalarchives.patch
Patch3: clementine-1.3.2-desktop-initial-pref.patch
# Localization issues
Patch4: clementine-1.3.2-fix-l10n-issues.patch
Patch5: clementine-1.3.2-desktop-add-play-folder.patch
# RockRadio.com has Premium access for long time already
# It's especially important to fix after free access to DI.fm services was disabled in
# https://github.com/clementine-player/Clementine/commit/3ab20defce71a009bf180255642c18fa671650f9
Patch6: clementine-1.3.2-rockradio-premium.patch
Patch7: clementine-1.3.1-sqlite-3.12.patch
# Our gxx does not know a thing about no-unknown-warning-option
# and no-unused-private-field
Patch8: clementine-1.3.2-fix-unkwnon-gcc-commands.patch
BuildRequires: cmake
BuildRequires: gettext
BuildRequires: qt4-linguist
BuildRequires: boost-devel
BuildRequires: fftw3-devel
BuildRequires: liblastfm-devel
BuildRequires: qt4-devel >= 4.8.1
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(cryptopp)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(glew)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(glu)
BuildRequires: pkgconfig(gstreamer-%{gstapi})
BuildRequires: pkgconfig(gstreamer-app-%{gstapi})
BuildRequires: pkgconfig(gstreamer-audio-%{gstapi})
BuildRequires: pkgconfig(gstreamer-base-%{gstapi})
BuildRequires: pkgconfig(gstreamer-tag-%{gstapi})
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libcdio)
BuildRequires: pkgconfig(libchromaprint) >= 1.4
BuildRequires: pkgconfig(libgpod-1.0) >= 0.7.92
BuildRequires: pkgconfig(libmtp) >= 1.0
BuildRequires: pkgconfig(libmygpo-qt)
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(protobuf)
BuildRequires: pkgconfig(QJson)
# For Google Drive and Amazon Cloud integration
BuildRequires: pkgconfig(libsparsehash)
%if %{with plf}
BuildRequires: pkgconfig(libspotify) >= 12.1.45
BuildRequires: protobuf-static-devel
%endif
BuildRequires: pkgconfig(taglib) >= 1.8
BuildRequires: pkgconfig(x11)
Requires: libprojectm-data
Requires: qt4-database-plugin-sqlite
Requires: gstreamer%{gstapi}-flac
Requires: gstreamer%{gstapi}-plugins-ugly
Suggests: gstreamer%{gstapi}-decoders-audio
Suggests: gstreamer%{gstapi}-faac
Suggests: gstreamer%{gstapi}-faad
Suggests: gstreamer%{gstapi}-lame
# Needed to be able to mount ipod/iphone/ipad (not tested locally) but it's also pulling gvfs
# which is need at least to mount mtp devices (tested locally)
Suggests: gvfs-iphone
%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
Qt4.
Features:
* Search and play your local music library.
* Listen to internet radio from Last.fm, SomaFM and Magnatune.
* Tabbed playlists, import and export M3U, XSPF, PLS and ASX.
* Visualisations from projectM.
* Transcode music into MP3, Ogg Vorbis, Ogg Speex, FLAC or AAC.
* Edit tags on MP3 and OGG files, organize your music.
* Download missing album cover art from Last.fm.
* Remote control using a Wii Remote, MPRIS or the command-line.
* Copy music to your iPod, iPhone, MTP or mass-storage USB player.
* Queue manage.
%files
%doc Changelog COPYING README.md
%config(noreplace) %{_sysconfdir}/%{oname}/%{oname}.conf
%{_bindir}/%{name}
%{_bindir}/%{name}-tagreader
%if %{with plf}
%{_bindir}/%{name}-spotifyblob
%endif
%{_datadir}/kde4/services/%{name}-*.protocol
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_iconsdir}/hicolor/*/apps/%{name}.*
#----------------------------------------------------------------------------
%prep
%setup -qn %{name}-%{gitdate}
%apply_patches
# Fix perms
find . -name "*.hpp" -o -name "*.h" -o -name ".cpp" |xargs chmod 0644
%build
%cmake_qt4 \
-DBUNDLE_PROJECTM_PRESETS=OFF \
-DBUILD_WERROR=OFF
%make VERBOSE=1
%install
%makeinstall_std -C build
install -m 644 -D %{SOURCE1} %{buildroot}%{_sysconfdir}/%{oname}/%{oname}.conf
%if %{with plf}
# Ugly hack, not sure why those directory trees appear
rm -rf %{buildroot}/tmp/*
rm -rf %{buildroot}/build/spotify/*
rm -rf %{buildroot}/builddir/build/BUILD/clementine-20180812/build/spotify/*/blob
%endif