1 |
commit: f0033250966ab2248ade9c51f12143607185c610 |
2 |
Author: Kent Fredric <kentnl <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 15 00:30:45 2017 +0000 |
4 |
Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 15 00:31:19 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f0033250 |
7 |
|
8 |
dev-perl/Apache-Test: Fix handling of optional dep on mod_perl |
9 |
|
10 |
Package-Manager: Portage-2.3.8, Repoman-2.3.3 |
11 |
|
12 |
dev-perl/Apache-Test/Apache-Test-1.400.0-r2.ebuild | 33 +++++++++++++++++++--- |
13 |
1 file changed, 29 insertions(+), 4 deletions(-) |
14 |
|
15 |
diff --git a/dev-perl/Apache-Test/Apache-Test-1.400.0-r2.ebuild b/dev-perl/Apache-Test/Apache-Test-1.400.0-r2.ebuild |
16 |
index 2c4a9339e93..652bbb3377f 100644 |
17 |
--- a/dev-perl/Apache-Test/Apache-Test-1.400.0-r2.ebuild |
18 |
+++ b/dev-perl/Apache-Test/Apache-Test-1.400.0-r2.ebuild |
19 |
@@ -12,7 +12,7 @@ DESCRIPTION="Test.pm wrapper with helpers for testing Apache" |
20 |
LICENSE="Apache-2.0" |
21 |
SLOT="0" |
22 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" |
23 |
-IUSE="" |
24 |
+IUSE="test" |
25 |
|
26 |
DEPEND="virtual/perl-ExtUtils-MakeMaker" |
27 |
|
28 |
@@ -39,7 +39,27 @@ src_install() { |
29 |
} |
30 |
# Parallel tests seem to be bad. |
31 |
DIST_TEST="do" |
32 |
+ |
33 |
+optdep_notice() { |
34 |
+ local i |
35 |
+ elog "This package has several modules which may require additional dependencies" |
36 |
+ elog "to use. However, it is up to you to install them separately if you need this" |
37 |
+ elog "optional functionality:" |
38 |
+ elog |
39 |
+ i="$(if has_version 'www-apache/mod_perl'; then echo '[I]'; else echo '[ ]'; fi)" |
40 |
+ elog " $i www-apache/mod_perl" |
41 |
+ elog " - Running Perl code natively in Apache via" |
42 |
+ elog " Apache::TestHandler, Apache::TestReportPerl, or Apache::TestSmokePerl" |
43 |
+ |
44 |
+ if use test; then |
45 |
+ elog |
46 |
+ elog "This module will perform additional tests if these dependencies are" |
47 |
+ elog "pre-installed" |
48 |
+ fi |
49 |
+} |
50 |
src_test() { |
51 |
+ optdep_notice |
52 |
+ echo |
53 |
local MODULES=( |
54 |
"Apache::Test ${DIST_VERSION}" |
55 |
"Apache::Test5005compat 0.01" |
56 |
@@ -53,14 +73,12 @@ src_test() { |
57 |
"Apache::TestConfigParrot" |
58 |
"Apache::TestConfigParse" |
59 |
"Apache::TestConfigPerl" |
60 |
- "Apache::TestHandler" |
61 |
"Apache::TestHarness" |
62 |
"Apache::TestHarnessPHP" |
63 |
"Apache::TestMB" |
64 |
"Apache::TestMM" |
65 |
"Apache::TestPerlDB" |
66 |
"Apache::TestReport" |
67 |
- "Apache::TestReportPerl" |
68 |
"Apache::TestRequest" |
69 |
"Apache::TestRun" |
70 |
"Apache::TestRunPHP 1.00" |
71 |
@@ -69,12 +87,16 @@ src_test() { |
72 |
"Apache::TestSSLCA" |
73 |
"Apache::TestServer" |
74 |
"Apache::TestSmoke" |
75 |
- "Apache::TestSmokePerl" |
76 |
"Apache::TestSort" |
77 |
"Apache::TestTrace 0.01" |
78 |
"Apache::TestUtil 0.02" |
79 |
"Bundle::ApacheTest ${DISTVERSION}" |
80 |
) |
81 |
+ has_version "www-apache/mod_perl" && MODULES+=( |
82 |
+ "Apache::TestHandler" |
83 |
+ "Apache::TestReportPerl" |
84 |
+ "Apache::TestSmokePerl" |
85 |
+ ) |
86 |
local failed=() |
87 |
for dep in "${MODULES[@]}"; do |
88 |
ebegin "Compile testing ${dep}" |
89 |
@@ -92,3 +114,6 @@ src_test() { |
90 |
perl_rm_files t/more/02testmore.t t/more/04testmore.t |
91 |
perl-module_src_test |
92 |
} |
93 |
+pkg_postinst() { |
94 |
+ use test || optdep_notice |
95 |
+} |