File spotify-client.spec of Package spotify-client
#
# spec file for package spotify-client
#
#
# 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/
#
# Remove bundled libraries from requirements/provides
%global __requires_exclude ^(libcef\\.so.*|libwidevinecdm.*\\.so.*|libEGL\\.so.*|libGLESv2\\.so.*|libcurl-gnutls\\.so\\..*)$
%global __provides_exclude ^(lib.*\\.so.*)$
# If firewalld macro is not defined, define it here:
%{!?firewalld_reload:%global firewalld_reload test -f /usr/bin/firewall-cmd && firewall-cmd --reload --quiet || :}
%global debug_package %{nil}
%global __strip /bin/true
Name: spotify-client
Summary: Spotify music player native client
Version: 1.1.55.498.gf9a83c60
Release: 0
License: https://www.spotify.com/legal/end-user-agreement
Group: Productivity/Multimedia/Sound/Players
URL: http://www.spotify.com/
ExclusiveArch: x86_64 %{ix86}
Source0: http://repository.spotify.com/pool/non-free/s/%{name}/%{name}_%{version}_amd64.deb
Source2: spotify-wrapper
Source3: spotify.xml
Source4: spotify.appdata.xml
Source5: spotify.protocol
Source6: spotifywm-master.tar.gz
Source10: README.SUSE
BuildRequires: chrpath
BuildRequires: desktop-file-utils
BuildRequires: appstream-glib
BuildRequires: hicolor-icon-theme
BuildRequires: firewalld
BuildRequires: firewall-macros
BuildRequires: libglvnd
BuildRequires: libX11-devel
BuildRequires: gcc-c++
BuildRequires: freetype2-devel
Requires: gconf2
Requires: libnotify-tools
Requires: zenity
Requires: mozilla-nss
Requires: mozilla-nspr
Requires: libopenssl1_0_0
Requires: libpng12-0
Requires: noto-sans-fonts
Recommends: libmp3lame0
Provides: spotify = %{version}-%{release}
Suggests: spotify-ffmpeg
Suggests: spotify-curl
%description
Think of Spotify as your new music collection. Your library. Only this time your
collection is vast: millions of tracks and counting. Spotify comes in all shapes
and sizes, available for your PC, Mac, home audio system and mobile phone.
Wherever you go, your music follows you. And because the music plays live,
there’s no need to wait for downloads and no big dent in your hard drive.
%prep
%setup -q -c -T
ar x %{SOURCE0}
tar -xzf data.tar.gz
chrpath -d .%{_datadir}/spotify/spotify
cp %{SOURCE10} .
%build
export CC=gcc
export CXX=g++
tar -xzf %{SOURCE6}
cd spotifywm-master
make %{?_smp_mflags}
%install
mkdir -p %{buildroot}%{_libdir}/%{name}
# Program resources - 512x512 icon along main executable is needed by the client
cp -frp \
.%{_datadir}/spotify/*.{pak,dat,bin} \
.%{_datadir}/spotify/{Apps,locales} \
%{buildroot}%{_libdir}/%{name}
install -p -D -m 644 .%{_datadir}/spotify/icons/spotify-linux-512.png \
%{buildroot}%{_libdir}/%{name}/icons/spotify-linux-512.png
# Binaries
install -p -m 755 \
.%{_datadir}/spotify/*.so \
.%{_datadir}/spotify/spotify \
%{buildroot}%{_libdir}/%{name}/
# Wrapper script
mkdir -p %{buildroot}%{_bindir}
cat %{SOURCE2} | sed -e 's|INSTALL_DIR|%{_libdir}/%{name}|g' \
> %{buildroot}%{_bindir}/spotify
chmod +x %{buildroot}%{_bindir}/spotify
# Desktop file
install -m 0644 -D -p .%{_datadir}/spotify/spotify.desktop \
%{buildroot}%{_datadir}/applications/spotify.desktop
desktop-file-validate %{buildroot}%{_datadir}/applications/spotify.desktop
# Icons
for size in 16 22 24 32 48 64 128 256 512; do
install -p -D -m 644 .%{_datadir}/spotify/icons/spotify-linux-${size}.png \
%{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/apps/%{name}.png
done
# Firewalld rules
install -D -m 644 -p %{SOURCE3} \
%{buildroot}/usr/lib/firewalld/services/spotify.xml
mkdir -p %{buildroot}%{_datadir}/appdata
install -p -m 0644 %{SOURCE4} %{buildroot}%{_datadir}/appdata/
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/spotify.appdata.xml
# Copy protocol file for KDE
mkdir -p %{buildroot}%{_datadir}/kservices5
install -D -m 644 -p %{SOURCE5} %{buildroot}%{_datadir}/kservices5/spotify.protocol
# Set kwin fix patch
mkdir -p %{buildroot}%{_libdir}/%{name}
rm -f spotifywm.so-%{version}-*.x86_64.debug
install -D -m 644 -p spotifywm-master/spotifywm.so %{buildroot}%{_libdir}/%{name}/spotifywm.so
%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%firewalld_reload
%postun
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
%{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%posttrans
%{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files
%doc README.SUSE
%{_bindir}/spotify
%{_datadir}/applications/spotify.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/appdata/spotify.appdata.xml
%{_datadir}/kservices5
%{_datadir}/kservices5/spotify.protocol
%dir %{_libdir}/%{name}
%{_libdir}/%{name}
%{_libdir}/%{name}/spotifywm.so
/usr/lib/firewalld/services/spotify.xml
%changelog