Date: Friday, March 4, 2016 @ 18:45:47 Author: anthraxx Revision: 164828
addpkg: python-pcapy 0.10.10-2 Added: python-pcapy/ python-pcapy/repos/ python-pcapy/trunk/ python-pcapy/trunk/PKGBUILD ----------+ PKGBUILD | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) Added: python-pcapy/trunk/PKGBUILD =================================================================== --- python-pcapy/trunk/PKGBUILD (rev 0) +++ python-pcapy/trunk/PKGBUILD 2016-03-04 17:45:47 UTC (rev 164828) @@ -0,0 +1,58 @@ +# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org> +# Contributor: Chris Severance aur.severach AatT spamgourmet.com + +_pyname=pcapy +pkgbase=python-pcapy +pkgname=('python-pcapy' 'python2-pcapy') +pkgver=0.10.10 +pkgrel=2 +pkgdesc='Extension module that interfaces with the libpcap packet capture library' +url='https://github.com/CoreSecurity/pcapy' +arch=('i686' 'x86_64') +license=('Apache') +makedepends=('python-setuptools' 'python2-setuptools' 'libpcap') +source=(${pkgbase}-${pkgver}.tar.gz::https://github.com/CoreSecurity/pcapy/archive/${pkgver}.tar.gz) +sha512sums=('9b53a5d14b1e4a95f1745513a0e42e64ee818c9f342ffb84cac8700b0cb88e051e2b0d2659cc6cf273a43d95695bcd7da7f8fd3dca8a2b81edfef21471ac904d') + +prepare() { + sed '/data_files/,/pcapytests/d' -i ${_pyname}-${pkgver}/setup.py + cp -ra ${_pyname}-${pkgver}{,-py2} +} + +build() { + (cd ${_pyname}-${pkgver} + python setup.py build + ) + (cd ${_pyname}-${pkgver}-py2 + python2 setup.py build + ) +} + +check() { + (cd ${_pyname}-${pkgver}/tests + local PYTHONVERSION="$(python -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))')" + PYTHONPATH="../build/lib.linux-${CARCH}-${PYTHONVERSION}" \ + python pcapytests.py + ) + (cd ${_pyname}-${pkgver}-py2/tests + local PYTHONVERSION="$(python2 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))')" + PYTHONPATH="../build/lib.linux-${CARCH}-${PYTHONVERSION}" \ + python2 pcapytests.py + ) +} + +package_python-pcapy() { + depends=('python' 'libpcap') + cd ${_pyname}-${pkgver} + python setup.py install -O1 --root="${pkgdir}" --skip-build + install -Dm 644 pcapy.html ChangeLog -t "${pkgdir}/usr/share/doc/${pkgname}" +} + +package_python2-pcapy() { + depends=('python2' 'libpcap') + cd ${_pyname}-${pkgver}-py2 + python2 setup.py install -O1 --root="${pkgdir}" --skip-build + install -Dm 644 pcapy.html ChangeLog -t "${pkgdir}/usr/share/doc/${pkgname}" +} + +# vim: ts=2 sw=2 et: