From a24c76a82deb602ced65e0fa23b0a08768151b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20M=C3=BChlinghaus?= Date: Mon, 19 Jan 2015 21:51:40 +0100 Subject: [PATCH 1/4] New package: spotify-0.9_1 --- srcpkgs/spotify/files/spotify | 2 + srcpkgs/spotify/template | 73 +++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 srcpkgs/spotify/files/spotify create mode 100644 srcpkgs/spotify/template diff --git a/srcpkgs/spotify/files/spotify b/srcpkgs/spotify/files/spotify new file mode 100644 index 00000000000..524fe5c9b42 --- /dev/null +++ b/srcpkgs/spotify/files/spotify @@ -0,0 +1,2 @@ +#!/bin/sh +LD_LIBRARY_PATH=/usr/share/spotify/libs exec /usr/share/spotify/spotify-client/spotify "$@" diff --git a/srcpkgs/spotify/template b/srcpkgs/spotify/template new file mode 100644 index 00000000000..a6195b2c5dd --- /dev/null +++ b/srcpkgs/spotify/template @@ -0,0 +1,73 @@ +# Template build file for 'spotify'. +pkgname=spotify +version=0.9 +revision=1 +short_desc="Proprietary music streaming client" +maintainer="Stefan Mühlinghaus " +homepage="https://www.spotify.com" +license="Proprietary" +create_wrksrc=1 +allow_unknown_shlibs=1 +only_for_archs="x86_64 i686" +repository=nonfree +build_style=fetch +makedepends="libgpg-error-devel" + +if test "${XBPS_TARGET_MACHINE}" = "x86_64"; then + _sversion=".11.27.g2b1a638.81-1_amd64" + _schecksum="4f93776cac562f622e635c64fa61ee46cb9bdfbda0a2aff0905acf007894d479" +else + _sversion=".4.183.g644e24e.428-1_i386" + _schecksum="ca45d057357e4c30efee3838dd941222500463ddd0a1db6981e4d48d7ad986f2" + depends="nss" +fi + +distfiles="http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}${_sversion}.deb + ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.5.4.tar.bz2" +checksum="${_schecksum} + d5f88d9f41a46953dc250cdb8575129b37ee2208401b7fa338c897f667c7fb33" + +do_extract() { + local _srcpath="${XBPS_SRCDISTDIR}/spotify-${version}" + ar x "${_srcpath}/spotify-client_${version}${_sversion}.deb" + tar xzf data.tar.gz + tar xjf "${_srcpath}/libgcrypt-1.5.4.tar.bz2" +} + +do_build() { + cd libgcrypt-1.5.4 + ./configure ${configure_args} + make +} + +do_install() { + vbin "${FILESDIR}/spotify" + vlicense usr/share/doc/spotify-client/copyright + vmkdir usr/share + vcopy opt/spotify usr/share + + vmkdir usr/share/applications + ln -sf /usr/share/spotify/spotify-client/spotify.desktop "${DESTDIR}/usr/share/applications/spotify.desktop" + + for _s in 16 22 24 32 48 64 128 256 512; do + vmkdir "usr/share/icons/hicolor/${_s}x${_s}/apps" + ln -sf "/usr/share/spotify/spotify-client/Icons/spotify-linux-${_s}.png" "${DESTDIR}/usr/share/icons/hicolor/${_s}x${_s}/apps/spotify.png" + done + + vmkdir usr/share/spotify/libs + vinstall libgcrypt-1.5.4/src/.libs/libgcrypt.so.11.8.3 755 usr/share/spotify/libs libgcrypt.so.11 + if test "${XBPS_TARGET_MACHINE}" = "x86_64"; then + ln -sf /usr/lib/libssl.so.29 "${DESTDIR}/usr/share/spotify/libs/libssl.so.1.0.0" + ln -sf /usr/lib/libcrypto.so.30 "${DESTDIR}/usr/share/spotify/libs/libcrypto.so.1.0.0" + ln -sf /usr/lib/libudev.so.1 "${DESTDIR}/usr/share/spotify/libs/libudev.so.0" + else + ln -sf /usr/lib/libssl.so.29 "${DESTDIR}/usr/share/spotify/libs/libssl.so.0.9.8" + ln -sf /usr/lib/libcrypto.so.30 "${DESTDIR}/usr/share/spotify/libs/libcrypto.so.0.9.8" + ln -sf /usr/lib/libnss3.so "${DESTDIR}/usr/share/spotify/libs/libnss3.so.1d" + ln -sf /usr/lib/libnssutil3.so "${DESTDIR}/usr/share/spotify/libs/libnssutil3.so.1d" + ln -sf /usr/lib/libsmime3.so "${DESTDIR}/usr/share/spotify/libs/libsmime3.so.1d" + ln -sf /usr/lib/libplc4.so "${DESTDIR}/usr/share/spotify/libs/libplc4.so.0d" + ln -sf /usr/lib/libnspr4.so "${DESTDIR}/usr/share/spotify/libs/libnspr4.so.0d" + ln -sf /usr/lib/libudev.so.1 "${DESTDIR}/usr/share/spotify/libs/libudev.so.0" + fi +} From 9cd19e157fe03e0a3fcdbad724e7f08bcebbd998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20M=C3=BChlinghaus?= Date: Tue, 20 Jan 2015 21:10:14 +0100 Subject: [PATCH 2/4] spotify: Added update-check info --- srcpkgs/spotify/update | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 srcpkgs/spotify/update diff --git a/srcpkgs/spotify/update b/srcpkgs/spotify/update new file mode 100644 index 00000000000..50604f8c5cc --- /dev/null +++ b/srcpkgs/spotify/update @@ -0,0 +1,9 @@ +site="http://repository.spotify.com/pool/non-free/s/spotify/" +version="${version}${_sversion}" +pattern='>spotify-client_\K.+(?=\.deb<)' + +if test "${XBPS_TARGET_MACHINE}" = "x86_64"; then + ignore="*_i386*" +else + ignore="*_amd64*" +fi From 930ea4465d09e4564cb0500a7416bad05402b5db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20M=C3=BChlinghaus?= Date: Thu, 22 Jan 2015 00:34:14 +0100 Subject: [PATCH 3/4] spotify: Fetch binaries at install-time --- srcpkgs/spotify/INSTALL | 54 ++++++++++++++++++++++++++++++++++++++++ srcpkgs/spotify/REMOVE | 12 +++++++++ srcpkgs/spotify/template | 48 +++++++---------------------------- 3 files changed, 75 insertions(+), 39 deletions(-) create mode 100644 srcpkgs/spotify/INSTALL create mode 100644 srcpkgs/spotify/REMOVE diff --git a/srcpkgs/spotify/INSTALL b/srcpkgs/spotify/INSTALL new file mode 100644 index 00000000000..3bbc8abdb20 --- /dev/null +++ b/srcpkgs/spotify/INSTALL @@ -0,0 +1,54 @@ +# INSTALL for 'spotify' +# Fetching proprietary binaries at install-time + +_BUILDDIR="/tmp/spotify.build" +_LIBS=$(ldconfig -vNX -n /usr/lib 2>/dev/null) + +linklib() { + _LIB=$(echo "$_LIBS" | grep "${1}\.so" | sed 's/\s*\([^ ]*\).*$/\1/') + ln -s "/usr/lib/${_LIB}" "/usr/share/spotify/libs/${1}.so.${2}" +} + +if test "$ACTION" = "post"; then + . /usr/share/spotify/pkgdata + mkdir -p "$_BUILDDIR" + ( + cd "$_BUILDDIR" + xbps-uhelper fetch "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${SVERSION}.deb" + echo "${SCHECKSUM} spotify-client_${SVERSION}.deb" >checksum + sha256sum -c checksum || exit 1 + ar x "spotify-client_${SVERSION}.deb" + tar xzf data.tar.gz 2>/dev/null + ) || { + echo Error while extracting; + rm -r "$_BUILDDIR"; + exit 1; + } + mkdir -p /usr/share/licenses/spotify + mv "${_BUILDDIR}/usr/share/doc/spotify-client/copyright" /usr/share/licenses/spotify/ + mv "${_BUILDDIR}/opt/spotify/spotify-client" /usr/share/spotify/spotify-client + for _s in 16 22 24 32 48 64 128 256 512; do + mkdir -p "/usr/share/icons/hicolor/${_s}x${_s}/apps" + ln -s "/usr/share/spotify/spotify-client/Icons/spotify-linux-${_s}.png" "/usr/share/icons/hicolor/${_s}x${_s}/apps/spotify.png" + done + mkdir -p /usr/share/applications + ln -s /usr/share/spotify/spotify-client/spotify.desktop /usr/share/applications/spotify.desktop + + if test "$ARCH" = "x86_64"; then + linklib "libssl" "1.0.0" + linklib "libcrypto" "1.0.0" + linklib "libudev" "0" + else + linklib "libssl" "0.9.8" + linklib "libcrypto" "0.9.8" + linklib "libnss3" "1d" + linklib "libnssutil3" "1d" + linklib "libsmime3" "1d" + linklib "libplc4" "0d" + linklib "libnspr4" "0d" + linklib "libudev" "0" + fi + + rm -r "$_BUILDDIR" +fi + diff --git a/srcpkgs/spotify/REMOVE b/srcpkgs/spotify/REMOVE new file mode 100644 index 00000000000..296749a7441 --- /dev/null +++ b/srcpkgs/spotify/REMOVE @@ -0,0 +1,12 @@ +# REMOVE for 'spotify' +# Deleting dynamically fetched files + +if test "$ACTION" = "post"; then + rm -r /usr/share/licenses/spotify + rm /usr/share/applications/spotify.desktop + for _s in 16 22 24 32 48 64 128 256 512; do + rm "/usr/share/icons/hicolor/${_s}x${_s}/apps/spotify.png" + done + rm -r /usr/share/spotify +fi + diff --git a/srcpkgs/spotify/template b/srcpkgs/spotify/template index a6195b2c5dd..2c10471fb9b 100644 --- a/srcpkgs/spotify/template +++ b/srcpkgs/spotify/template @@ -1,37 +1,31 @@ # Template build file for 'spotify'. pkgname=spotify version=0.9 -revision=1 +revision=2 short_desc="Proprietary music streaming client" maintainer="Stefan Mühlinghaus " homepage="https://www.spotify.com" license="Proprietary" create_wrksrc=1 -allow_unknown_shlibs=1 only_for_archs="x86_64 i686" repository=nonfree build_style=fetch makedepends="libgpg-error-devel" +distfiles="ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.5.4.tar.bz2" +checksum="d5f88d9f41a46953dc250cdb8575129b37ee2208401b7fa338c897f667c7fb33" +depends="binutils qt gtk+ nss GConf libXScrnSaver" if test "${XBPS_TARGET_MACHINE}" = "x86_64"; then _sversion=".11.27.g2b1a638.81-1_amd64" _schecksum="4f93776cac562f622e635c64fa61ee46cb9bdfbda0a2aff0905acf007894d479" + depends+=" pango-xft" else _sversion=".4.183.g644e24e.428-1_i386" _schecksum="ca45d057357e4c30efee3838dd941222500463ddd0a1db6981e4d48d7ad986f2" - depends="nss" fi -distfiles="http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}${_sversion}.deb - ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.5.4.tar.bz2" -checksum="${_schecksum} - d5f88d9f41a46953dc250cdb8575129b37ee2208401b7fa338c897f667c7fb33" - do_extract() { - local _srcpath="${XBPS_SRCDISTDIR}/spotify-${version}" - ar x "${_srcpath}/spotify-client_${version}${_sversion}.deb" - tar xzf data.tar.gz - tar xjf "${_srcpath}/libgcrypt-1.5.4.tar.bz2" + tar xjf "${XBPS_SRCDISTDIR}/spotify-${version}/libgcrypt-1.5.4.tar.bz2" } do_build() { @@ -41,33 +35,9 @@ do_build() { } do_install() { - vbin "${FILESDIR}/spotify" - vlicense usr/share/doc/spotify-client/copyright - vmkdir usr/share - vcopy opt/spotify usr/share - - vmkdir usr/share/applications - ln -sf /usr/share/spotify/spotify-client/spotify.desktop "${DESTDIR}/usr/share/applications/spotify.desktop" - - for _s in 16 22 24 32 48 64 128 256 512; do - vmkdir "usr/share/icons/hicolor/${_s}x${_s}/apps" - ln -sf "/usr/share/spotify/spotify-client/Icons/spotify-linux-${_s}.png" "${DESTDIR}/usr/share/icons/hicolor/${_s}x${_s}/apps/spotify.png" - done - + vbin ${FILESDIR}/spotify vmkdir usr/share/spotify/libs vinstall libgcrypt-1.5.4/src/.libs/libgcrypt.so.11.8.3 755 usr/share/spotify/libs libgcrypt.so.11 - if test "${XBPS_TARGET_MACHINE}" = "x86_64"; then - ln -sf /usr/lib/libssl.so.29 "${DESTDIR}/usr/share/spotify/libs/libssl.so.1.0.0" - ln -sf /usr/lib/libcrypto.so.30 "${DESTDIR}/usr/share/spotify/libs/libcrypto.so.1.0.0" - ln -sf /usr/lib/libudev.so.1 "${DESTDIR}/usr/share/spotify/libs/libudev.so.0" - else - ln -sf /usr/lib/libssl.so.29 "${DESTDIR}/usr/share/spotify/libs/libssl.so.0.9.8" - ln -sf /usr/lib/libcrypto.so.30 "${DESTDIR}/usr/share/spotify/libs/libcrypto.so.0.9.8" - ln -sf /usr/lib/libnss3.so "${DESTDIR}/usr/share/spotify/libs/libnss3.so.1d" - ln -sf /usr/lib/libnssutil3.so "${DESTDIR}/usr/share/spotify/libs/libnssutil3.so.1d" - ln -sf /usr/lib/libsmime3.so "${DESTDIR}/usr/share/spotify/libs/libsmime3.so.1d" - ln -sf /usr/lib/libplc4.so "${DESTDIR}/usr/share/spotify/libs/libplc4.so.0d" - ln -sf /usr/lib/libnspr4.so "${DESTDIR}/usr/share/spotify/libs/libnspr4.so.0d" - ln -sf /usr/lib/libudev.so.1 "${DESTDIR}/usr/share/spotify/libs/libudev.so.0" - fi + echo "export SVERSION=\"${version}${_sversion}\"" >"${DESTDIR}/usr/share/spotify/pkgdata" + echo "export SCHECKSUM=\"${_schecksum}\"" >>"${DESTDIR}/usr/share/spotify/pkgdata" } From 93c668b11b885f282eb2ddf8d9a4a023acffd8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20M=C3=BChlinghaus?= Date: Thu, 22 Jan 2015 10:57:28 +0100 Subject: [PATCH 4/4] spotify: Changed icon names --- srcpkgs/spotify/INSTALL | 2 +- srcpkgs/spotify/REMOVE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/spotify/INSTALL b/srcpkgs/spotify/INSTALL index 3bbc8abdb20..8788241caf5 100644 --- a/srcpkgs/spotify/INSTALL +++ b/srcpkgs/spotify/INSTALL @@ -29,7 +29,7 @@ if test "$ACTION" = "post"; then mv "${_BUILDDIR}/opt/spotify/spotify-client" /usr/share/spotify/spotify-client for _s in 16 22 24 32 48 64 128 256 512; do mkdir -p "/usr/share/icons/hicolor/${_s}x${_s}/apps" - ln -s "/usr/share/spotify/spotify-client/Icons/spotify-linux-${_s}.png" "/usr/share/icons/hicolor/${_s}x${_s}/apps/spotify.png" + ln -s "/usr/share/spotify/spotify-client/Icons/spotify-linux-${_s}.png" "/usr/share/icons/hicolor/${_s}x${_s}/apps/spotify-client.png" done mkdir -p /usr/share/applications ln -s /usr/share/spotify/spotify-client/spotify.desktop /usr/share/applications/spotify.desktop diff --git a/srcpkgs/spotify/REMOVE b/srcpkgs/spotify/REMOVE index 296749a7441..941cc4667a6 100644 --- a/srcpkgs/spotify/REMOVE +++ b/srcpkgs/spotify/REMOVE @@ -5,7 +5,7 @@ if test "$ACTION" = "post"; then rm -r /usr/share/licenses/spotify rm /usr/share/applications/spotify.desktop for _s in 16 22 24 32 48 64 128 256 512; do - rm "/usr/share/icons/hicolor/${_s}x${_s}/apps/spotify.png" + rm "/usr/share/icons/hicolor/${_s}x${_s}/apps/spotify-client.png" done rm -r /usr/share/spotify fi