# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=perl-code-tidyall
pkgver=0.85
pkgrel=0
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="
7355b72e7ff5b478646de05c71570003ccbf0c6e1807342d6725f19751fd927cb9b214d011ccb563650071fdc695e6386baf2c115432095b2974cbb142f81ed0  Code-TidyAll-0.85.tar.gz
"
