summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen2021-03-15 11:40:25 +0800
committerBen2021-03-15 11:40:25 +0800
commitc7776c412779bce98151731c3cf9967f25772dd5 (patch)
tree6b35a188499afa18014e80d9a056f079cda354e9
parentdc8fd78c750734e4715ea086f358b593b476d205 (diff)
downloadaur-c7776c412779bce98151731c3cf9967f25772dd5.tar.gz
Moving working directory from / to $HOME
1. Referring to deepin-wine, the working directory is moved to the user's home directory('$HOME/.local/share/wudao-dict') and the 777 permission of 'usr' is removed. 1. Create: /usr/bin/wd at the first time. 2. Remove: 'wudao-dict-git.install'. 2. Only sub-directory is installed.
-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 aa2678b090d..c21380ce140 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 360105bba6c..6cbe8e1b4f0 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 00000000000..19e3de55ffa
--- /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 00000000000..db1675f4be0
--- /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/ \;
+}