]> gitweb.michael.orlitzky.com - mjo-overlay.git/blob - www-apache/mod_perl/mod_perl-2.0.9.ebuild
fa8aa3f1f3b1f3557dc8e4a7477f0a243c4956f0
[mjo-overlay.git] / www-apache / mod_perl / mod_perl-2.0.9.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit depend.apache apache-module perl-module eutils
8
9 DESCRIPTION="An embedded Perl interpreter for Apache2"
10 HOMEPAGE="https://projects.apache.org/projects/mod_perl.html"
11 SRC_URI="mirror://apache/perl/${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="1"
15 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
16 IUSE="debug"
17
18 # Make sure we always use the latest Apache-Test version or even check the
19 # version of the bundled Apache-Test!
20 #
21 # We need both, apache and perl but either apache without threads or perl with
22 # ithreads, bug 373943
23 DEPEND="
24 >=dev-perl/CGI-3.08
25 dev-lang/perl[ithreads]
26 www-servers/apache
27 "
28 RDEPEND="${DEPEND}"
29 PDEPEND=">=dev-perl/Apache-Reload-0.11
30 >=dev-perl/Apache-SizeLimit-0.95"
31
32 APACHE2_MOD_FILE="${S}/src/modules/perl/mod_perl.so"
33 APACHE2_MOD_CONF="2.0.3/75_${PN}"
34 APACHE2_MOD_DEFINE="PERL"
35
36 RESTRICT=test
37
38 DOCFILES="Changes INSTALL README STATUS"
39
40 need_apache2_4
41
42 src_prepare() {
43 perl-module_src_prepare
44
45 # I am not entirely happy with this solution, but here's what's
46 # going on here if someone wants to take a stab at another
47 # approach. When userpriv compilation is off, then the make
48 # process drops to user "nobody" to run the test servers. This
49 # server is closed, and then the socket is rebound using
50 # SO_REUSEADDR. If the same user does this, there is no problem,
51 # and the socket may be rebound immediately. If a different user
52 # (yes, in my testing, even root) attempts to rebind, it fails.
53 # Since the "is the socket available yet" code and the
54 # second-batch bind call both run as root, this will fail.
55
56 # The upstream settings on my test machine cause the second batch
57 # of tests to fail, believing the socket to still be in use. I
58 # tried patching various parts to make them run as the user
59 # specified in $config->{vars}{user} using getpwnam, but found
60 # this patch to be fairly intrusive, because the userid must be
61 # restored and the patch must be applied to multiple places.
62
63 # For now, we will simply extend the timeout in hopes that in the
64 # non-userpriv case, the socket will clear from the kernel tables
65 # normally, and the tests will proceed.
66
67 # If anybody is still having problems, then commenting out "make
68 # test" below should allow the software to build properly.
69
70 # Robert Coie <rac@gentoo.org> 2003.05.06
71 # sed -i -e "s/sleep \$_/sleep \$_ << 2/" \
72 # "${S}"/Apache-Test/lib/Apache/TestServer.pm \
73 # || die "problem editing TestServer.pm"
74
75 # rendhalver - this got redone for 2.0.1 and seems to fix the make test problems
76 epatch "${FILESDIR}"/${PN}-2.0.1-sneak-tmpdir.patch
77 epatch "${FILESDIR}"/${PN}-2.0.4-inline.patch #550244
78
79 # bug 352724
80 rm -rf Apache-{Reload,SizeLimit}/ lib/Bundle/ || die
81 sed -i \
82 -e 's:^Apache-\(Reload\|SizeLimit\|Test\).*::' \
83 -e 's:^lib/Bundle/Apache2.pm::' \
84 MANIFEST || die
85
86 # 410453
87 epatch "${FILESDIR}/use-client_ip-client_add-instead-of-remote_ip-remote.patch"
88 epatch "${FILESDIR}/use-log.level-instead-of-loglevel.patch"
89 }
90
91 src_configure() {
92 local debug=$(usex debug 1 0)
93 perl Makefile.PL \
94 PREFIX="${EPREFIX}"/usr \
95 INSTALLDIRS=vendor \
96 MP_USE_DSO=1 \
97 MP_APXS=${APXS} \
98 MP_APR_CONFIG=/usr/bin/apr-1-config \
99 MP_TRACE=${debug} \
100 MP_DEBUG=${debug} \
101 || die
102 }
103
104 src_install() {
105 apache-module_src_install
106
107 default
108 #emake DESTDIR="${D}" install || die
109
110 # TODO: add some stuff from docs/ back?
111
112 # rendhalver - fix the perllocal.pod that gets installed
113 # it seems to me that this has been getting installed for ages
114 perl_delete_localpod
115 # Remove empty .bs files as well
116 perl_delete_packlist
117
118 insinto "${APACHE_MODULES_CONFDIR}"
119 doins "${FILESDIR}"/2.0.3/apache2-mod_perl-startup.pl
120
121 # this is an attempt to get @INC in line with /usr/bin/perl.
122 # there is blib garbage in the mainstream one that can only be
123 # useful during internal testing, so we wait until here and then
124 # just go with a clean slate. should be much easier to see what's
125 # happening and revert if problematic.
126
127 # Sorry for this evil hack...
128 perl_set_version # just to be sure...
129 sed -i \
130 -e "s,-I${S}/[^[:space:]\"\']\+[[:space:]]\?,,g" \
131 -e "s,-typemap[[:space:]]${S}/[^[:space:]\"\']\+[[:space:]]\?,,g" \
132 -e "s,${S}\(/[^[:space:]\"\']\+\)\?,/,g" \
133 "${D}/${VENDOR_ARCH}/Apache2/BuildConfig.pm" || die
134
135 for fname in $(find "${D}" -type f -not -name '*.so'); do
136 sed -i -e "s:\(${D}\|${S}\):/:g" ${fname} || die
137 done
138 # All the rest
139 perl_remove_temppath
140 }
141
142 pkg_postinst() {
143 apache-module_pkg_postinst
144 }