summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 876964100463f47b6944af4787c66b2be81b2980 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Maintainer: Mark Weiman <mark.weiman@markzz.com>

pkgbase=python-pybgpstream
pkgname=('python-pybgpstream' 'python2-pybgpstream')
_pkgname='pybgpstream'
pkgver=1.2.1
pkgrel=1
arch=('x86_64')
license=('GPL')
url="https://bgpstream.caida.org/"
makedepends=('python' 'python-setuptools' 'python2' 'python2-setuptools')
source=("https://bgpstream.caida.org/bundles/caidabgpstreamwebhomepage/dists/${_pkgname}-${pkgver}.tar.gz")
md5sums=('ed8a1f6c72f1a6a40d48c748e0346cf8')

prepare() {
  cp -a "${srcdir}/${_pkgname}-${pkgver}" "${srcdir}/${_pkgname}2-${pkgver}"

  find "${srcdir}/${_pkgname}2-${pkgver}" -name '*.py' | \
    xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"
}

build() {
  cd "${srcdir}/${_pkgname}-${pkgver}"
  python setup.py build

  cd "${srcdir}/${_pkgname}2-${pkgver}"
  python2 setup.py build
}

package_python-pybgpstream() {
  depends=('python' 'bgpstream')
  cd "${srcdir}/${_pkgname}-${pkgver}"
  python setup.py install --root="${pkgdir}" --optimize=1
}

package_python2-pybgpstream() {
  depends=('python2' 'bgpstream')
  cd "${srcdir}/${_pkgname}2-${pkgver}"
  python2 setup.py install --root="${pkgdir}" --optimize=1
}