archrelease: copy trunk to community-any
[ArchLinux/community.git] / tldr / trunk / PKGBUILD
blob46f51974863ed7c7673c8c84af2f89dcd4a519d8
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Maintainer: Brett Cornwall <ainola@archlinux.org>
4 pkgname=tldr
5 pkgver=3.2.0
6 pkgrel=1
7 pkgdesc="Command line client for tldr, a collection of simplified and community-driven man pages."
8 arch=('any')
9 url="https://github.com/tldr-pages/tldr-python-client"
10 license=('MIT')
11 depends=('python-shtab' 'python-colorama' 'python-termcolor')
12 makedepends=(
13     'python-build'
14     'python-installer'
15     'python-setuptools'  # Set in pyproject.toml build
16     'python-sphinx-argparse'
17     'python-wheel'
19 checkdepends=('python-pytest')
20 source=("https://github.com/tldr-pages/tldr-python-client/archive/$pkgver/$pkgname-$pkgver.tar.gz")
21 sha512sums=('1535979548b49cd8b0312f2cd11f69ba3f710e16a27c074dc5a8cb5617d7f343df30ba01a83388b460508ab519045140852767bfc8ff1189d612d71a3d35d76b')
23 build() {
24   cd "tldr-python-client-$pkgver"
25   make -C docs
26   python -m build --wheel --no-isolation
29 # https://github.com/tldr-pages/tldr-python-client/issues/209
30 #check() {
31 #  cd tldr-python-client-$pkgver
32 #  python -m pytest
35 package() {
36   cd "tldr-python-client-$pkgver"
37   python -m installer --destdir="$pkgdir" dist/*.whl
38   install -Dm644 LICENSE.md -t "$pkgdir/usr/share/licenses/$pkgname/"
40   # Generate here instead of a .install for package reproducibility
41   install -dm755 "$pkgdir/usr/share/bash-completion/completions/"
42   install -dm755 "$pkgdir/usr/share/zsh/site-functions/"
43   python "$pkgdir"/usr/lib/python*/site-packages/tldr.py --print-completion bash \
44     > "$pkgdir/usr/share/bash-completion/completions/tldr"
45   python "$pkgdir"/usr/lib/python*/site-packages/tldr.py --print-completion zsh \
46     > "$pkgdir/usr/share/zsh/site-functions/_tldr"