diff options
author | LER0ever | 2017-07-04 11:00:54 +0800 |
---|---|---|
committer | LER0ever | 2017-07-04 11:00:54 +0800 |
commit | f865671743ad26afea2625eaf4e7075842f06666 (patch) | |
tree | 353cd824efa02b2890ad2e276424360f222c33e8 | |
download | aur-f865671743ad26afea2625eaf4e7075842f06666.tar.gz |
feat(wine-tim): Initial, fully functioning except auto-login
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | PKGBUILD | 47 | ||||
-rw-r--r-- | run.sh | 102 |
3 files changed, 171 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..f834a1d7e506 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +# Generated by mksrcinfo v8 +# Tue Jul 4 03:00:15 UTC 2017 +pkgbase = wine-tim + pkgdesc = Latest Tencent TIM (com.qq.office) on Deepin Wine + pkgver = 1.1.5 + pkgrel = 0 + url = http://tim.qq.com/ + arch = x86_64 + license = custom + depends = p7zip + depends = wine + depends = xorg-xwininfo + depends = xdotool + source = https://mirrors.tuna.tsinghua.edu.cn/deepin/pool/non-free/d/deepin.com.qq.office/deepin.com.qq.office_1.0.4deepin4_i386.deb + source = http://dldir1.qq.com/qqfile/qq/TIM1.1.5/21175/TIM1.1.5.exe + source = run.sh + md5sums = 24de53e74f6917dad0693b57e1e6ba4b + md5sums = 4d63de9d589c2d60bb36107849fc87e2 + md5sums = 781d9e39b467276d8e050b1b57c10c66 + +pkgname = wine-tim + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..06c7e9eb46c7 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,47 @@ +# Maintainer: Everette Rong <e@v01d.co> + +pkgname=wine-tim +pkgver=1.1.5 +deepintimver=1.0.4deepin4 +pkgrel=0 +pkgdesc="Latest Tencent TIM (com.qq.office) on Deepin Wine" +arch=("x86_64") +url="http://tim.qq.com/" +license=('custom') +depends=('p7zip' 'wine' 'xorg-xwininfo' 'xdotool') +_mirror="https://mirrors.tuna.tsinghua.edu.cn/deepin" +source=("$_mirror/pool/non-free/d/deepin.com.qq.office/deepin.com.qq.office_${deepintimver}_i386.deb" + "http://dldir1.qq.com/qqfile/qq/TIM${pkgver}/21175/TIM${pkgver}.exe" + "run.sh") +md5sums=('24de53e74f6917dad0693b57e1e6ba4b' + '4d63de9d589c2d60bb36107849fc87e2' + '781d9e39b467276d8e050b1b57c10c66') + +build() { + pushd ${srcdir} + msg "Extracting DPKG package ..." + mkdir dpkgdir + tar -xvf data.tar.xz -C dpkgdir + msg "Extracting Deepin Wine TIM archive ..." + 7z x dpkgdir/opt/deepinwine/apps/Deepin-TIM/files.7z -odeepintimdir + msg "Removing original outdated TIM directory ..." + rm -r deepintimdir/drive_c/Program\ Files/Tencent/TIM + msg "Repackaging app archive ..." + pushd deepintimdir + 7z a -t7z -r ../files.7z * + popd + popd +} + +package() { + pushd ${pkgdir} + msg "Preparing icons ..." + mkdir -p usr/share + mv ${srcdir}/dpkgdir/usr/local/share/* usr/share/ + msg "Copying TIM to /opt/deepinwine/apps/Deepin-TIM ..." + mkdir -p opt/deepinwine/apps/Deepin-TIM + cp ${srcdir}/{files.7z,run.sh,TIM$pkgver.exe} -i opt/deepinwine/apps/Deepin-TIM/ + popd +} + +# vim:set ts=2 sw=2 et: diff --git a/run.sh b/run.sh new file mode 100644 index 000000000000..f167383e35fc --- /dev/null +++ b/run.sh @@ -0,0 +1,102 @@ +#!/bin/sh + +# Copyright (C) 2016 Deepin, Inc. +# +# Author: Li LongYu <lilongyu@linuxdeepin.com> +# Peng Hao <penghao@linuxdeepin.com> + +WINEPREFIX="$HOME/.deepinwine/Deepin-TIM" +APPDIR="/opt/deepinwine/apps/Deepin-TIM" +APPVER="1.1.5" +TIMVER="1.1.5" +APPTAR="files.7z" +PACKAGENAME="com.qq.tim" + +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() +{ + if [ ! -f $WINEPREFIX/reinstalled ] + then + touch $WINEPREFIX/reinstalled + env WINEPREFIX=$WINEPREFIX wine $APPDIR/TIM$TIMVER.exe + else + bash "$WINEPREFIX/drive_c/deepin/EnvInit.sh" + fi +} +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 +} +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 |