File spotify-client.spec of Package spotify-client
Name: spotify-client
Version: 1.2.74.477.g3be53afe
Release: 0
Summary: Spotify streaming music client
License: https://www.spotify.com/legal/end-user-agreement
URL: https://www.spotify.com
Vendor: Spotify AB
ExclusiveArch: x86_64
Source0: spotify-client.snap
BuildRequires: hicolor-icon-theme
BuildRequires: squashfs
BuildRequires: update-desktop-files
Requires: hicolor-icon-theme
Requires: xdg-utils
Requires(post): gtk3-tools
Requires(postun): gtk3-tools
Recommends: libavcodec.so
Recommends: libavformat.so
Suggests: libnotify4
%description
The Spotify desktop client officially supports Linux, but only Debian and
Ubuntu snap. This is an unofficial openSUSE re-packaging of the official
snap package. You can use it without snapd and dependent downloads.
If you are having severe problems with the native Linux client, there are a
few alternatives that you can try:
- Use the official snap (requires snapd is available in the openSUSE Build
Service).
- Using the web player: https://play.spotify.com/
- Running the native Windows client in Wine (not recommended, but should
work)
Otherwise, the native Linux client is the recommended way to listen to
Spotify on Linux systems.
%prep
%setup -q -c -T
unsquashfs -d spotify-snap %{SOURCE0}
mkdir -p spotify-root/usr/{bin,%{_lib}} spotify-root%{_datadir}/applications
mv spotify-snap/usr/share/spotify spotify-root/usr/%{_lib}/spotify
mv spotify-snap/usr/bin/spotify spotify-root/usr/bin
cat > spotify-root%{_datadir}/applications/spotify.desktop <<'EOF'
[Desktop Entry]
Name=Spotify
GenericName=Music Player
Comment=Spotify streaming music client
Icon=spotify-client
Exec=spotify %U
TryExec=spotify
Terminal=false
Type=Application
Categories=Audio;Music;Player;AudioVideo;Qt;
MimeType=x-scheme-handler/spotify
EOF
%install
mkdir -p %{buildroot}%{_prefix}
cp -a spotify-root/usr %{buildroot}/
# Recreate symlink to ensure it points to the new location
ln -sf ../%{_lib}/spotify/spotify %{buildroot}%{_bindir}/spotify
for ICON in %{buildroot}%{_libdir}/spotify/icons/*.png ; do
FN=$(basename "$ICON")
SIZE=$(echo "$ICON" | sed 's/.*\/spotify-linux-\([0-9]*\)\.png$/\1/')
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${SIZE}x${SIZE}/apps
ln -s ../../../../../%{_lib}/spotify/icons/$FN %{buildroot}%{_datadir}/icons/hicolor/${SIZE}x${SIZE}/apps/spotify-client.png
done
%post
%desktop_database_post
if [ -f "%{_datadir}/icons/hicolor/index.theme" ]; then
%{_bindir}/gtk-update-icon-cache --quiet --force "%{_datadir}/icons/hicolor"
fi
%postun
%desktop_database_postun
if [ -f "%{_datadir}/icons/hicolor/index.theme" ]; then
%{_bindir}/gtk-update-icon-cache --quiet --force "%{_datadir}/icons/hicolor"
fi
%files
%defattr(-,root,root)
%{_datadir}/icons/hicolor/*/apps/spotify-client.png
%{_libdir}/spotify
%{_datadir}/applications/spotify.desktop
%{_bindir}/spotify
%changelog