summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6de8c377fd5cbe10a437d06035833b2e8ad29fa2 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: Ebubekir KARUL <ebubekirkarul@yandex.com>
# Contributor: s1gma,shirokuro

pkgname=scapy-git
pkgver=2.3.3.dev206
pkgrel=1
pkgdesc="A powerful interactive packet manipulation program written in Python"
url="http://www.secdev.org/projects/scapy/"
depends=('tcpdump' 'python2')
optdepends=('python2-cryptography: WEP, IPsec and SSL/TLS support'
            'python2-pyx: psdump() and pdfdump() functions'
            'python2-matplotlib: plotting support'
            'graphviz: conversations() method support'
            'sox: for VOIP support')
makedepends=('git')
checkdepends=('python2-cryptography' 'python2-pyx' 'python2-matplotlib' 'graphviz' 'sox')
arch=('any')
license=('GPL2')
provides=('scapy')
conflicts=('scapy')
source=(${pkgname}::git+https://github.com/secdev/scapy)
sha256sums=('SKIP')

pkgver() {
  cd ${pkgname}
  PYTHONPATH=. python2 -c "print __import__('scapy').VERSION"
}

prepare() {
  cd ${pkgname}
  sed -e 's|env python|env python2|g' -i doc/scapy/*.rst scapy/contrib/*.py setup.py \
    run_scapy scapy/pipetool.py scapy/tools/check_asdis.py scapy/layers/inet6.py
  sed -e 's/exec python/exec python2/g' -i run_scapy setup.py test/run_tests
}

build() {
  cd ${pkgname}
  python2 setup.py build
}

check() {
  cd ${pkgname}/test
  # Disabled tests as they currently hang
  #./run_tests
}

package() {
  cd ${pkgname}
  python2 setup.py install -O1 --skip-build --root="${pkgdir}" --prefix=/usr
  install -Dm 644 doc/scapy/*.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et: