upgpkg: ufw 0.36.2-1
[ArchLinux/community.git] / python-sshtunnel / repos / community-any / PKGBUILD
blob4c084f75c6bb1a2bcdd20115047e1ea11b711274
1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
3 _pkgname=sshtunnel
4 pkgbase=python-sshtunnel
5 pkgname=('sshtunnel' 'python-sshtunnel')
6 _gitcommit=58a46ef8b66be5eded29cd9bda4dccedb46ec586
7 pkgver=0.4.0
8 pkgrel=5
9 pkgdesc='Pure python SSH tunnels'
10 url='https://github.com/pahaz/sshtunnel'
11 arch=('any')
12 license=('MIT')
13 makedepends=('git' 'python-build' 'python-installer' 'python-paramiko' 'python-setuptools' 'python-sphinx' 'python-wheel')
14 checkdepends=('python-pytest' 'python-mock' 'openssh')
15 source=(${pkgbase}::"git+https://github.com/pahaz/sshtunnel#commit=${_gitcommit}")
16 sha512sums=('SKIP')
18 pkgver() {
19   cd ${pkgbase}
20   git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | sed -E 's|\.r0\.\w+$||'
23 prepare() {
24   cd ${pkgbase}
25   sed '/sphinxcontrib.napoleon/d' -i docs/conf.py
28 build() {
29   cd ${pkgbase}
30   python -m build --wheel --no-isolation
32   export PYTHONPATH="$PWD:$PYTHONPATH"
33   sphinx-build -b text docs docs/_build/text
34   sphinx-build -b man docs docs/_build/man
37 check() {
38   cd ${pkgbase}
39   pytest -vv
42 package_sshtunnel() {
43   depends=('python' 'python-sshtunnel')
44   pkgdesc+=' (CLI)'
46   cd ${pkgbase}
47   python -m installer --destdir="$pkgdir" dist/*.whl
48   install -d "${pkgdir}/usr/share/"{licenses,doc,man/man1}
49   ln -s /usr/share/licenses/python-sshtunnel "${pkgdir}/usr/share/licenses/${pkgname}"
50   ln -s /usr/share/doc/python-sshtunnel "${pkgdir}/usr/share/doc/${pkgname}"
51   ln -s /usr/share/man/man1/python-sshtunnel.1.gz "${pkgdir}/usr/share/man/man1/${pkgname}.1.gz"
53   rm -r "${pkgdir}/usr/lib"
56 package_python-sshtunnel() {
57   depends=('python' 'python-paramiko')
59   cd ${pkgbase}
60   python -m installer --destdir="$pkgdir" dist/*.whl
61   install -Dm 644 README.rst changelog.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
62   install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
63   install -Dm 644 docs/_build/text/*.txt -t "${pkgdir}/usr/share/doc/${pkgname}"
64   install -Dm 644 docs/_build/man/sshtunnel.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
66   rm -r "${pkgdir}/usr/bin"
69 # vim: ts=2 sw=2 et: