]> gitweb.michael.orlitzky.com - mjo-overlay.git/blob - www-apache/mod_perl/mod_perl-2.0.8-r2.ebuild
app-backup/backuppc: working apache-2.4 ebuild.
[mjo-overlay.git] / www-apache / mod_perl / mod_perl-2.0.8-r2.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/Apache-Test-1.360
25 >=dev-perl/CGI-3.08
26 dev-lang/perl[ithreads]
27 www-servers/apache
28 "
29 RDEPEND="${DEPEND}"
30 PDEPEND=">=dev-perl/Apache-Reload-0.11
31 >=dev-perl/Apache-SizeLimit-0.95"
32
33 APACHE2_MOD_FILE="${S}/src/modules/perl/mod_perl.so"
34 APACHE2_MOD_CONF="2.0.3/75_${PN}"
35 APACHE2_MOD_DEFINE="PERL"
36
37 SRC_TEST="do"
38
39 DOCFILES="Changes INSTALL README STATUS"
40
41 need_apache2_4
42
43 src_prepare() {
44 perl-module_src_prepare
45
46 # I am not entirely happy with this solution, but here's what's
47 # going on here if someone wants to take a stab at another
48 # approach. When userpriv compilation is off, then the make
49 # process drops to user "nobody" to run the test servers. This
50 # server is closed, and then the socket is rebound using
51 # SO_REUSEADDR. If the same user does this, there is no problem,
52 # and the socket may be rebound immediately. If a different user
53 # (yes, in my testing, even root) attempts to rebind, it fails.
54 # Since the "is the socket available yet" code and the
55 # second-batch bind call both run as root, this will fail.
56
57 # The upstream settings on my test machine cause the second batch
58 # of tests to fail, believing the socket to still be in use. I
59 # tried patching various parts to make them run as the user
60 # specified in $config->{vars}{user} using getpwnam, but found
61 # this patch to be fairly intrusive, because the userid must be
62 # restored and the patch must be applied to multiple places.
63
64 # For now, we will simply extend the timeout in hopes that in the
65 # non-userpriv case, the socket will clear from the kernel tables
66 # normally, and the tests will proceed.
67
68 # If anybody is still having problems, then commenting out "make
69 # test" below should allow the software to build properly.
70
71 # Robert Coie <rac@gentoo.org> 2003.05.06
72 # sed -i -e "s/sleep \$_/sleep \$_ << 2/" \
73 # "${S}"/Apache-Test/lib/Apache/TestServer.pm \
74 # || die "problem editing TestServer.pm"
75
76 # rendhalver - this got redone for 2.0.1 and seems to fix the make test problems
77 epatch "${FILESDIR}"/${PN}-2.0.1-sneak-tmpdir.patch
78 epatch "${FILESDIR}"/${PN}-2.0.4-inline.patch #550244
79
80 # bug 352724
81 epatch "${FILESDIR}/${P}-bundled-Apache-Test.patch"
82 rm -rf Apache-{Test,Reload,SizeLimit}/ lib/Bundle/
83 sed -i \
84 -e 's:^Apache-\(Reload\|SizeLimit\|Test\).*::' \
85 -e 's:^lib/Bundle/Apache2.pm::' \
86 MANIFEST || die
87
88 # 410453
89 epatch "${FILESDIR}/use-client_ip-client_add-instead-of-remote_ip-remote.patch"
90 epatch "${FILESDIR}/use-log.level-instead-of-loglevel.patch"
91 }
92
93 src_configure() {
94 local debug=$(usex debug 1 0)
95 perl Makefile.PL \
96 PREFIX="${EPREFIX}"/usr \
97 INSTALLDIRS=vendor \
98 MP_USE_DSO=1 \
99 MP_APXS=${APXS} \
100 MP_APR_CONFIG=/usr/bin/apr-1-config \
101 MP_TRACE=${debug} \
102 MP_DEBUG=${debug} \
103 || die
104 }
105
106 src_test() {
107 # make test notes whether it is running as root, and drops
108 # privileges all the way to "nobody" if so, so we must adjust
109 # write permissions accordingly in this case.
110
111 # IF YOU SUDO TO EMERGE AND HAVE !env_reset set testing will fail!
112 if [[ "$(id -u)" == "0" ]]; then
113 chown nobody:nobody "${WORKDIR}" "${T}"
114 fi
115
116 # this does not || die because of bug 21325. kudos to smark for
117 # the idea of setting HOME.
118 TMPDIR="${T}" HOME="${T}/" perl-module_src_test
119 }
120
121 src_install() {
122 apache-module_src_install
123
124 default
125 #emake DESTDIR="${D}" install || die
126
127 # TODO: add some stuff from docs/ back?
128
129 # rendhalver - fix the perllocal.pod that gets installed
130 # it seems to me that this has been getting installed for ages
131 perl_delete_localpod
132 # Remove empty .bs files as well
133 perl_delete_packlist
134
135 insinto "${APACHE_MODULES_CONFDIR}"
136 doins "${FILESDIR}"/2.0.3/apache2-mod_perl-startup.pl
137
138 # this is an attempt to get @INC in line with /usr/bin/perl.
139 # there is blib garbage in the mainstream one that can only be
140 # useful during internal testing, so we wait until here and then
141 # just go with a clean slate. should be much easier to see what's
142 # happening and revert if problematic.
143
144 # Sorry for this evil hack...
145 perl_set_version # just to be sure...
146 sed -i \
147 -e "s,-I${S}/[^[:space:]\"\']\+[[:space:]]\?,,g" \
148 -e "s,-typemap[[:space:]]${S}/[^[:space:]\"\']\+[[:space:]]\?,,g" \
149 -e "s,${S}\(/[^[:space:]\"\']\+\)\?,/,g" \
150 "${D}/${VENDOR_ARCH}/Apache2/BuildConfig.pm" || die
151
152 for fname in $(find "${D}" -type f -not -name '*.so'); do
153 grep -q "\(${D}\|${S}\)" "${fname}" && ewarn "QA: File contains a temporary path ${fname}"
154 sed -i -e "s:\(${D}\|${S}\):/:g" ${fname}
155 done
156 # All the rest
157 perl_remove_temppath
158 }
159
160 pkg_postinst() {
161 apache-module_pkg_postinst
162 }