# Automatically generated by apkbuild-cpan, template 4
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=perl-authen-radius
pkgver=0.33
pkgrel=0
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=Authen-Radius
pkgdesc="Perl module for Authen-Radius"
url="https://metacpan.org/release/Authen-Radius/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl perl-net-ip perl-data-hexdump"
makedepends="freeradius-dev"
checkdepends="perl-test-nowarnings"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/P/PO/PORTAONE/Authen-Radius-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"
replaces="perl-radiusperl"
provides="perl-radiusperl=$pkgver-r$pkgrel"

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL \
		INSTALLDIRS=vendor \
		NO_PACKLIST=1 \
		NO_PERLLOCAL=1
	sed -i "s:/etc/raddb:$pkgdir/etc/raddb:" install-radius-db.PL
	make
}

check() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make test
}

package() {
	mkdir -p $pkgdir/etc/raddb
	make DESTDIR="$pkgdir" install
}

sha512sums="
cad0d643a5e3a6291ccd7e3c2f10c86c0a12412a3d6f69103021eb3b3cadd6bc203b43464b3b3a863e083d5740b9807c503c264961734690ce2c7e29ca830456  Authen-Radius-0.33.tar.gz
"
