blob: b806a847e8c1863f6a78648c6cb84022a5bd5a34 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# Maintainer: levinit <levinit at outlook>
pkgname=moedict
_pkgname=moedict-desktop
pkgver=1.1.1
pkgrel=1
pkgdesc="Chinese Dictionary漢語詞典-萌典/mengdian"
arch=('i686' 'x86_64')
url="https://racklin.github.io/moedict-desktop/download.html"
license=('GPL')
makedepends=('git')
source_common="https://github.com/racklin/moedict-desktop/releases/download/$pkgver/$_pkgname.app-$pkgver-linux"
source_x86_64=("$source_common-${arch[1]}.tar.bz2")
source_i686=("$source_common-${arch[0]}.tar.bz2")
md5sums_x86_64=('SKIP')
md5sums_i686=('SKIP')
package() {
install -dm755 "$pkgdir/opt"
install -dm755 "$pkgdir/usr/share/icons"
install -dm755 "$pkgdir/usr/bin"
install -dm755 "$pkgdir/usr/share/applications"
#according to different architectures
thisArch=`uname -m`
if [[ $thisArch == ${arch[1]} ]]
then
#copy app files
cp -r "$srcdir/$_pkgname.app-linux-${arch[1]}" "$pkgdir/opt/$pkgname"
#create application desktop icon
cp "$srcdir/$_pkgname.app-linux-${arch[1]}/extensions/moedict-addon-app@moedict.tw/webapp/icon.png" "$pkgdir/usr/share/icons/moedict.png"
else
cp -r"$srcdir/$_pkgname.app-linux-${arch[0]}" "$pkgdir/opt/$pkgname"
cp "$srcdir/$_pkgname.app-linux-${arch[0]}/extensions/moedict-addon-app@moedict.tw/webapp/icon.png" "$pkgdir/usr/share/icons/moedict.png"
fi
#create a shell script for launching app
echo -e '#!/bin/sh\n/opt/moedict/Moedict-Desktop-bin &' > "$pkgdir/usr/bin/moedict"
chmod +x "$pkgdir/usr/bin/moedict"
#create application desktop file"
echo -e '[Desktop Entry]\nName=萌典\nName[en_US]=moedict\nComment=漢語詞典\nComment[zh_CN]=汉语词典\nComment[zh_SG]=汉语词典\nComment[zh_TW]=漢語詞典\nComment[zh_HK]=漢語詞典\nComment[yue_HK]=漢語詞典\nComment[en_US]=Chinese Dictionary\nIcon=moedict\nExec=moedict\nType=Application\nTerminal=false\nCategories=Office;Dictionary' > "$pkgdir/usr/share/applications/moedict.desktop"
echo "文件較大,請耐心等待。Please wait..."
}
|