diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2019-03-21 11:25:52 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-03-21 11:34:06 +0100 |
commit | 122bcd7cb27d10f0664318fa10334cd81ff06e20 (patch) | |
tree | 78f75cade72acfb6e5704a91a27e6a6df31d95d9 /apkbuild-cpan.in | |
parent | ede4203749459ab83351765ac6f10904344174c9 (diff) | |
download | abuild-122bcd7cb27d10f0664318fa10334cd81ff06e20.tar.bz2 abuild-122bcd7cb27d10f0664318fa10334cd81ff06e20.tar.xz |
apkbuild-cpan: remove prepare function from APKBUILD
the generation of Makefile is comparable with running configure, which
we normally do in the build() function, not in prepare.
also fix some whitespace damamge.
Diffstat (limited to 'apkbuild-cpan.in')
-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 |