# Maintainer: David P. <megver83@parabola.nu>
# Contributor (Arch): Ermak <ermak@email.it>
# Contributor: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname='fpdns'
pkgver='20130404'
pkgrel=8
epoch=1
pkgdesc='Program that remotely determines DNS server versions.'
groups=('blackarch' 'blackarch-fingerprint')
url='https://github.com/kirei/fpdns'
depends=('perl')
license=('BSD3')
options=('!emptydirs')
arch=('any')
source=("https://github.com/kirei/fpdns/archive/${pkgver}.tar.gz")
sha1sums=('3c3b33df1861a1a9901601d6c2252b2427ba8763')

build() {
  cd "$srcdir/fpdns-$pkgver"

  eval $(perl -V:archname)

  /usr/bin/perl Makefile.PL \

    INSTALLARCHLIB=/usr/lib/perl5/current/$archname \
    INSTALLSITELIB=/usr/lib/perl5/site_perl/current \
    INSTALLSITEARCH=/usr/lib/perl5/site_perl/current/$archname

  /usr/bin/make
}

package() {
  cd "$srcdir/fpdns-$pkgver"

  install -Dm755 apps/fpdns "$pkgdir/usr/bin/fpdns"
  install -Dm444 blib/lib/Net/DNS/Fingerprint.pm \
    "$pkgdir/usr/lib/perl5/site_perl/Net/DNS/Fingerprint.pm"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/LICENSE"
}
