-
Notifications
You must be signed in to change notification settings - Fork 29
/
spotify-client.spec
205 lines (173 loc) · 5.91 KB
/
spotify-client.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
#
# spec file for package spotify
#
# Copyright (c) 2012 Marguerite Su, Adam Spiers
#
# 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.
Name: spotify-client
Version: 0.8.8.323.gd143501.250
Release: 1
License: Commercial
Summary: Desktop client for Spotify streaming music service
Url: http://www.spotify.com/download/previews/
Group: Productivity/Multimedia/Sound/Players
%ifarch x86_64
Source0: spotify-client_%{version}-%{release}_amd64.deb
%else
Source0: spotify-client_%{version}-%{release}_i386.deb
%endif
NoSource: 0
%if 0%{?suse_version}
Requires: mozilla-nss
Requires: mozilla-nspr
Requires: libopenssl1_0_0
Requires: libpng12-0
Recommends: libmp3lame0
Recommends: ffmpeg
%endif
# not currently tested on Fedora or Mandriva, but leaving
# these here in case anyone wants to step up and do it :)
%if 0%{?fedora_version}
Requires: nss
Requires: nspr
Requires: openssl >= 1.0.0
%endif
%if 0%{?mandriva_version}
Requires: libnss3
Requires: libnspr4
Requires: libopenssl1.0.0
Conflicts: libopenssl0.9.8
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Spotify is a "Freemium" proprietary, DRM-restricted digital music
service that gives you access to millions of songs.
It includes the following features:
- Custom playlists
- Last.fm integration
- Customized radio dynamically generated to the user's tastes
- Social media integration with Facebook and Twitter
- 3rd-party applications integrated into the client
%prep
%setup -T -c %{name}-%{version}
# unpack deb
ar -x %{SOURCE0}
# unpack data
tar -xzf data.tar.gz
# remove used files
rm {control,data}.tar.gz debian-binary
%define _use_internal_dependency_generator 0
%define __find_requires %_builddir/%{name}-%{version}/find-requires.sh
cat >%__find_requires <<'EOF'
#!/bin/sh
/usr/lib/rpm/find-requires | \
sed -e 's/lib\(nss3\|nssutil3\|smime3\|plc4\|nspr4\)\.so\.[01]d/lib\1.so/
/lib\(crypto\|ssl\)\.so/d'
EOF
chmod +x %__find_requires
%build
# no need to build
%install
mv opt %{buildroot}
%define spotifydir /opt/spotify/spotify-client
%define spotifylibdir %spotifydir/lib
# Fix spotify.desktop file:
# - trailing semi-colon is required for fields with multiple values
# http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#basic-format
desktop=%{buildroot}%{spotifydir}/spotify.desktop
sed -i 's/^\(MimeType=.*\);?$/\1;/i ;
s/^Categories=/Categories=AudioVideo;Music;Player;Jukebox;/' $desktop
# http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros#.25suse_update_desktop_file
# http://en.opensuse.org/openSUSE:Packaging_desktop_menu_categories#Multimedia
#%suse_update_desktop_file $desktop
mkdir -p %{buildroot}%{_docdir}/%{name}
mv usr/share/doc/spotify-client/* %{buildroot}%{_docdir}/%{name}/
cat >%{buildroot}%{_docdir}/%{name}/README <<EOF
This package was built by the openSUSE Spotify installer; see
https://github.com/aspiers/opensuse-spotify-installer
for more information.
EOF
# fix libraries
mkdir -p %{buildroot}%{spotifylibdir}
ln -sf ../libcef.so %{buildroot}%{spotifylibdir}/libcef.so
# install binary wrapper
mkdir -p %{buildroot}%{_bindir}
wrapper="%{buildroot}%{_bindir}/spotify"
cat >"$wrapper" <<'EOF'
#!/bin/sh
if [ -n "$SPOTIFY_CLEAN_CACHE" ]; then
echo
echo -n "Cleaning spotify cache ... "
rm -rf ~/.cache/spotify
echo "done."
fi
cd %{spotifydir}
LD_LIBRARY_PATH=%{spotifylibdir} ./spotify "$@"
EOF
chmod +x "$wrapper"
# link dependencies
mkdir -p %{buildroot}%{_libdir}
ln -sf /%{_lib}/libcrypto.so.1.0.0 %{buildroot}%{spotifylibdir}/libcrypto.so.0.9.8
ln -sf /%{_lib}/libssl.so.1.0.0 %{buildroot}%{spotifylibdir}/libssl.so.0.9.8
libs=(
libnss3.so.1d \
libnssutil3.so.1d \
libsmime3.so.1d \
libplc4.so.0d \
libnspr4.so.0d
)
for lib in "${libs[@]}"; do
ln -sf %{_libdir}/${lib%.[01]d} %{buildroot}%{spotifylibdir}/$lib
done
# 0.8.8 has an errant RPATH which was accidentally left in
# http://community.spotify.com/t5/Desktop-Linux/ANNOUNCE-Spotify-0-8-8-for-GNU-Linux/m-p/238118/highlight/true#M1867
export NO_BRP_CHECK_RPATH=true
%post
/sbin/ldconfig
cd %{spotifydir}
./register.sh
#%desktop_database_post
#%icon_theme_cache_post
%preun
if [ "$1" = 0 ]; then
cd %{spotifydir}
./unregister.sh
fi
%postun
if [ "$1" = 0 ]; then
/sbin/ldconfig
fi
#%desktop_database_postun
#%icon_theme_cache_postun
%files
%defattr(-,root,root)
%spotifydir
%doc %{_docdir}/%{name}
%{_bindir}/spotify
#%{_datadir}/applications/spotify.desktop
%changelog
* Sat Jan 05 2013 Adam Spiers <[email protected]>
- add README
* Sat Jan 05 2013 Adam Spiers <[email protected]>
- update to 0.8.8 (moved to /opt)
- rename to spotify-client for consistency with original Debian package
- use provided register.sh and unregister.sh
- remove need to conflict with libopenssl0_9_8
- fix automatically generated dependencies
- fix XDG categories
- move dedicated library directory to /opt/spotify/spotify-client/lib
- remove spotify-linux-512x512.png since redistribution probably
violates Spotify copyright
- fix SPOTIFY_CLEAN_CACHE test
- fix passing of multiple arguments to spotify binary
* Mon Aug 20 2012 Marguerite Su <[email protected]> - 0.8.4.103.g9cb117b.260
- initial version with Spotify App support.
- use libopenssl1_0_0 instead of libopenssl0_9_8 to fix a crash and other linkings ready.
- use wrapper to clear cache manually