# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=perl-code-tidyall
pkgver=0.84
pkgrel=1
pkgdesc="all-in-one code tidier and validator"
url="https://metacpan.org/pod/Code::TidyAll"
arch="noarch"
license="GPL-1.0-only OR Artistic-1.0-Perl"
depends="
	perl
	perl-capture-tiny
	perl-config-ini-reader-ordered
	perl-file-which
	perl-file-pushd
	perl-ipc-run
	perl-ipc-system-simple
	perl-lib-relative
	perl-list-compare
	perl-list-someutils
	perl-ipc-run3
	perl-log-any
	perl-moo
	perl-scope-guard
	perl-specio
	perl-specio-library-path-tiny
	perl-test-differences
	perl-test-class-most
	perl-test-warnings
	perl-time-duration-parse
	perl-timedate
	"
checkdepends="perl-test-class perl-test-most"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/Code-TidyAll-$pkgver.tar.gz"
builddir="$srcdir/Code-TidyAll-$pkgver"

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL INSTALLDIRS=vendor
	make
}

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

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="
b1ce060e81b42f80bebec3ea28613fd54b8948df6c22939b2a274b96bcb3c3a36bf3c3d15c8459c377bf98cf6e56258df1eefe75580c46a284d8186c5110cbc5  Code-TidyAll-0.84.tar.gz
"
