diff options
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | PKGBUILD | 30 | ||||
-rwxr-xr-x | wd | 13 | ||||
-rw-r--r-- | wudao-dict-git.install | 4 |
4 files changed, 31 insertions, 21 deletions
@@ -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 @@ -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" } @@ -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/ \; +} |