Advertisement
Guest User

Untitled

a guest
May 31st, 2023
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.55 KB | None | 0 0
  1. # Maintainer: NicoHood <archlinux {cat} nicohood {dog} de>
  2. # PGP ID: 97312D5EB9D7AE7D0BD4307351DAE9B7C1AE9161
  3. # Contributor: TobFromme < TobFromme {hat} pm {dont} me >
  4. # Contributor: Ashley Whetter <(firstname) @ awhetter.co.uk>
  5. # Contributor: Eothred <yngve.levinsen@gmail.com>
  6.  
  7. pkgname=spotify
  8. pkgver='1.2.11.916'
  9. epoch=1
  10. _commit=geb595a67
  11. pkgrel=1
  12. pkgdesc='A proprietary music streaming service'
  13. arch=('x86_64')
  14. license=('custom')
  15. url='https://www.spotify.com'
  16. depends=('alsa-lib>=1.0.14' 'gtk3' 'libxss' 'desktop-file-utils' 'openssl' 'nss' 'at-spi2-atk' 'libcurl-gnutls' 'libsm')
  17. optdepends=('ffmpeg4.4: Adds support for playback of local files'
  18. 'zenity: Adds support for importing local files'
  19. 'libnotify: Desktop notifications')
  20. options=('!strip')
  21.  
  22. # NOTE: We switched from stable to testing on 18th march, as the spotify
  23. # stable repository is always outdated. Testing seems to be in sync with snap:
  24. # https://snapcraft.io/spotify
  25. # http://repository.spotify.com/dists/testing/Release
  26. # http://repository.spotify.com/dists/testing/non-free/binary-amd64/Packages
  27. # http://repository.spotify.com/dists/testing/Release.gpg
  28. source=('spotify.protocol'
  29. 'LICENSE'
  30. "${pkgname}-${pkgver}-${_commit}-x86_64.deb::http://repository.spotify.com/pool/non-free/s/spotify-client/spotify-client_${pkgver}.${_commit}_amd64.deb"
  31. # GPG signature check
  32. "${pkgname}-${pkgver}-${pkgrel}-Release::http://repository.spotify.com/dists/testing/Release"
  33. "${pkgname}-${pkgver}-${pkgrel}-Release.sig::http://repository.spotify.com/dists/testing/Release.gpg"
  34. "${pkgname}-${pkgver}-${pkgrel}-x86_64-Packages::http://repository.spotify.com/dists/testing/non-free/binary-amd64/Packages")
  35. sha512sums=('999abe46766a4101e27477f5c9f69394a4bb5c097e2e048ec2c6cb93dfa1743eb436bde3768af6ba1b90eaac78ea8589d82e621f9cbe7d9ab3f41acee6e8ca20'
  36. '2e16f7c7b09e9ecefaa11ab38eb7a792c62ae6f33d95ab1ff46d68995316324d8c5287b0d9ce142d1cf15158e61f594e930260abb8155467af8bc25779960615'
  37. '433b8cb271305c8bc64d33eb16452e7b3fed4afabbd3f374b9af4ad808999a595eedf87cc9415087715c9779fd24c6ae4332c557c9bc4b9f6546b043eb1e98f7'
  38. 'SKIP'
  39. 'SKIP'
  40. 'SKIP')
  41.  
  42. # Import key with:
  43. # curl -sS https://download.spotify.com/debian/pubkey_7A3A762FAFD4A51F.gpg | gpg --import -
  44. validpgpkeys=('E27409F51D1B66337F2D2F417A3A762FAFD4A51F') # Spotify Public Repository Signing Key <tux@spotify.com>
  45. # Old Keys:
  46. # F9A211976ED662F00E59361E5E3C45D7B312C643
  47. # 8FD3D9A8D3800305A9FFF259D1742AD60D811D58
  48. # 931FF8E79F0876134EDDBDCCA87FF9DF48BF1C90
  49. # 2EBF997C15BDA244B6EBF5D84773BD5E130D1D45
  50.  
  51. prepare() {
  52. # Validate hashes from the PGP signed "Release" file
  53. echo "$(grep non-free/binary-amd64/Packages ${pkgname}-${pkgver}-${pkgrel}-Release | tail -n 2 | head -n 1 | awk '{print $1}') ${pkgname}-${pkgver}-${pkgrel}-x86_64-Packages" \
  54. > "${pkgname}-${pkgver}-x86_64-Packages.sha256"
  55. sha256sum -c "${pkgname}-${pkgver}-x86_64-Packages.sha256"
  56.  
  57. echo "$(grep SHA512 ${pkgname}-${pkgver}-${pkgrel}-x86_64-Packages | head -n 1 | awk '{print $2}') ${pkgname}-${pkgver}-${_commit}-x86_64.deb" \
  58. > "${pkgname}-${pkgver}-x86_64.deb.sha512"
  59. sha512sum -c "${pkgname}-${pkgver}-x86_64.deb.sha512"
  60. }
  61.  
  62. package() {
  63. cd "${srcdir}"
  64.  
  65. tar -xzf data.tar.gz --no-same-owner -C "${pkgdir}"
  66.  
  67. # Enable spotify to open URLs from the webapp
  68. sed -i 's/^Exec=.*/Exec=spotify --uri=%U/' "${pkgdir}"/usr/share/spotify/spotify.desktop
  69.  
  70. install -Dm644 "${pkgdir}"/usr/share/spotify/spotify.desktop "${pkgdir}"/usr/share/applications/spotify.desktop
  71. install -Dm644 "${pkgdir}"/usr/share/spotify/icons/spotify-linux-512.png "${pkgdir}"/usr/share/pixmaps/spotify-client.png
  72.  
  73. for size in 22 24 32 48 64 128 256 512; do
  74. install -Dm644 "${pkgdir}/usr/share/spotify/icons/spotify-linux-$size.png" \
  75. "${pkgdir}/usr/share/icons/hicolor/${size}x${size}/apps/spotify.png"
  76. done
  77.  
  78. # Move spotify binary to its proper location
  79. mkdir -p "${pkgdir}"/opt/spotify
  80. mv "${pkgdir}/usr/share/spotify" "${pkgdir}/opt/"
  81.  
  82. # Symlink spotify binary which is located in /opt
  83. ln -sf /opt/spotify/spotify "${pkgdir}/usr/bin/spotify"
  84.  
  85. # Copy protocol file for KDE
  86. install -Dm644 "${srcdir}/spotify.protocol" "${pkgdir}/usr/share/kservices5/spotify.protocol"
  87.  
  88. # Install license
  89. # https://www.spotify.com/legal/end-user-agreement
  90. install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  91.  
  92. # Fix permissions
  93. chmod -R go-w "${pkgdir}"
  94. }
  95.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement