This repository has been archived by the owner on Feb 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile.in
205 lines (179 loc) · 7.97 KB
/
Makefile.in
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
# Makefile is generated from Makefile.in by configure
# Don't edit Makefile, your changes will be lost.
SHELL := /bin/bash
help_msg = \
Plain 'make' doesn't do anything. Targets: \n\
- download: Download all sources \n\
- install: Install, possibly using DESTDIR to define location. \n\
- register: Notify system about new desktop icons etc. \n\
- uninstall: Remove everything installed.
PATH = @path@
dist = @dist@
arch = @arch@
archlib = @archlib@
binary = @binary@
repo = http://repository.spotify.com/pool/non-free/s/spotify
version = @version@
archive = @archive@
so_perms = @so_perms@
prefix = @prefix@
libdir = @libdir@
datadir = @datadir@
bindir = @bindir@
mandir = @mandir@
app_libdir = $(libdir)/spotify-client
app_datadir = $(datadir)/spotify-client
DOCS =
SOURCES = spotify.bash spotify.1 spotify.desktop $(archive)
ifeq ($(dist),Fedora)
SOURCES += $(wildcard fedora/$(arch)/*.so.*)
else ifeq ($(dist),Ubuntu)
SOURCES += $(wildcard ubuntu/$(arch)/*.so.*)
DOCS += $(wildcard ubuntu/$(arch)/*)
else ifeq ($(dist),Mageia)
SOURCES += $(wildcard mageia2/$(arch)/*.so.*)
DOCS += $(wildcard mageia2/doc/*)
else ifeq ($(dist),RHEL)
SOURCES += $(wildcard rhel/$(arch)/*)
DOCS += $(wildcard rhel/doc/*)
endif
lib_to_data := $(shell python -c 'import os.path; \
print os.path.relpath("$(app_datadir)", \
"$(app_libdir)")')
all: help
help:
@echo -e "\n$(help_msg)\n"
download: $(archive)
@# Download all platform sources
download-all: download
@# Download all architectures.
tarball=$(archive); \
[[ $$tarball = *386* ]] && \
other=$${tarball/i386/amd64} || other=$${tarball/amd64/i386}; \
wget -Nq $(repo)/$$other
check_sources:
@test -f $(archive) || { \
echo "$(archive) not available (try 'make download')"; \
exit 1; \
}
$(archive):
wget -Nq -O $@ $(repo)/$@
unpack: check_sources
@# Unpack into libdir (arched files) and datadir(noarch).
ar x $(archive)
tar xpf data.tar.xz
@rm -rf $(DESTDIR)$(app_libdir) $(DESTDIR)/$(app_datadir)
@mkdir -p $(DESTDIR)$(app_libdir)/Data || :
@mkdir -p $(DESTDIR)$(app_datadir) || :
cp -ar ./opt/spotify/spotify-client/* $(DESTDIR)$(app_datadir)
mv $(DESTDIR)$(app_datadir)/Data/libcef.so $(DESTDIR)$(app_libdir)
mv $(DESTDIR)$(app_datadir)/Data/SpotifyHelper $(DESTDIR)$(app_libdir)/Data
mv $(DESTDIR)$(app_datadir)/spotify $(DESTDIR)$(app_libdir)
tar xzf control.tar.gz
mv control md5sums $(DESTDIR)$(app_datadir)
@rm -f prerm postinst
set_so_perms: unpack
@# Set so files perms to 755 (e. g, fedora) or 644 (e. g. debian).
chmod $(so_perms) \
$$( find $(DESTDIR)$(app_libdir) -name '*.so*' -writable)
bundled: check_sources unpack
[ -n "$(DOCS)" ] && cp -a $(DOCS) $(DESTDIR)$(app_datadir) || :
ifeq ($(dist),Fedora)
cp -a fedora/$(arch)/*.so.* $(DESTDIR)$(app_libdir)
else ifeq ($(dist),Ubuntu)
cp -a ubuntu/$(arch)/libssl.so.0.9.8 $(DESTDIR)$(app_libdir)
cp -a ubuntu/$(arch)/libcrypto.so.0.9.8 $(DESTDIR)$(app_libdir)
else ifeq ($(dist),Mageia)
cp -a mageia2/$(arch)/libQtDBus.so.4.8.1 $(DESTDIR)$(app_libdir)
else ifeq ($(dist),RHEL)
cp -ra rhel/$(arch)/* $(DESTDIR)$(app_libdir)
endif
applinks: unpack
@# Add links to datadir in libdir (where things are searched for).
cd $(DESTDIR)$(app_libdir)/Data; \
for f in $(DESTDIR)$(app_datadir)/Data/*; do \
ln -s ../$(lib_to_data)/Data/$$(basename $$f) . ; \
done
ln -s $(lib_to_data)/licenses.xhtml $(DESTDIR)$(app_libdir)
appdata:
mkdir -p $(DESTDIR)$(datadir)/appdata || echo '(ignored)'
cp appdata.xml $(DESTDIR)$(datadir)/appdata/spotify.xml
syslinks: unpack bundled
@# Match unresolved references found using ldd with system libs
@# in linker cache found using ldconfig -p. Create links and
@# report. If distro is RHEL handle linkage to libssl/libcrypto
@# separately against openssl098e-compatibility libs.
@cd $(DESTDIR)$(app_libdir); \
hostlink_libssl='libssl.so.1.*0.*'; \
hostlink_libcrypto='libcrypto.so.1.*0.*'; \
if [[ "$(dist)" == "RHEL" ]]; then \
hostlink_libssl='libssl.so.6'; \
hostlink_libcrypto='libcrypto.so.6'; \
fi; \
for dep in $$( ldd spotify | awk '/found$$/ {print $$1}' ); do \
case $$dep in \
libssl*) hostlink="$$hostlink_libssl" ;; \
libcrypto*) hostlink="$$hostlink_libcrypto" ;; \
libudev*) hostlink='libudev.so.1.*.*' ;; \
*) hostlink="$${dep%%.*}" ;; \
esac; \
hostlink=$$( ldconfig -p | grep $$hostlink | sed 's/.*=>//' \
| egrep -m1 '$(archlib)' || :); \
if test "$$hostlink" != ''; then \
ln -sf $$hostlink $$dep; \
echo INFO: "resolving $$dep as \"$$hostlink\""; \
else \
echo "WARNING; cant resolve spotify dependency: $$dep" ; \
fi \
done || :
desktop: unpack check_sources appdata
@# Install icons, desktop file etc.
@icondir="$(DESTDIR)$(datadir)/icons/hicolor"; \
src_icons="$(DESTDIR)$(app_datadir)/Icons"; \
echo "Installing icons in $$icondir"; \
for size in 24 32 48 64 128 256; do \
install -m 644 -pD $$src_icons/spotify-linux-$$size.png \
$$icondir/$${size}x$${size}/apps/spotify-client.png; \
done
[ -d $(DESTDIR)$(datadir)/applications ] || \
mkdir $(DESTDIR)$(datadir)/applications
desktop-file-install --dir $(DESTDIR)$(datadir)/applications \
spotify.desktop
[ "$(dist)" = 'Ubuntu' ] && chmod 755 \
$(DESTDIR)$(datadir)/applications/spotify.desktop || :
addons: check_sources
@# Manpage and wrapper script
install -m 755 -pD spotify.bash $(DESTDIR)$(bindir)/$(binary)
install -m 644 -pD spotify.1 $(DESTDIR)$(mandir)/man1/$(binary).1
install: applinks syslinks unpack addons bundled desktop set_so_perms
cp Makefile $(DESTDIR)$(app_datadir)
cp README.md $(DESTDIR)$(app_datadir)
check-deps:
@deps=$$( ldd $(DESTDIR)$(app_libdir)/spotify-bin \
| grep 'not.*found' ); \
if [ -z "$$deps" ]; then \
echo "OK"; \
exit 0; \
else \
echo "Error: unresolved dependencies"; echo $$deps; \
exit 1; \
fi
register:
@# Register icons and check desktop file. Not done by default, makes
@# no sense for a temporary install e. g., when packaging.
-gtk-update-icon-cache --ignore-theme-index \
$(DESTDIR)$(datadir)/icons/hicolor
-desktop-file-validate \
$(DESTDIR)$(datadir)/applications/spotify.desktop
-update-desktop-database $(DESTDIR)$(datadir)/applications
uninstall:
rm -rf $(DESTDIR)$(app_datadir)
rm -rf $(DESTDIR)$(app_libdir)
rm -f $(DESTDIR)$(bindir)/spotify
rm -f $(DESTDIR)$(datadir)/icons/hicolor/*/apps/spotify-client.png
rm -f $(DESTDIR)$(mandir)/man1/spotify.1
rm -f $(DESTDIR)$(datadir)/applications/spotify.desktop
clean:
rm -rf $(archive) spotify.bash opt usr
rm -rf control.tar.gz data.tar.xz *.deb debian-binary github
rm -f spotify.desktop Makefile