summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD30
-rwxr-xr-xwd13
-rw-r--r--wudao-dict-git.install4
4 files changed, 31 insertions, 21 deletions
diff --git a/.SRCINFO b/.SRCINFO
index aa2678b090d2..c21380ce1405 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,9 @@
pkgbase = wudao-dict-git
pkgdesc = The command line version of Youdao Dictionary, supporting English-Chinese mutual search and online search.
pkgver = 2.1
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/ChestnutHeng/Wudao-dict
+ install = wudao-dict-git.install
arch = any
license = unknown
makedepends = git
@@ -10,7 +11,9 @@ pkgbase = wudao-dict-git
depends = python-bs4
depends = python-lxml
source = wudao-dict::git://github.com/ChestnutHeng/Wudao-dict.git
+ source = wd
md5sums = SKIP
+ md5sums = 7e504991b277c83136466f885626cd7c
pkgname = wudao-dict-git
diff --git a/PKGBUILD b/PKGBUILD
index 360105bba6cd..6cbe8e1b4f05 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,38 +1,28 @@
# Maintainer: Ben <bensongsyz@gmail.com>
pkgname='wudao-dict-git'
pkgver=2.1
-pkgrel=1
+pkgrel=2
pkgdesc='The command line version of Youdao Dictionary, supporting English-Chinese mutual search and online search.'
arch=('any')
url="https://github.com/ChestnutHeng/Wudao-dict"
license=('unknown')
depends=('python' 'python-bs4' 'python-lxml')
+install="wudao-dict-git.install"
makedepends=('git')
-source=('wudao-dict::git://github.com/ChestnutHeng/Wudao-dict.git')
-md5sums=('SKIP')
+source=('wudao-dict::git://github.com/ChestnutHeng/Wudao-dict.git'
+ 'wd')
+md5sums=('SKIP'
+ '7e504991b277c83136466f885626cd7c')
package() {
- cd "$srcdir"
-
mkdir -p "${pkgdir}/opt"
- cp -r "./wudao-dict" "${pkgdir}/opt/"
-
- # 用户词
- mkdir -p "${pkgdir}/opt/wudao-dict/wudao-dict/usr"
- chmod -R 777 "${pkgdir}/opt/wudao-dict/wudao-dict/usr"
+ cp -r "./wudao-dict/wudao-dict" "${pkgdir}/opt/"
+# # 添加系统命令wd
mkdir -p "${pkgdir}/usr/bin"
-
- # 添加系统命令wd
- cd "${pkgdir}/usr/bin"
- echo '#!/bin/bash'>./wd
- echo 'save_path=$PWD'>>./wd
- echo 'cd '/opt/wudao-dict/wudao-dict >>./wd
- echo './wdd $*'>>./wd
- echo 'cd $save_path'>>./wd
- chmod +x ./wd
+ cp ./wd "${pkgdir}/usr/bin"
# 添加bash_completion自动补全
mkdir -p "${pkgdir}/etc/bash_completion.d"
- ln -s /opt/wudao-dict/wudao-dict/wd_com "${pkgdir}/etc/bash_completion.d/wd"
+ ln -s /opt/wudao-dict/wd_com "${pkgdir}/etc/bash_completion.d/wd"
}
diff --git a/wd b/wd
new file mode 100755
index 000000000000..19e3de55ffae
--- /dev/null
+++ b/wd
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+WDDIR="$HOME/.local/share/wudao-dict"
+if [ ! -d "$WDDIR" ]
+then
+ cp -r /opt/wudao-dict "$WDDIR"
+ mkdir "$WDDIR/usr"
+fi
+
+save_path=$PWD
+cd $WDDIR
+./wdd $*
+cd $save_path
diff --git a/wudao-dict-git.install b/wudao-dict-git.install
new file mode 100644
index 000000000000..db1675f4be03
--- /dev/null
+++ b/wudao-dict-git.install
@@ -0,0 +1,4 @@
+pre_remove() {
+ echo "deleting the wudao-dict bottle..."
+ find /home -maxdepth 2 -name ".local" -exec rm -rf \{\}/share/wudao-dict/ \;
+}