# Automatically generated by apkbuild-cpan, template 4
# Contributor: Timothy Legge <timlegge@gmail.com>
# Maintainer: Timothy Legge <timlegge@gmail.com>
pkgname=perl-crypt-smime
pkgver=0.30
pkgrel=1
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=Crypt-SMIME
pkgdesc="S/MIME message signing, verification, encryption and decryption"
url="https://metacpan.org/release/Crypt-SMIME/"
arch="all"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl"
makedepends="perl-dev perl-extutils-cchecker perl-test-exception perl-extutils-pkgconfig
	openssl-dev>3"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/M/MI/MIKAGE/Crypt-SMIME-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

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
	make
}

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

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

doc() {
	local file; find "$pkgdir" -name "*.pod" | while read -r file; do
		amove "${file#"$pkgdir"}"
	done
	default_doc
}

sha512sums="
6e8e3a16803f4381fb6513fb2f4f4fd866dbd11c92f40651dc44dbcb6b2b3d1be4caa9940109b3bb018b0188933477d7f567f403a0d1fe374c63c7b62d4adb82  Crypt-SMIME-0.30.tar.gz
"
