# Maintainer: 
pkgname=libpcap
pkgver=1.9.1
pkgrel=0
pkgdesc="System-independent interface for user-level packet capture"
url="http://www.tcpdump.org/"
arch="all"
options="!check"  # No test suite.
license="BSD-3-Clause"
depends=""
makedepends="autoconf bison bluez-dev flex linux-headers"
subpackages="$pkgname-doc $pkgname-dev"
source="http://www.tcpdump.org/release/$pkgname-$pkgver.tar.gz
	add-missing-header.patch
	"

# secfixes:
#   1.9.1-r0:
#     - CVE-2018-16301
#     - CVE-2019-15161
#     - CVE-2019-15162
#     - CVE-2019-15163
#     - CVE-2019-15164
#     - CVE-2019-15165

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-ipv6

	# seems to be problem with timestamps
	sleep 1
	./config.status

	make all shared
}

package() {
	make -j1 DESTDIR="$pkgdir" install install-shared
}

sha512sums="ae0d6b0ad8253e7e059336c0f4ed3850d20d7d2f4dc1d942c2951f99a5443a690f0cc42c6f8fdc4a0ccb19e9e985192ba6f399c4bde2c7076e420f547fddfb08  libpcap-1.9.1.tar.gz
d9bee430f26e647c4a7ddd5b1ddd588fadefd3a034710e9bdfa9ff1d8c18ad8f6c0be1c29c2261e7be89db7d7e545e30c7910f09f3f53701ce04421449328be2  add-missing-header.patch"