summaryrefslogtreecommitdiffstats
path: root/abs/core/perl_modules/perl-package-stash-xs/PKGBUILD
blob: 9b0a70863f6c019851e2d0584ead8fab3ffa5d4d (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
# $Id$
# Maintainer: Jonathan Steel <jsteel at aur.archlinux.org>
# Contributor: Justin Davis <jrcd83@gmail.com>

pkgname=perl-package-stash-xs
pkgver=0.28
pkgrel=7
pkgdesc="Faster and more correct implementation of the Package::Stash API"
arch=('x86_64')
url="http://search.cpan.org/dist/Package-Stash-XS"
license=('PerlArtistic' 'GPL')
depends=('perl')
makedepends=('perl-extutils-makemaker')
checkdepends=('perl-test-fatal' 'perl-test-requires')
options=('!emptydirs')
source=(http://search.cpan.org/CPAN/authors/id/D/DO/DOY/Package-Stash-XS-$pkgver.tar.gz)
md5sums=('9664356ec3be02626cbd3081ec246b70')

build() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor"     \
      PERL_MB_OPT="--installdirs vendor" \
      MODULEBUILDRC=/dev/null

    cd Package-Stash-XS-${pkgver}

    /usr/bin/perl Makefile.PL

    make
  )
}

check() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
    cd Package-Stash-XS-${pkgver}

    make test
  )
}

package() {
    cd Package-Stash-XS-${pkgver}

    make DESTDIR="$pkgdir"/ install
# template start; name=perl-binary-module-dependency; version=1;
if [[ $(find "$pkgdir/usr/lib/perl5/" -name "*.so") ]]; then
	_perlver_min=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]);')
	_perlver_max=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]+1);')
	depends+=("perl>=$_perlver_min" "perl<$_perlver_max")
fi
# template end;
}