diff options
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | PKGBUILD | 38 |
2 files changed, 54 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..aa2678b090d2 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,16 @@ +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 + url = https://github.com/ChestnutHeng/Wudao-dict + arch = any + license = unknown + makedepends = git + depends = python + depends = python-bs4 + depends = python-lxml + source = wudao-dict::git://github.com/ChestnutHeng/Wudao-dict.git + md5sums = SKIP + +pkgname = wudao-dict-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..360105bba6cd --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,38 @@ +# Maintainer: Ben <bensongsyz@gmail.com> +pkgname='wudao-dict-git' +pkgver=2.1 +pkgrel=1 +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') +makedepends=('git') +source=('wudao-dict::git://github.com/ChestnutHeng/Wudao-dict.git') +md5sums=('SKIP') + +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" + + 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 + + # 添加bash_completion自动补全 + mkdir -p "${pkgdir}/etc/bash_completion.d" + ln -s /opt/wudao-dict/wudao-dict/wd_com "${pkgdir}/etc/bash_completion.d/wd" +} |