aboutsummaryrefslogtreecommitdiffstats
path: root/community/perl-app-cpanminus/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/perl-app-cpanminus/APKBUILD')
-rw-r--r--community/perl-app-cpanminus/APKBUILD65
1 files changed, 45 insertions, 20 deletions
diff --git a/community/perl-app-cpanminus/APKBUILD b/community/perl-app-cpanminus/APKBUILD
index 3708885b8e9..4863079b7bb 100644
--- a/community/perl-app-cpanminus/APKBUILD
+++ b/community/perl-app-cpanminus/APKBUILD
@@ -4,18 +4,19 @@
pkgname=perl-app-cpanminus
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=App-cpanminus
-pkgver=1.7046
+pkgver=1.7047
pkgrel=0
pkgdesc="Get, unpack, build and install modules from CPAN"
url="https://metacpan.org/release/App-cpanminus/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
-depends="perl ssl_client ca-certificates-bundle"
+depends="perl wget"
options="net" # needed to ensure cpanminus is able to access CPAN
-subpackages="$pkgname-doc"
+subpackages="$pkgname-doc $pkgname-https"
source="https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-$pkgver.tar.gz
- use-https-mirrors.patch
+ app-cpanminus-https.patch
busybox-wget-compat.patch
+ cpanms
"
builddir="$srcdir/$_pkgreal-$pkgver"
_blibdir="$builddir/blib"
@@ -24,30 +25,45 @@ _blibdir="$builddir/blib"
# 1.7045-r0:
# - CVE-2020-16154
+prepare() {
+ install -Dvm644 lib/App/cpanminus.pm \
+ lib/App/cpanminus/https.pm
+ install -Dvm644 lib/App/cpanminus/fatscript.pm \
+ -t lib/App/cpanminus/https/
+
+ default_prepare
+}
+
build() {
export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
- # cpanm is the same as fatscript.pm, except for additional
- # processing by perlstrip. This removes whitespace and
- # comments, "minifying" the code. Unfortunately, cpanm
- # cannot be rebuilt by simply running perlstrip on a patched
- # fatscript.pm. So, we remove the "minified" code from cpanm,
- # and instead make it call into the patched fatscript.pm.
- # This line using sed should be stable, because the comments
- # it matches for deletion are script-generated, and any
- # other problems will be detected in check().
- sed -i -e '/^# DO NOT EDIT/,/# END OF FATPACK CODE/ d' \
- -re 's/^(use App::cpanminus::)(script)/\1fat\2/' \
- "$builddir"/bin/cpanm
+
+ # Generate manpage for cpanms
+ pod2man -u "$srcdir"/cpanms "$builddir"/cpanms.1
+
PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL INSTALLDIRS=vendor
make
+
+ install -Dvm755 "$srcdir"/cpanms -t "$_blibdir"/script/
+ install -Dvm644 "$builddir"/cpanms.1 -t "$_blibdir"/man1/
}
check() {
export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
make test
- # test if cpanm can access www.cpan.org
+
+ msg "Testing cpanm with GNU wget"
perl -I "$_blibdir"/lib \
"$_blibdir"/script/cpanm \
+ --verbose --no-lwp \
+ --from https://cpan.metacpan.org \
+ --showdeps App::cpanminus
+
+ msg "Testing cpanms with Busybox wget"
+ ln -sv "$(which busybox)" "$srcdir"/wget
+ export PATH="$srcdir:$PATH"
+ perl -I "$_blibdir"/lib \
+ "$_blibdir"/script/cpanms \
+ --verbose --no-lwp \
--showdeps App::cpanminus
}
@@ -56,8 +72,17 @@ package() {
find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}
+https() {
+ pkgdesc="$pkgdesc via HTTPS"
+ depends="perl ssl_client ca-certificates-bundle"
+
+ amove usr/bin/cpanms
+ amove usr/share/perl5/vendor_perl/App/cpanminus/https*
+}
+
sha512sums="
-ced5f264979eb50cc33ac566c0242998c9b9c158ba435b9a180810f58eaa0b28d0de70312ade10df0ee3808369423f7baa029f2be740461d20a695e5e24d0d9b App-cpanminus-1.7046.tar.gz
-b775836197d4ae2244a60ff3f2ba6cf2aa3217cc71686d20fae0eff6f2dfc222f4cfb73a97ffcaf5756c52312104130dc9e3837f1cf5d1b711d81b0bd7dd41ca use-https-mirrors.patch
-cd5aecb7f834dfef705f11fa8499b9257e299de862e1ef62d040da6b436191d7d42e48303113c118fb5604975a0ece950426c69382f1205328e9d28d08ac31e9 busybox-wget-compat.patch
+c58b58773b5cd06f346228af46136beffcf07cf49dd51c6d914e2fe4c2a592b5c94901510da8c7ff55795e6beb25bf5344ac798d817ab0a1f2450ff75cbaa17d App-cpanminus-1.7047.tar.gz
+947530e269342427580be2f5700c6a86edbd8c5b51e54a1fb9244fe57f27e292e77d7535b7199a5f5e2d0406a25c7a567d7fef8e0fe772bed23d9b62cbb1a8c8 app-cpanminus-https.patch
+ccdc214d914197f5336c93faa0e9db12b62c026c3fee5e699a2cec7ea7a6d14f2becb9d8777f165de18200c50d85109bc14f83539d52e4dd8bca45b072097f81 busybox-wget-compat.patch
+f5bddb41b2192b43ddf8565a7ff9549ae8f8c9779c1fd36a80010dae9b130d203c9c66207c0045f78140167c3384d62c534a7e05849a912819d0d50c5f174327 cpanms
"