# $Id: PKGBUILD 200042 2013-11-22 04:06:40Z bisson $
# Contributor: Thomas Bächler <thomas@archlinux.org>
# Maintainer: Gaetan Bisson <bisson@archlinux.org>

pkgname=iana-etc
pkgver=2.30
pkgrel=4
pkgdesc='/etc/protocols and /etc/services provided by IANA'
url='http://sethwklein.net/iana-etc.html'
arch=('any')
license=('custom')
backup=('etc/'{protocols,services})
source=("http://sethwklein.net/${pkgname}-${pkgver}.tar.bz2"
        'protocols.gawk'
        'services.gawk'
        'newer.patch')
sha1sums=('218593bcb9264014c4e397d838b2c218eac9df06'
          '48c1b94d9069f73e8a919301da564f414c4108f8'
          'c04278a7f11466efc64b80c193ef630857d9698a'
          '2ff4a7aa0854a2b191b0b1a5c36eff072cd6885e')

prepare() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	cp ../protocols.gawk ../services.gawk .
	patch -p1 -i ../newer.patch
}

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make get
	make
}

check() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make test
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" install
	install -Dm644 COPYING "${pkgdir}/usr/share/licenses/iana-etc/LICENSE"
	install -Dm644 port-numbers.iana "${pkgdir}/usr/share/iana-etc/port-numbers.iana"
	install -Dm644 protocol-numbers.iana "${pkgdir}/usr/share/iana-etc/protocol-numbers.iana"
}
