diff --git a/.SRCINFO b/.SRCINFO index 64d27acf971f..608675c0d184 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,8 +1,9 @@ pkgbase = netease-cloud-music-wine - pkgdesc = NetEase Cloud Music Player + pkgdesc = NetEase Cloud Music Player. 使用wine运行网易云音乐windows官方包。 pkgver = 3.1.22.204707 - pkgrel = 1 + pkgrel = 2 url = https://music.163.com/#/download + install = .install arch = x86_64 license = custom makedepends = 7zip diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..378e68747071 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +pkg +src +*.exe +*.zst diff --git a/.install b/.install new file mode 100644 index 000000000000..9ad261f7c902 --- /dev/null +++ b/.install @@ -0,0 +1,33 @@ +post_install(){ + cat << 'EOF' +################################ +netease-cloud-music-wine: + +To run this application via commandline, +you can run command: + + netease-cloud-music-wine + +or: + + cloudmusic + +################################ +EOF +} + +post_remove(){ + cat << 'EOF' +################################ +netease-cloud-music-wine: + +After uninstalled this application, +if necessary, +please remove below cache directory manually: + + $HOME/.cache/netease-cloud-music-wine + + +################################ +EOF +} diff --git a/PKGBUILD b/PKGBUILD index d6f6b8c0d19a..2ab74fc41028 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,8 +2,8 @@ pkgname='netease-cloud-music-wine' pkgver=3.1.22.204707 -pkgrel=1 -pkgdesc="NetEase Cloud Music Player" +pkgrel=2 +pkgdesc="NetEase Cloud Music Player. 使用wine运行网易云音乐windows官方包。" arch=('x86_64') license=('custom') url="https://music.163.com/#/download" @@ -11,6 +11,7 @@ depends=('wine' 'noto-fonts-cjk') makedepends=('7zip') #optdepends=('') #conflicts=('') +install=.install DLAGENTS=( 'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -A "Mozilla/5.0" -o %o %u' ) @@ -28,6 +29,15 @@ prepare() { cat > install.sh << 'EOF' #!/bin/bash +# prevent running by root/sudo +# refer Wine official FAQ, do not run wine with sudo or root permission. +if [[ $(id -u) -eq 0 ]]; +then + echo "ERROR: you should not use root/sudo to run this application." + echo "ERROR: prevent running by root/sudo" + exit 1 +fi + if [[ -z "${WINEPREFIX}" ]]; then echo "\$WINEPREFIX not set." >&2 @@ -54,6 +64,15 @@ EOF cat > run.sh << 'EOF' #!/bin/bash +# prevent running by root/sudo +# refer Wine official FAQ, do not run wine with sudo or root permission. +if [[ $(id -u) -eq 0 ]]; +then + echo "ERROR: you should not use root/sudo to run this application." + echo "ERROR: prevent running by root/sudo" + exit 1 +fi + if [[ -n "${XDG_CACHE_HOME}" ]]; then SETUP_DIR="${XDG_CACHE_HOME}"/netease-cloud-music-wine