aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2018-08-20 06:53:13 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2018-08-20 07:47:37 +0000
commit561f1af4a4c75bda13026c9111a9b7f790d2f583 (patch)
tree890617454c098b5aac86fcc298c731ded4b25b52
parentecf00d68ffcd80debd7d3cf717c97cf1b17aa388 (diff)
downloadaports-561f1af4a4c75bda13026c9111a9b7f790d2f583.tar.bz2
aports-561f1af4a4c75bda13026c9111a9b7f790d2f583.tar.xz
main/perl-test-mockmodule: new aport
Override subroutines in a module for unit testing
-rw-r--r--main/perl-test-mockmodule/APKBUILD41
1 files changed, 41 insertions, 0 deletions
diff --git a/main/perl-test-mockmodule/APKBUILD b/main/perl-test-mockmodule/APKBUILD
new file mode 100644
index 0000000000..9e466cd422
--- /dev/null
+++ b/main/perl-test-mockmodule/APKBUILD
@@ -0,0 +1,41 @@
+# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
+pkgname=perl-test-mockmodule
+_pkgname=Test-MockModule
+pkgver=0.15
+pkgrel=0
+pkgdesc="Override subroutines in a module for unit testing"
+url="https://metacpan.org/release/Test-MockModule"
+arch="noarch"
+license="GPL-1.0-or-later PerlArtistic"
+depends="perl"
+makedepends="perl-dev perl-module-build perl-test-warnings perl-super
+ perl-sub-identify"
+subpackages="$pkgname-doc"
+source="https://cpan.metacpan.org/authors/id/G/GF/GFRANKS/Test-MockModule-$pkgver.tar.gz"
+builddir="$srcdir/$_pkgname-$pkgver"
+
+prepare() {
+ default_prepare
+ cd "$builddir"
+ export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
+ PERL_MM_USE_DEFAULT=1 perl Build.PL installdirs=vendor prefix=/usr
+}
+
+build() {
+ cd "$builddir"
+ export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
+ PERL_MM_USE_DEFAULT=1 perl Build
+}
+
+check() {
+ cd "$builddir"
+ PERL_MM_USE_DEFAULT=1 perl Build test
+}
+
+package() {
+ cd "$builddir"
+ PERL_MM_USE_DEFAULT=1 perl Build install destdir="$pkgdir"
+ find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
+}
+
+sha512sums="20f64f9984010ee0b3c26532a8835156b7cc8837e436c0785a2d3b7959cb01f07584b816d754da9f9205e457fe5d4a8316d984bf215d242000704fe0c52284a7 Test-MockModule-0.15.tar.gz"