makedeb


netease-cloud-music-patched 1.2.1-8


Patched official Netease Cloud Music, re-ported from AUR

Click here to go back to the commit logs for netease-cloud-music-patched.

Commit:


Hash: 42c92343f80e7277f066d1a3c1657cfa08d0172d

Message: upgpkg: netease-cloud-music 1.2.1-1 upstream release update netease cloud music

Diff


diff --git a/.SRCINFO b/.SRCINFO
index 8bc7cc6..b355592 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -5,9 +5,7 @@ pkgbase = netease-cloud-music
 	url = http://music.163.com/
 	arch = x86_64
 	license = custom
-	source = http://d1.music.126.net/dmusic/netease-cloud-music_1.2.1_amd64_ubuntu_20190428.deb
 	source = http://music.163.com/html/web2/service.html
-	md5sums = 1f47c7dc3d9ce46da8099e539ee8a74d
 	md5sums = SKIP
 
 pkgname = netease-cloud-music
diff --git a/PKGBUILD b/PKGBUILD
index e030fd4..0438a6b 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
 }