diff options
-rw-r--r-- | apkbuild-cpan.in | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/apkbuild-cpan.in b/apkbuild-cpan.in index 867c508..5400a4a 100644 --- a/apkbuild-cpan.in +++ b/apkbuild-cpan.in @@ -44,26 +44,15 @@ subpackages="$pkgname-doc" source="[% source %]" builddir="$srcdir/$_pkgreal-$pkgver" -prepare() { - default_prepare - - cd "$builddir" - if [ -e Build.PL ]; then - perl Build.PL installdirs=vendor - else - PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL INSTALLDIRS=vendor - fi -} - build() { : } -package() { +check() { : } -check() { +package() { : } @@ -116,8 +105,8 @@ sub write_apkbuild { my %repl = ( authors => ($authors or "# Contributor: $packager\n# Maintainer: $packager"), pkgname => map_cpan_to_apk($moddata->{distribution}), - pkgreal => $moddata->{distribution}, - pkgver => $moddata->{version}, + pkgreal => $moddata->{distribution}, + pkgver => $moddata->{version}, source => $moddata->{download_url}, ); $template =~ s/\[% (.*?) %\]/$repl{$1}/g; @@ -174,26 +163,17 @@ sub prepare_tree { sub update_functions { my $apkbuild = read_apkbuild; my $metaprefix = "src/" . $apkbuild->{'_pkgreal'} . "-" . $apkbuild->{'pkgver'} . "/"; - my $prepare_func; my $build_func; my $check_func; my $package_func; my $text = read_file "APKBUILD"; if (-e "$metaprefix/Build.PL" ) { - $prepare_func = <<'EOF'; -prepare() { - default_prepare - - cd "$builddir" - export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}') - perl Build.PL installdirs=vendor -} -EOF $build_func = <<'EOF'; build() { cd "$builddir" export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}') + perl Build.PL installdirs=vendor ./Build } EOF @@ -211,19 +191,11 @@ check() { } EOF } else { - $prepare_func = <<'EOF'; -prepare() { - default_prepare - - cd "$builddir" - export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}') - PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL INSTALLDIRS=vendor -} -EOF $build_func = <<'EOF'; build() { cd "$builddir" export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}') + PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL INSTALLDIRS=vendor make } EOF @@ -243,8 +215,6 @@ check() { EOF } - $text =~ s/^prepare\(\) \{.*?^\}\n/$prepare_func/smg or - die "Can't replace prepare function APKBUILD"; $text =~ s/^build\(\) \{.*?^\}\n/$build_func/smg or die "Can't replace build function APKBUILD"; $text =~ s/^package\(\) \{.*?^\}\n/$package_func/smg or |