summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorBruce Zhang2019-12-16 20:15:10 +0800
committerBruce Zhang2019-12-16 20:15:10 +0800
commit42c92343f80e7277f066d1a3c1657cfa08d0172d (patch)
tree3137f892b4e885d5b8d8f8246513309b6fa3fc78 /PKGBUILD
parentdd662e5ebaedfb028748f31d4903ae2fb4e00144 (diff)
downloadaur-42c92343f80e7277f066d1a3c1657cfa08d0172d.tar.gz
upgpkg: netease-cloud-music 1.2.1-1
upstream release update netease cloud music
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD29
1 files changed, 20 insertions, 9 deletions
diff --git a/PKGBUILD b/PKGBUILD
index e030fd48c9e..0438a6b9c7d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,15 +8,26 @@ arch=("x86_64")
url="http://music.163.com/"
license=('custom')
depends=()
-source=(
- "http://d1.music.126.net/dmusic/netease-cloud-music_${pkgver}_amd64_ubuntu_${_pkgdate}.deb"
- "http://music.163.com/html/web2/service.html"
-)
-md5sums=('1f47c7dc3d9ce46da8099e539ee8a74d'
- 'SKIP')
+source=("http://music.163.com/html/web2/service.html")
+md5sums=('SKIP')
+
+prepare() {
+ # Download in prepare to add User-Agent header.
+ cd "$srcdir"
+ source_uri="http://d1.music.126.net/dmusic/netease-cloud-music_${pkgver}_amd64_ubuntu_${_pkgdate}.deb"
+ file_uri="$pkgname-$pkgver.orig.deb"
+ md5checksum='1f47c7dc3d9ce46da8099e539ee8a74d'
+ user_agent='Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5'
+ [ ! -f "$file_uri" ] && curl -H "User-Agent: $user_agent" "$source_uri" -o "$file_uri"
+ mkdir -p "$pkgname"
+ bsdtar -x -C "$pkgname" -f "$file_uri"
+ cd "$pkgname"
+ mkdir -p data
+ bsdtar -x -C data -f data.tar.xz
+}
package() {
- cd ${srcdir}
- tar -xvf data.tar.xz -C ${pkgdir}
- install -D -m644 service.html ${pkgdir}/usr/share/licenses/$pkgname/license.html
+ cd "$srcdir/$pkgname/data"
+ cp -rfp {opt,usr} "$pkgdir/"
+ install -D -m644 "$srcdir/service.html" ${pkgdir}/usr/share/licenses/$pkgname/license.html
}