# Maintainer: Konstantin Gizdov <arch at kge dot pw>
# Contributor: Baptiste Jonglez <baptiste--aur at jonglez dot org>
# Contributor: mortzu

pkgname=ipv6calc
pkgver=4.4.0
pkgrel=1
pkgdesc='Small utility to manipulate, convert and calculate (more than) IPv6 addresses'
url='https://www.deepspace6.net/projects/ipv6calc.html'
license=('GPL2')
arch=('x86_64')
optdepends=('perl: to run the provided scripts')
checkdepends=('perl-digest-sha1' 'perl-uri' 'perl-html-parser' 'perl-proc-processtable')
source=("https://www.bieringer.de/ftp/pub/linux/IPv6/ipv6calc/${pkgname}-${pkgver}.tar.gz"{,.asc}
        'anti-dos_test.patch')
b2sums=('051888aa43f4c87a182e171dd710ed244f7bc9ff2d0cc65074abe155149ea605d33cca747b40ee78cd5242a61b9c8c9225b5d5345b24f48469365548f81f73ec'
        'SKIP'
        '611bbcb7e7babeaf6ace8888230aa15ab5744fd228ec717ee7ff11f1be3dfe03944896ceab07dc36426a3e8c3daaea51c47ed06fc54b7c710cd3ea694f04696e')
validpgpkeys=('AAB38CB797C750C778C608C6DDEB141DF7380F61') # Peter Bieringer (Code Signing Key 2013) <code@bieringer.de>

prepare() {
  cd "${pkgname}-${pkgver}"
  patch -Np1 -i "${srcdir}/anti-dos_test.patch"

  autoconf
}

build() {
  cd "${pkgname}-${pkgver}"

  ./configure \
    --prefix="/usr" \
    --libdir="/usr/lib" \
    --datarootdir="/usr/share" \
    --enable-shared \
    --enable-bundled-md5
  make
}

check() {
  cd "${pkgname}-${pkgver}"

  make test-minimal
}

package() {
  cd "${pkgname}-${pkgver}"

  make DESTDIR="$pkgdir" install
}

# vim:set ts=2 sw=2 et:
