summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3f69fbab7c18b8034755cd9b756701423546a2d9 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Maintainer: Pierre Lalet <pl@ivre.rocks>

pkgbase='ivre-git'
pkgbasename='ivre'
pkgname=('ivre-git' 'ivre-web-git' 'ivre-docs-git' 'python-ivre-git' 'python2-ivre-git')
pkgver=0.9.13.dev14
pkgrel=1
pkgdesc='Network recon framework based on Nmap, Masscan, Zeek (Bro), Argus, Netflow,...'
arch=('any')
url='https://ivre.rocks/'
license=('GPL3')
makedepends=('git')
source=("git+https://github.com/cea-sec/ivre.git")
sha256sums=('SKIP')

pkgver() {
  cd "$srcdir/$pkgbasename"
  python setup.py --version 2>/dev/null
}

prepare() {
    cp -a ${srcdir}/${pkgbasename}{,-py2}
}

build() {
  (
    cd "$srcdir/$pkgbasename"
    python setup.py build
  )
  (
    cd "$srcdir/$pkgbasename-py2"
    python2 setup.py build
  )
}

package_ivre-git() {
  depends=('python-ivre-git')
  optdepends=('ivre-docs-git: Documentation'
              'ivre-web-git: Web server'
              'nmap: Network scan'
              'masscan: Network scan'
              'zmap: Network scan'
              'zeek: Network traffic analysis'
              'argus: Network traffic analysis'
              'nfdump: Netflow analysis'
              'imagemagick: Screenshots via Nmap scripts'
              'phantomjs: HTTP screenshots via Nmap script'
              'ffmpeg: RTSP Screenshots via Nmap script')
  provides=('ivre')
  conflicts=('ivre')
  cd "$srcdir/$pkgbasename"
  python setup.py install --root="${pkgdir}" --prefix=/usr --optimize=1
  rm -r "${pkgdir}/usr/lib" \
     "${pkgdir}/usr/share/doc" \
     "${pkgdir}/usr/share/ivre/dokuwiki" \
     "${pkgdir}/usr/share/ivre/web"
  install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" doc/license*
}

package_ivre-docs-git() {
  provides=('ivre-docs')
  conflicts=('ivre-docs')
  pkgdesc+=' (documentation)'
  cd "$srcdir/$pkgbasename"
  python setup.py install --root="${pkgdir}" --prefix=/usr --optimize=1
  cp README.md "${pkgdir}/usr/share/doc/ivre/"
  mv "${pkgdir}/usr/share/ivre/web/static/doc" "${pkgdir}/usr/share/doc/ivre/html"
  rm -r "${pkgdir}/usr/bin" "${pkgdir}/usr/lib" \
     "${pkgdir}/usr/share/ivre" \
     "${pkgdir}/etc/bash_completion.d"
}

package_ivre-web-git() {
  depends=('ivre-git' 'python-bottle')
  optdepends=('apache: Web server'
              'mod_wsgi: Web server'
              'dokuwiki: Web server (notebook)')
  provides=('ivre-web')
  conflicts=('ivre-web')
  pkgdesc+=' (web application)'
  backup=('etc/httpd/conf/extra/ivre.conf')
  cd "$srcdir/$pkgbasename"
  python setup.py install --root="${pkgdir}" --prefix=/usr --optimize=1
  rm -r "${pkgdir}/usr/bin" "${pkgdir}/usr/lib" \
     "${pkgdir}/usr/share/doc" \
     "${pkgdir}/usr/share/ivre/bro" \
     "${pkgdir}/usr/share/ivre/data" \
     "${pkgdir}/usr/share/ivre/docker" \
     "${pkgdir}/usr/share/ivre/geoip" \
     "${pkgdir}/usr/share/ivre/honeyd" \
     "${pkgdir}/usr/share/ivre/nmap_scripts" \
     "${pkgdir}/etc/bash_completion.d"
  install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" doc/license*
  install -Dm0644 "pkg/apache/ivre.conf" "$pkgdir/etc/httpd/conf/extra/ivre.conf"
}

package_python-ivre-git() {
  depends=('python' 'python-pymongo' 'python-future')
  optdepends=('python-py2neo: experimental flow analysis (Neo4j backend)'
              'python-sqlalchemy: experimental PostgreSQL & SQLite backends'
              'python-psycopg2: experimental PostgreSQL backend'
              'python-pillow: trim screenshots on insertion'
              'tesseract: extract words from screenshots on insertion'
              'python-pycryptodome: extract data from public keys ("ivre getmoduli")'
              'python-scapy: parse PCAP files for ARP inspection (flow analysis)'
              'python-matplotlib: create graphs from command line tools'
              'python-dbus: 3D traceroute graphs'
              'mongodb: database server'
              'postgresql: database server (experimental backend)'
              'neo4j-community: database server (experimental flow analysis)')
  provides=('python-ivre')
  conflicts=('python-ivre')
  pkgdesc+=' (library)'
  cd "$srcdir/$pkgbasename"
  python setup.py install --root="${pkgdir}" --prefix=/usr --optimize=1
  rm -r "${pkgdir}/usr/bin" \
     "${pkgdir}/usr/share" \
     "${pkgdir}/etc/bash_completion.d"
  install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" doc/license*
}

package_python2-ivre-git() {
  depends=('python2' 'python2-pymongo' 'python2-future')
  optdepends=('python2-py2neo: experimental flow analysis (Neo4j backend)'
              'python2-sqlalchemy: experimental PostgreSQL & SQLite backends'
              'python2-psycopg2: experimental PostgreSQL backend'
              'python2-pillow: trim screenshots on insertion'
              'tesseract: extract words from screenshots on insertion'
              'python2-pycryptodome: extract data from public keys ("ivre getmoduli")'
              'python2-scapy: parse PCAP files for ARP inspection (flow analysis)'
              'python2-matplotlib: create graphs from command line tools'
              'python2-dbus: 3D traceroute graphs'
              'mongodb: database server'
              'postgresql: database server (experimental backend)'
              'neo4j-community: database server (experimental flow analysis)')
  provides=('python2-ivre')
  conflicts=('python2-ivre')
  pkgdesc+=' (library)'
  cd "$srcdir/$pkgbasename-py2"
  python2 setup.py install --root="${pkgdir}" --prefix=/usr --optimize=1
  rm -r "${pkgdir}/usr/bin" \
     "${pkgdir}/usr/share" \
     "${pkgdir}/etc/bash_completion.d"
  install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" doc/license*
}