# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=yersinia
pkgver=0.8.2
pkgrel=4
pkgdesc="Framework for performing layer 2 attacks"
url="https://github.com/tomac/yersinia"
arch="all"
license="GPL"
makedepends="libnet-dev libpcap-dev ncurses-dev"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/tomac/yersinia/archive/v$pkgver.tar.gz
	0001-fix-compile-with-GCC-10.patch
	format-security.patch
	gcc14.patch
	"

prepare() {
	default_prepare
	update_config_guess
	update_config_sub
}

build() {
	./configure \
		--prefix=/usr \
		--with-pcap-includes=/usr/include \
		--disable-gtk
	CFLAGS="$CFLAGS -std=gnu89" \
	make
}

check() {
	make check
}

package() {
	make DESTDIR=$pkgdir install
}

sha512sums="
2c7c89f19b6791150c472a6066b6ffaf9ac5b3d1a3d2e6a27f91293bba9a0f72d147266731e5e2670e4bf7e67ccf04b6e353071ca42d3d281b25126c9bfcb1dd  yersinia-0.8.2.tar.gz
de7346e4ad2e77053d5de9fdce049c3dffc69ad08067676935ee53951aa4baa0510289d1a91593c595b9723aaa78876bf8e69d6767f3887a0b0b7cae92d2025d  0001-fix-compile-with-GCC-10.patch
ad28e44882e2f6b3d121bccadaabe648150dd86da90da69e447cfb9cc4b68890feaae659f71348e1fe0aa44a48ce829e7536318cae596556a2547064bb407167  format-security.patch
98a23f5ad4b3c2526b63f1c629cbeeed73e2c2136126a6276e0e30d7b8c1b99a6c406288dbb3474e3bfe3332dcbfbd8491db7c0d350eab3e5d690a27c2fe0685  gcc14.patch
"
