Files
extra/python-pysmi/PKGBUILD
2025-06-22 20:39:04 -05:00

55 lines
1.9 KiB
Bash

# Maintainer: Jesus E. <heckyel@riseup.net>
pkgname=python-pysmi
_pyname="${pkgname/*-/}"
pkgver=0.3.2
_debver=$pkgver
_debrel=2
pkgrel=2
pkgdesc='SNMP/SMI MIB parsing and conversion library designed to turn ASN.1 MIBs into various formats'
url='http://snmplabs.com/pysmi/'
arch=('any')
license=('Simplified-BSD')
makedepends=('python' 'python-sphinx' 'python-ply' 'quilt')
source=("${_pyname}-${pkgver}.tar.gz::https://github.com/etingof/pysmi/archive/v${pkgver}.tar.gz"
"https://deb.debian.org/debian/pool/main/p/pysmi/pysmi_${_debver}-${_debrel}.debian.tar.xz")
sha512sums=('d8ee1e08a3fdd808559d11499b323783637622b3ddd4cf3351d2e6ca2ed51a1cfbd3c2ffb6f71555f244ea2da8521ea81e3daba4d97658c1e6e7322ef1a46228'
'3c1def6347db4e24994d04d97c3522db695f75a48defdecc69cad8122044096f94b1fcae98ccf0634ce7214cf721217259d532ded8662be8334b83e51951145e')
prepare() {
cd ${_pyname}-${pkgver}
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
# Debian patches
export QUILT_PATCHES=debian/patches
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
export QUILT_DIFF_ARGS='--no-timestamps'
mv "$srcdir"/debian .
quilt push -av
fi
}
build() {
cd ${_pyname}-${pkgver}
python setup.py build
make -C docs text man
}
package() {
depends=('python' 'python-ply')
cd ${_pyname}-${pkgver}
python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
cp -r docs/build/text "${pkgdir}/usr/share/doc/${pkgname}"
cp -r examples -t "${pkgdir}/usr/share/doc/${pkgname}"
install -Dm 644 docs/build/man/${_pyname}.1 "${pkgdir}/usr/share/man/man1/${_pyname}.1"
install -Dm 644 docs/build/man/${_pyname}.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
install -Dm 644 LICENSE.rst -t "${pkgdir}/usr/share/licenses/${pkgname}"
mv "${pkgdir}/usr/bin/mibdump"{.py,}
mv "${pkgdir}/usr/bin/mibcopy"{.py,}
}