# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Jens Adam <jra@byte.cx>

pkgname=zmap
pkgver=2.1.0
pkgrel=1
pkgdesc='Fast network scanner designed for Internet-wide network surveys'
url='https://zmap.io/'
arch=('i686' 'x86_64')
license=('Apache')
depends=('gmp' 'hiredis' 'json-c' 'libpcap')
makedepends=('byacc' 'cmake' 'gengetopt')
backup=('etc/zmap/blacklist.conf' 'etc/zmap/zmap.conf')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/zmap/zmap/archive/v${pkgver}.tar.gz)
sha512sums=('b6e446fd71dc8580e0d23bf76ec2e3b555489abbad9a823405637a64349613ee657a925049b63365d1c048f74ba3c4bebaadde28d0c2802492de7db735c86320')

build() {
  cd ${pkgname}-${pkgver}
  cmake -DWITH_JSON=ON -DWITH_REDIS=ON
  make
}

package() {
  cd ${pkgname}-${pkgver}
  install -Dm 755 src/zmap "${pkgdir}/usr/bin/zmap"
  install -Dm 644 src/zmap.1 "${pkgdir}/usr/share/man/man1/zmap.1"
  install -Dm 644 conf/* -t "${pkgdir}/etc/zmap"
  for F in AUTHORS CHANGELOG INSTALL README.md; do
    install -Dm 644 "${F}" "${pkgdir}/usr/share/doc/zmap/${F}"
  done
  cp -a examples "${pkgdir}/usr/share/doc/zmap"
}

# vim: ts=2 sw=2 et:
