diff options
author | gbcbooks | 2018-08-17 14:13:36 +0800 |
---|---|---|
committer | gbcbooks | 2018-08-17 14:13:36 +0800 |
commit | 646be265d72c59cf57d6133ff507bf8abc5562c3 (patch) | |
tree | a665aca138d70b41efbaf3b658de045c265d19d1 | |
download | aur-646be265d72c59cf57d6133ff507bf8abc5562c3.tar.gz |
initial yy-wine-1
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | PKGBUILD | 49 | ||||
-rwxr-xr-x | run.sh | 98 |
3 files changed, 168 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..811aaa710cb5 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = yy-wine-1 + pkgdesc = YY Voice from douwan run on wine + pkgver = 1.0 + pkgrel = 1 + url = http://www.yy.com/ + arch = i686 + arch = x86_64 + license = unknow + depends = p7zip + depends = wine + depends = xorg-xwininfo + depends = xdotool + source = ftp://ftp.icmp.eu.org/tools/yy-wine-1-1.0-1.tar.gz + source = http://yydl.duowan.com/4/setup/YYSetup-8.30.0.0-zh-CN.exe + source = run.sh + md5sums = 03a803bc2e36b3e48a855f0bf96be1ef + md5sums = dc0bcee0ab07845e3c0b4156c042d9cc + md5sums = dab77123bed67a79d771fd718dea4be2 + +pkgname = yy-wine-1 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..cc32e0086e40 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,49 @@ +# +# Maintainer: Goodman Leung<gbcbooksmj@gmail.com> +# + +pkgname=yy-wine-1 +pkgver=1.0 +pkgrel=1 +pkgdesc="YY Voice from douwan run on wine" +arch=('i686' 'x86_64') +url="http://www.yy.com/" +license=('unknow') +groups=() +depends=('p7zip' 'wine' 'xorg-xwininfo' 'xdotool') +makedepends=() +install= +changelog= +_mirror="http://yydl.duowan.com" +YYver=8.30.0.0 +#source=("$pkgname-$pkgver.tar.gz" +# "${_mirror}/4/setup/YYSetup-${YYver}.${YYrel}-zh-CN.exe" +# "run.sh") +source=("ftp://ftp.icmp.eu.org/tools/${pkgname}-${pkgver}-${pkgrel}.tar.gz" + "${_mirror}/4/setup/YYSetup-${YYver}-zh-CN.exe" + "run.sh") +md5sums=("03a803bc2e36b3e48a855f0bf96be1ef" + "dc0bcee0ab07845e3c0b4156c042d9cc" + "dab77123bed67a79d771fd718dea4be2") + +build() { + pushd ${srcdir} + msg "update shell infornamtion ..." + sed -i "s/PKGNAME/${pkgname}/" run.sh + sed -i "s/APPVERSION/${YYver}/" run.sh + sed -i "s/PKGNAME/${pkgname}/" usr/share/applications/YY_Voice.desktop + sed -i "s/Name=/Name=1/" usr/share/applications/YY_Voice.desktop + popd +} + +package() { + pushd ${pkgdir} + msg "Preparing icons and startup entry..." + mkdir -p usr/share + cp -r ${srcdir}/usr/share/* usr/share/ + msg "Copying start script to opt/${pkgname} ..." + mkdir -p opt/${pkgname} + cp ${srcdir}/{files.7z,run.sh,YYSetup-${YYver}-zh-CN.exe} -i opt/${pkgname} + chmod +x opt/${pkgname}/run.sh + popd +} diff --git a/run.sh b/run.sh new file mode 100755 index 000000000000..c5b698b1d631 --- /dev/null +++ b/run.sh @@ -0,0 +1,98 @@ +#!/bin/sh +# goodman Leung <gbcbooksmj@gmail.com> +# +# Thanks to Deepin Team for providing such a goold shell script. i use a lot of code from them. + +PACKAGENAME="PKGNAME" +WINEPREFIX="$HOME/.${PACKAGENAME}" +WINEARCH=win32 +APPDIR="/opt/${PACKAGENAME}" +APPVER="APPVERSION" +APPTAR="files.7z" + +export WINEPREFIX +export WINEARCH + +HelpApp() +{ + echo " Extra Commands:" + echo " -r/--reset Reset app to fix errors" + echo " -e/--remove Remove deployed app files" + echo " -h/--help Show program help info" +} +CallApp() +{ + wine "$WINEPREFIX/drive_c/Program Files/duowan/yy/YY.exe" +} +ExtractApp() +{ + mkdir -p "$1" + 7z x "$APPDIR/$APPTAR" -o"$1" + mv "$1/drive_c/users/@current_user@" "$1/drive_c/users/$USER" + sed -i "s#@current_user@#$USER#" $1/*.reg +# sed -i "s/deepin-wine/wine/" $1/drive_c/deepin/EnvInit.sh + wine $APPDIR/YYSetup-$APPVER-zh-CN.exe +} +DeployApp() +{ + ExtractApp "$WINEPREFIX" + echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION" +} +RemoveApp() +{ + rm -rf "$WINEPREFIX" +} +ResetApp() +{ + echo "Reset $PACKAGENAME....." + read -p "* Are you sure?(Y/N)" ANSWER + if [ "$ANSWER" = "Y" -o "$ANSWER" = "y" -o -z "$ANSWER" ]; then + EvacuateApp + DeployApp + CallApp + fi +} +UpdateApp() +{ + if [ -f "$WINEPREFIX/PACKAGE_VERSION" ] && [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" = "$APPVER" ]; then + return + fi + if [ -d "${WINEPREFIX}.tmpdir" ]; then + rm -rf "${WINEPREFIX}.tmpdir" + fi + ExtractApp "${WINEPREFIX}.tmpdir" + /opt/deepinwine/tools/updater -s "${WINEPREFIX}.tmpdir" -c "${WINEPREFIX}" -v + rm -rf "${WINEPREFIX}.tmpdir" + echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION" +} +RunApp() +{ + if [ -d "$WINEPREFIX" ]; then + UpdateApp + else + DeployApp + fi + CallApp +} + +if [ -z $1 ]; then + RunApp + exit 0 +fi +case $1 in + "-r" | "--reset") + ResetApp + ; + "-e" | "--remove") + RemoveApp + ;; + "-h" | "--help") + HelpApp + ;; + *) + echo "Invalid option: $1" + echo "Use -h|--help to get help" + exit 1 + ;; +esac +exit 0 |