Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

working version on Fedora 31 #57

Open
wants to merge 7 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 9 additions & 71 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,10 @@ 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)")')

lib_to_data := $(shell python3 -c 'import os.path; \
print(os.path.relpath("$(app_datadir)", \
"$(app_libdir)"))')
all: help

lib_to_data:
Expand Down Expand Up @@ -77,75 +65,25 @@ $(archive):
unpack: check_sources
@# Unpack into libdir (arched files) and datadir(noarch).
ar x $(archive)
tar xzf data.tar.gz
tar xf data.tar.*
@rm -rf $(DESTDIR)$(app_libdir) $(DESTDIR)/$(app_datadir)
@mkdir -p $(DESTDIR)$(app_libdir)/Data || :
@mkdir -p $(DESTDIR)$(app_datadir) || :
cp -ar ./usr/share/spotify/* $(DESTDIR)$(app_datadir)
mv $(DESTDIR)$(app_datadir)/libcef.so $(DESTDIR)$(app_libdir)
cp ./usr/bin/spotify $(DESTDIR)$(app_libdir)
tar xzf control.tar.gz
mv control md5sums $(DESTDIR)$(app_datadir)
tar xf control.tar.*
@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)
$$( find $(DESTDIR)$(app_datadir) -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); \
for f in $(DESTDIR)$(app_datadir)/*; do \
ln -sf $(lib_to_data)/$$(basename $$f) . ; \
done

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"; \
Expand All @@ -167,7 +105,7 @@ addons: check_sources
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
install: unpack addons bundled desktop set_so_perms
cp Makefile $(DESTDIR)$(app_datadir)
cp README.md $(DESTDIR)$(app_datadir)

Expand Down Expand Up @@ -202,5 +140,5 @@ uninstall:

clean:
rm -rf $(archive) spotify.bash opt usr
rm -rf control.tar.gz data.tar.gz *.deb debian-binary github
rm -rf control.tar.xz data.tar.xz *.deb debian-binary github
rm -f spotify.desktop Makefile
43 changes: 4 additions & 39 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ fi
echo " ldconfig:... $sts"

echo -n " python: "
sts="$(python --version 2>&1) (ok)" || sts="ERROR: Not found"
sts="$(python3 --version 2>&1) (ok)" || sts="ERROR: Not found"
echo $sts

if [ -z "$package" ]; then
Expand Down Expand Up @@ -158,19 +158,10 @@ echo -n "Determining distro:... "
dist=$(lsb_release -i || echo "Unknown")
dist=$( echo ${dist##*:} )
case "$dist" in
Ubuntu)
echo -n '(LinuxMint handled as)... '
Ubuntu|Debian)
echo -n "($dist handled as Ubuntu)..."
dist='Ubuntu'
;;
Debian)
if [[ "$( lsb_release -r)" == *7.[0-9] ]]; then
echo -n '(Debian 7.0 Wheeze handled as)...'
dist='Ubuntu'
elif [[ "$( lsb_release -r)" == *'unstable' ]]; then
echo -n '(Debian unstable handled as)...'
dist='Ubuntu'
fi
;;
CentOS|RedHat*)
echo -n "($dist handled as RHEL)..."
dist='RHEL'
Expand Down Expand Up @@ -208,32 +199,6 @@ else
fi
echo $version

# Check for openlssl-compatibility package on distros determined as RHEL,
if [ "$dist" = "RHEL" ]; then
# Just to be sure we got what we need,
echo -n "Locating rpm-binary:... "
if command -v rpm &> /dev/null ; then
sts=$(rpm --version)
echo "$sts (ok)"
else
echo -n >&2 "Cannot find rpm-binary. Your installation is seriously "
echo >&2 "broken. Giving up."
exit 2;
fi

# Try to locate the necessary openssl-libraries,
echo -n "Checking for openssl098e-compatibility libraries..."
if [[ -f $(rpm --eval %_libdir/libssl.so.0.9.8e) &&
-f $(rpm --eval %_libdir/libcrypto.so.0.9.8e) ]] ; then
echo "found (ok)"
else
echo >&2 "Could not find necessary openssl098e-compatibility libraries."
echo -n >&2 "Suggestion: Try to install package with 'sudo yum install "
echo >&2 "-y openssl098e'."
exit 2
fi
fi

if [ -z "$package" ]; then
echo -n "Determine .deb file..."
package=$(grep "spotify-client.*$arch.deb" spotify.dir \
Expand Down Expand Up @@ -286,6 +251,6 @@ if [[ "$binary" = my* ]]; then
fi

echo "Writing spotify.bash"
sed -e "/spotify=/s|=.*|=$libdir/spotify-client/spotify|" \
sed -e "/spotify=/s|=.*|=$datadir/spotify-client/spotify|" \
-e "/version=/s|=.*|=$version|" \
<spotify.bash.in >spotify.bash
Binary file removed fedora/amd64/libcrypto.so.1.0.0
Binary file not shown.
1 change: 0 additions & 1 deletion fedora/amd64/libcrypto.so.10

This file was deleted.

Binary file removed fedora/amd64/libgcrypt.so.11
Binary file not shown.
Binary file removed fedora/amd64/libssl.so.1.0.0
Binary file not shown.
1 change: 0 additions & 1 deletion fedora/amd64/libssl.so.10

This file was deleted.

1 change: 0 additions & 1 deletion fedora/amd64/libudev.so.0

This file was deleted.

Binary file removed fedora/amd64/libudev.so.0.13.1
Binary file not shown.
Binary file removed fedora/i386/libcrypto.so.0.9.8
Binary file not shown.
Binary file removed fedora/i386/libgcrypt.so.11
Binary file not shown.
Binary file removed fedora/i386/libssl.so.0.9.8
Binary file not shown.
1 change: 0 additions & 1 deletion fedora/i386/libudev.so.0

This file was deleted.

Binary file removed fedora/i386/libudev.so.0.13.1
Binary file not shown.
Binary file removed mageia2/amd64/libQtDBus.so.4.8.1
Binary file not shown.
Loading