summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorqaz2020-05-08 07:05:42 +0800
committerqaz2020-05-08 07:05:42 +0800
commit02731bc68a10e134dfe915f0162cd757aee1de71 (patch)
treeeb0fed8ae44d01b98267d010797d74342ab6e8f8 /PKGBUILD
parenta08b2089420ef38af0bc9a8a129d370eabf05f09 (diff)
downloadaur-thunder-mini.tar.gz
Fix license, custom wine opinion
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD79
1 files changed, 59 insertions, 20 deletions
diff --git a/PKGBUILD b/PKGBUILD
index bdcaf2af1dcf..e7a4595d4943 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,50 +3,90 @@
pkgname=thunder-mini
pkgver=1.5.3.288
-pkgrel=1
+pkgrel=3
pkgdesc="Xunlei officially released a compact download tool with dedicated download function."
arch=("i686" "x86_64")
url="https://dl.xunlei.com/"
license=('custom')
makedepends=('p7zip' 'icoutils')
-depends=('wine')
+depends=('bash' 'wine' 'hicolor-icon-theme')
source=(
"http://down.sandai.net/mini/ThunderMini_dl1.5.3.288.exe"
- "license.html::https://www.xunlei.com/xieyi/xl9.html"
- "file://run"
+ "license.txt"
"file://${pkgname}.desktop"
)
noextract=('ThunderMini_dl1.5.3.288.exe')
+_default_env_wineprefix='$HOME/.wine-tool'
+_default_env_winearch='win32'
+_default_env_winedebug='-all'
+_wine_env_file="/etc/wine/appenv/${pkgname}"
+_application_path_root="/opt"
+
+backup=("${_wine_env_file#/*}")
+install="${pkgname}.install"
+
prepare() {
- cd "${srcdir}"
- 7z x -y ThunderMini_dl1.5.3.288.exe
+ mkdir -p "${srcdir}/pkg"
+ cd "${srcdir}/pkg"
+ 7z x -y ../ThunderMini_dl1.5.3.288.exe
rm ./Bin/UnInstallClean.exe
}
+_create_launcher(){
+ # $1 Path of position
+ # $2 Relative path to executable in $1 (Windows path format)
+ # $3 Parameters of wine
+ printf '#!/bin/bash
+source '"${_wine_env_file}"'
+
+apphome='"${_application_path_root}/${pkgname}"'
+wine_appdir="$WINEPREFIX/drive_c/Program Files"
+wine_workhome="$wine_appdir/'"${pkgname}"'"
+
+if [ ! -e "${wine_workhome}" ]; then
+ mkdir -p "${wine_appdir}"
+ cp -rs "${apphome}" "${wine_workhome}"
+fi
+
+exec wine "C:\\\\Program Files\\\\'"${pkgname}\\\\$2"'" '"$3"'
+' > "$1"
+}
+
build() {
+ # Build icon
mkdir -p "${srcdir}/ico"
- wrestool -x -o "${srcdir}/ico" -t14 "${srcdir}/Bin/ThunderMini.exe"
+ wrestool -x -o "${srcdir}/ico" -t14 "${srcdir}/pkg/Bin/ThunderMini.exe"
icotool -x -o "${srcdir}/ico" "${srcdir}/ico/ThunderMini.exe_14_116_2052.ico"
+
+ # Build launcher
+ _create_launcher "thunder-mini" "Bin\\ThunderMini.exe" '$*'
+
+ # Build env file
+ printf "export WINEPREFIX=${_default_env_wineprefix}
+export WINEARCH=${_default_env_winearch}
+export WINEDEBUG=${_default_env_winedebug}
+" > "${pkgname}.env"
}
package() {
- # Copy files
- install -d "${pkgdir}/usr/share/$pkgname"
- cp -r "$srcdir/"{Bin,bho,Skin} "${pkgdir}/usr/share/$pkgname/"
- cp "$srcdir/\$WINDIR/system32/"* "${pkgdir}/usr/share/$pkgname/Bin/"
- find "${pkgdir}/usr/share/$pkgname/" -type d -exec chmod 755 {} \;
+ # Install application files
+ install -d "${pkgdir}${_application_path_root}/$pkgname"
+ cp -r "$srcdir/pkg/"{Bin,bho,Skin} "${pkgdir}${_application_path_root}/$pkgname/"
+ cp "$srcdir/pkg/\$WINDIR/system32/"* "${pkgdir}${_application_path_root}/$pkgname/Bin/"
+ find "${pkgdir}${_application_path_root}/$pkgname/" -type d -exec chmod 755 {} \;
+
+ # Install env file
+ install -Dm644 "${pkgname}.env" "${pkgdir}${_wine_env_file}"
- # Install Run script
- install -Dm755 run "${pkgdir}/usr/share/$pkgname/run"
- install -d "${pkgdir}/usr/bin/"
- ln -sf "/usr/share/$pkgname/run" "${pkgdir}/usr/bin/$pkgname"
+ # Install launcher
+ install -Dm755 "$srcdir/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
# Install licenses
- install -Dm644 "license.html" "${pkgdir}/usr/share/licenses/$pkgname/license.html"
+ install -Dm644 "license.txt" "${pkgdir}/usr/share/licenses/$pkgname/license.txt"
- # Install icons
+ # Install icon
for size in 16x16 32x32 48x48; do
install -Dm644 "${srcdir}/ico/ThunderMini.exe_14_116_2052_"?"_${size}x32.png" \
"${pkgdir}/usr/share/icons/hicolor/${size}/apps/${pkgname}.png"
@@ -58,7 +98,6 @@ package() {
# vim:set ts=2 sw=2 et:
md5sums=('95118524fa7d7e457c7bed4abcb5bbfc'
- '381254665d06cdd2c9493a8892e32bc5'
- '3c57bb9d9375bf00c11230caaf12ed5f'
+ 'a04a22f2def04dd4f030de7fc3e83666'
'227afd0034719425b6d69379efd6558a')