summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 257660a4efaf409d73dbee89b66940211217b408 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Maintainer: pappy <pa314159@users.noreply.github.com>

_cpan_name=Role-Basic
_cpan_desc="Just roles. Nothing else."
_cpan_author=ovid
_cpan_version=0.13
_cpan_md5=2985fbb47bd0a862bd56bc7cbba6e673

pkgrel=3
pkgname=perl-${_cpan_name,,}
pkgdesc=$_cpan_desc
pkgver=$_cpan_version
md5sums=($_cpan_md5)
depends=('perl')
makedepends=('perl-module-build')
checkdepends=('perl-test-simple')

_cpan_path=${_cpan_author:0:1}/${_cpan_author:0:2}/${_cpan_author}

url="http://search.cpan.org/~${_cpan_author}/${_cpan_name}-$pkgver"
source=("http://search.cpan.org/CPAN/authors/id/${_cpan_path^^}/${_cpan_name}-$pkgver.tar.gz")
license=('GPL' 'PerlArtistic')
options=(!emptydirs purge)
arch=('any')


build() {
	cd $srcdir/${_cpan_name}-$pkgver

	unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
	export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
	if [[ -f Build.PL ]]; then
		perl Build.PL
		./Build
	else
		perl Makefile.PL
		make
	fi
}

check() {
	cd $srcdir/${_cpan_name}-$pkgver

	unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
	export PERL_MM_USE_DEFAULT=1
	if [[ -f Build.PL ]]; then
		./Build test
	else
		make test
	fi
}

package() {
	cd $srcdir/${_cpan_name}-$pkgver

	unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
	if [[ -f Build.PL ]]; then
		./Build install --installdirs=vendor --destdir="$pkgdir"
	else
		make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
	fi
}