summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWu Zhenyu2022-12-03 13:55:05 +0800
committerWu Zhenyu2022-12-03 14:04:05 +0800
commit4526b76797e65287b58b9a55163ca5f4b6dcfdab (patch)
tree194a0db7433e03edea1620442e0ec71cc28dff50
downloadaur-4526b76797e65287b58b9a55163ca5f4b6dcfdab.tar.gz
:tada: Initial
-rw-r--r--.SRCINFO21
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD47
3 files changed, 73 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d6a6f452199c
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = python-translate-shell
+ pkgdesc = Translate text by many different translators.
+ pkgver = 0.0.2
+ pkgrel = 1
+ url = https://github.com/Freed-Wu/translate-shell
+ arch = any
+ license = GPLv3
+ makedepends = python-installer
+ makedepends = python-shtab
+ makedepends = help2man
+ optdepends = python-colorama: color
+ optdepends = python-rich: better logger
+ optdepends = python-pyyaml: output yaml format
+ optdepends = python-keyring: store APP secrets securely
+ optdepends = python-langdetect: detect language automatically for offline dictionary
+ optdepends = python-pystardict: offline dictionary
+ conflicts = translate-shell
+ source = https://files.pythonhosted.org/packages/py3/t/translate-shell/translate_shell-0.0.2-py3-none-any.whl
+ sha256sums = 65b6082b512a96d6bbd4ffdf706ebd513f39bfd0a250139179f80c3e6481c65a
+
+pkgname = python-translate-shell
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..8a5cafba2b8e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+/*
+!/.gitignore
+!/PKGBUILD
+!/.SRCINFO
+!/*.install
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..be7625d10ed2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,47 @@
+# shellcheck shell=bash disable=SC2034,SC2154
+# Maintainer: Wu Zhenyu <wuzhenyu@ustc.edu>
+# https://aur.archlinux.org/packages/updaurpkg-git
+# $ updaurpkg --apply
+_repo=Freed-Wu/translate-shell
+_source_type=github-tags
+_upstreamver='0.0.2'
+_pkgname=$(tr A-Z a-z <<<${_repo##*/})
+
+pkgname=python-$_pkgname
+pkgver=${_upstreamver##v}
+pkgrel=1
+pkgdesc="Translate text by many different translators."
+arch=(any)
+url=https://github.com/$_repo
+makedepends=(python-installer python-shtab help2man)
+optdepends=(
+ 'python-colorama: color'
+ 'python-rich: better logger'
+ 'python-pyyaml: output yaml format'
+ 'python-keyring: store APP secrets securely'
+ 'python-langdetect: detect language automatically for offline dictionary'
+ 'python-pystardict: offline dictionary'
+)
+conflicts=(translate-shell)
+license=(GPLv3)
+_py=py3
+source=("https://files.pythonhosted.org/packages/$_py/${_pkgname:0:1}/$_pkgname/${_pkgname//-/_}-$pkgver-$_py-none-any.whl")
+sha256sums=('65b6082b512a96d6bbd4ffdf706ebd513f39bfd0a250139179f80c3e6481c65a')
+
+package() {
+ cd "$srcdir" || return 1
+ python -m installer --destdir="$pkgdir" ./*.whl
+
+ local bin
+ bin=trans
+ help2man "$bin" | gzip >"$bin.1.gz"
+ install -D "$bin.1.gz" -t "$pkgdir/usr/share/man/man1"
+ PYTHONPATH="$(ls -d "$pkgdir"/usr/lib/python*/site-packages)"
+ export PYTHONPATH
+ "$pkgdir/usr/bin/$bin" --print-completion bash >"$bin.bash"
+ "$pkgdir/usr/bin/$bin" --print-completion zsh >"_$bin"
+ "$pkgdir/usr/bin/$bin" --print-completion tcsh >"$bin.csh"
+ install -D "$bin.bash" "$pkgdir/usr/share/bash-completion/completions/$bin"
+ install -D "_$bin" -t "$pkgdir/usr/share/zsh/site-functions"
+ install -D "$bin.csh" -t "$pkgdir/etc/profile.d"
+}