summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apkbuild-cpan.in19
1 files changed, 9 insertions, 10 deletions
diff --git a/apkbuild-cpan.in b/apkbuild-cpan.in
index 6f9290b..3bda5df 100644
--- a/apkbuild-cpan.in
+++ b/apkbuild-cpan.in
@@ -38,11 +38,10 @@ depends="$cpandepends"
makedepends="perl-dev $cpanmakedepends"
subpackages="$pkgname-doc"
source="[% source %]"
-
-_builddir="$srcdir/$_pkgreal-$pkgver"
+builddir="$srcdir/$_pkgreal-$pkgver"
prepare() {
- cd "$_builddir"
+ cd "$builddir"
if [ -e Build.PL ]; then
perl Build.PL installdirs=vendor || return 1
else
@@ -159,7 +158,7 @@ sub prepare_tree {
sub update_functions {
my $apkbuild = read_apkbuild;
my $metaprefix = "src/" . $apkbuild->{'_pkgreal'} . "-" . $apkbuild->{'pkgver'} . "/";
- my $prepare_func;
+ my $prepare_func;
my $build_func;
my $package_func;
@@ -167,21 +166,21 @@ sub update_functions {
if (-e "$metaprefix/Build.PL" ) {
$prepare_func = <<'EOF';
prepare() {
- cd "$_builddir"
+ cd "$builddir"
export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
perl Build.PL installdirs=vendor || return 1
}
EOF
$build_func = <<'EOF';
build() {
- cd "$_builddir"
+ cd "$builddir"
export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
./Build && ./Build test
}
EOF
$package_func = <<'EOF';
package() {
- cd "$_builddir"
+ cd "$builddir"
./Build install destdir="$pkgdir" || return 1
find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}
@@ -189,21 +188,21 @@ EOF
} else {
$prepare_func = <<'EOF';
prepare() {
- cd "$_builddir"
+ cd "$builddir"
export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}
EOF
$build_func = <<'EOF';
build() {
- cd "$_builddir"
+ cd "$builddir"
export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
make && make test
}
EOF
$package_func = <<'EOF';
package() {
- cd "$_builddir"
+ cd "$builddir"
make DESTDIR="$pkgdir" install || return 1
find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}