# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=whois
pkgver=5.5.1
pkgrel=1
pkgdesc='Intelligent WHOIS client'
url='https://github.com/rfc1036/whois'
license=('GPL')
arch=('x86_64')
depends=('libidn2')
makedepends=('perl')
source=("http://ftp.debian.org/debian/pool/main/w/whois/${pkgname}_${pkgver}.tar.xz")
sha256sums=('ee8d802f2e6639d44db3c326f3f5e059a8571a8cd0da87e60c6ddb06713cac82')

backup=('etc/whois.conf')

build() {
	cd "${srcdir}/${pkgname}"

	make \
		CONFIG_FILE=/etc/whois.conf \
		CFLAGS="$CFLAGS $CPPFLAGS" \
		HAVE_ICONV=1
}

package() {
	cd "${srcdir}/${pkgname}"

	make prefix=/usr BASEDIR="${pkgdir}" install-whois
	install -D -m644 whois.conf "${pkgdir}/etc/whois.conf"
}
