/[gentoo-x86]/www-apache/mod_perl/mod_perl-2.0.4-r1.ebuild
Gentoo

Contents of /www-apache/mod_perl/mod_perl-2.0.4-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.17 - (show annotations) (download)
Tue Oct 30 20:25:29 2012 UTC (21 months, 3 weeks ago) by idl0r
Branch: MAIN
CVS Tags: HEAD
Changes since 1.16: +1 -1 lines
FILE REMOVED
Cleanup

(Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key B427ABC8)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-apache/mod_perl/mod_perl-2.0.4-r1.ebuild,v 1.16 2012/04/03 20:23:27 idl0r Exp $
4
5 EAPI="2"
6
7 inherit apache-module perl-module eutils multilib
8
9 DESCRIPTION="An embedded Perl interpreter for Apache2"
10 SRC_URI="mirror://apache/perl/${P}.tar.gz"
11 HOMEPAGE="http://perl.apache.org/"
12
13 LICENSE="GPL-2"
14 KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86"
15 IUSE=""
16 SLOT="1"
17
18 DEPEND="<www-servers/apache-2.4
19 >=dev-perl/Apache-Test-1.27
20 >=virtual/perl-CGI-3.08
21 >=virtual/perl-IO-Compress-1.09
22 dev-lang/perl
23 || ( www-servers/apache[-threads] dev-lang/perl[ithreads] )"
24 RDEPEND="${DEPEND}"
25 PDEPEND="dev-perl/Apache-Reload"
26
27 APACHE2_MOD_FILE="${S}/src/modules/perl/mod_perl.so"
28 APACHE2_MOD_CONF="2.0.3/75_${PN}"
29 APACHE2_MOD_DEFINE="PERL"
30
31 DOCFILES="Changes INSTALL LICENSE README STATUS"
32
33 need_apache2
34
35 src_prepare() {
36 # I am not entirely happy with this solution, but here's what's
37 # going on here if someone wants to take a stab at another
38 # approach. When userpriv compilation is off, then the make
39 # process drops to user "nobody" to run the test servers. This
40 # server is closed, and then the socket is rebound using
41 # SO_REUSEADDR. If the same user does this, there is no problem,
42 # and the socket may be rebound immediately. If a different user
43 # (yes, in my testing, even root) attempts to rebind, it fails.
44 # Since the "is the socket available yet" code and the
45 # second-batch bind call both run as root, this will fail.
46
47 # The upstream settings on my test machine cause the second batch
48 # of tests to fail, believing the socket to still be in use. I
49 # tried patching various parts to make them run as the user
50 # specified in $config->{vars}{user} using getpwnam, but found
51 # this patch to be fairly intrusive, because the userid must be
52 # restored and the patch must be applied to multiple places.
53
54 # For now, we will simply extend the timeout in hopes that in the
55 # non-userpriv case, the socket will clear from the kernel tables
56 # normally, and the tests will proceed.
57
58 # If anybody is still having problems, then commenting out "make
59 # test" below should allow the software to build properly.
60
61 # Robert Coie <rac@gentoo.org> 2003.05.06
62
63 sed -i -e "s/sleep \$_/sleep \$_ << 2/" \
64 "${S}"/Apache-Test/lib/Apache/TestServer.pm \
65 || die "problem editing TestServer.pm"
66
67 # rendhalver - this got redone for 2.0.1 and seems to fix the make test problems
68 epatch "${FILESDIR}"/mod_perl-2.0.1-sneak-tmpdir.patch
69
70 epatch "${FILESDIR}"/CVE-2009-0796.patch
71 }
72
73 src_configure() {
74 perl Makefile.PL \
75 PREFIX="${D}"/usr \
76 MP_TRACE=1 \
77 MP_DEBUG=1 \
78 MP_USE_DSO=1 \
79 MP_APXS=${APXS} \
80 INSTALLDIRS=vendor </dev/null || die
81 }
82
83 src_compile() {
84 # reported that parallel make is broken in bug 30257
85 emake -j1 || die
86 }
87
88 src_test() {
89 # make test notes whether it is running as root, and drops
90 # privileges all the way to "nobody" if so, so we must adjust
91 # write permissions accordingly in this case.
92
93 # IF YOU SUDO TO EMERGE AND HAVE !env_reset set testing will fail!
94 if [[ "$(id -u)" == "0" ]]; then
95 chown nobody:nobody "${WORKDIR}"
96 chown nobody:nobody "${T}"
97 fi
98
99 # this does not || die because of bug 21325. kudos to smark for
100 # the idea of setting HOME.
101 TMPDIR="${T}" HOME="${T}/" make test
102 }
103
104 src_install() {
105 apache-module_src_install
106
107 dodir "${APACHE_MODULESDIR}"
108 make install \
109 MODPERL_AP_LIBEXECDIR="${D}${APACHE_MODULESDIR}" \
110 MODPERL_AP_INCLUDEDIR="${D}${APACHE_INCLUDEDIR}" \
111 MP_INST_APACHE2=1 \
112 INSTALLDIRS=vendor || die
113
114 # rendhalver - fix the perllocal.pod that gets installed
115 # it seems to me that this has been getting installed for ages
116 fixlocalpod
117
118 insinto "${APACHE_MODULES_CONFDIR}"
119 doins "${FILESDIR}"/2.0.3/apache2-mod_perl-startup.pl
120 cp -pPR docs "${D}"/usr/share/doc/${PF}
121 cp -pPR todo "${D}"/usr/share/doc/${PF}
122
123 # this is an attempt to get @INC in line with /usr/bin/perl.
124 # there is blib garbage in the mainstream one that can only be
125 # useful during internal testing, so we wait until here and then
126 # just go with a clean slate. should be much easier to see what's
127 # happening and revert if problematic.
128 for FILE in $(grep -lr portage "${D}"/*|grep -v ".so"); do
129 sed -i -e "s:${D}:/:g" ${FILE}
130 done
131 }

  ViewVC Help
Powered by ViewVC 1.1.20