Lines 9-14
Link Here
|
9 |
GENTOO_PATCHSTAMP="20050416" |
9 |
GENTOO_PATCHSTAMP="20050416" |
10 |
GENTOO_PATCHDIR="${WORKDIR}/${GENTOO_PATCHNAME}" |
10 |
GENTOO_PATCHDIR="${WORKDIR}/${GENTOO_PATCHNAME}" |
11 |
|
11 |
|
|
|
12 |
MPM_THREAD="mpm-leader mpm-threadpool mpm-worker" |
13 |
MPM_NTHREAD="mpm-peruser mpm-prefork" |
14 |
|
12 |
DESCRIPTION="The Apache Web Server, Version 2.0.x" |
15 |
DESCRIPTION="The Apache Web Server, Version 2.0.x" |
13 |
HOMEPAGE="http://httpd.apache.org/" |
16 |
HOMEPAGE="http://httpd.apache.org/" |
14 |
#SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2 |
17 |
#SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2 |
Lines 18-24
Link Here
|
18 |
LICENSE="Apache-2.0" |
21 |
LICENSE="Apache-2.0" |
19 |
SLOT="2" |
22 |
SLOT="2" |
20 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" |
23 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" |
21 |
IUSE="apache2 debug doc ldap mpm-leader mpm-peruser mpm-prefork mpm-threadpool mpm-worker no-suexec ssl static-modules threads" |
24 |
IUSE="apache2 debug doc ldap ${MPM_THREAD} ${MPM_NTHREAD} no-suexec ssl static-modules threads" |
22 |
|
25 |
|
23 |
RDEPEND="dev-lang/perl |
26 |
RDEPEND="dev-lang/perl |
24 |
~dev-libs/apr-0.9.6 |
27 |
~dev-libs/apr-0.9.6 |
Lines 35-40
Link Here
|
35 |
S="${WORKDIR}/httpd-${PV}" |
38 |
S="${WORKDIR}/httpd-${PV}" |
36 |
|
39 |
|
37 |
pkg_setup() { |
40 |
pkg_setup() { |
|
|
41 |
MPM=0 |
42 |
|
43 |
for mpm in ${MPM_THREAD} ${MPM_NTHREAD}; do |
44 |
if useq ${mpm}; then |
45 |
if [ ${MPM} != 0 ]; then |
46 |
echo |
47 |
eerror |
48 |
eerror "Only one MPM can be built, ${MPM} blocks ${mpm}" |
49 |
eerror |
50 |
die "You can build only one MPM" |
51 |
fi |
52 |
MPM=${mpm} |
53 |
fi |
54 |
done |
55 |
|
56 |
if [ ${MPM} = 0 ]; then |
57 |
if useq threads; then |
58 |
einfo "Threads specified without a mpm-specification, using mpm-worker." |
59 |
MPM="worker" |
60 |
else |
61 |
einfo "No MPM style was specified, defaulting to mpm-prefork." |
62 |
MPM="prefork" |
63 |
fi |
64 |
fi |
65 |
|
38 |
if use mpm-peruser; then |
66 |
if use mpm-peruser; then |
39 |
ewarn " -BIG- -FAT- -WARNING-" |
67 |
ewarn " -BIG- -FAT- -WARNING-" |
40 |
ewarn "" |
68 |
ewarn "" |
Lines 45-50
Link Here
|
45 |
ewarn "Continuing in 5 seconds.." |
73 |
ewarn "Continuing in 5 seconds.." |
46 |
sleep 5 |
74 |
sleep 5 |
47 |
fi |
75 |
fi |
|
|
76 |
|
77 |
for mpm in ${MPM_THREAD}; do |
78 |
if use ${mpm}; then |
79 |
ewarn " -BIG- -FAT- -WARNING-" |
80 |
ewarn |
81 |
ewarn "Some modules do are not written to be thread-safe, and may act" |
82 |
ewarn "incorrectly or may even segfault if used with a MPM that uses " |
83 |
ewarn "threads. Please investigate whether the modules you wish to use" |
84 |
ewarn "will work correctly with threads before using a threads MPM" |
85 |
ewarn |
86 |
ewarn "Continuing in 5 seconds.." |
87 |
sleep 5 |
88 |
fi |
89 |
done |
48 |
} |
90 |
} |
49 |
|
91 |
|
50 |
src_unpack() { |
92 |
src_unpack() { |
Lines 120-125
Link Here
|
120 |
--enable-layout=Gentoo \ |
162 |
--enable-layout=Gentoo \ |
121 |
--with-program-name=apache2 \ |
163 |
--with-program-name=apache2 \ |
122 |
--with-devrandom=/dev/urandom \ |
164 |
--with-devrandom=/dev/urandom \ |
|
|
165 |
--with-mpm=${MPM} \ |
123 |
--host=${CHOST} ${MY_BUILTINS}" |
166 |
--host=${CHOST} ${MY_BUILTINS}" |
124 |
|
167 |
|
125 |
# debugging support |
168 |
# debugging support |
Lines 127-140
Link Here
|
127 |
myconf="${myconf} --enable-maintainer-mode" |
170 |
myconf="${myconf} --enable-maintainer-mode" |
128 |
fi |
171 |
fi |
129 |
|
172 |
|
130 |
select_mpms |
173 |
./configure ${myconf} || die "bad ./configure please submit bug report to bugs.gentoo.org. Include your config.layout and config.log" |
131 |
|
|
|
132 |
# now we build each mpm |
133 |
for mpm in ${mpms}; do |
134 |
# clean up |
135 |
cd server; make clean; cd .. |
136 |
|
137 |
./configure --with-mpm=${mpm} ${myconf} || die "bad ./configure please submit bug report to bugs.gentoo.org. Include your config.layout and config.log" |
138 |
|
174 |
|
139 |
# we don't want to try and recompile the ssl_expr_parse.c file, because |
175 |
# we don't want to try and recompile the ssl_expr_parse.c file, because |
140 |
# the lex source is broken |
176 |
# the lex source is broken |
Lines 145-153
Link Here
|
145 |
|
181 |
|
146 |
emake || die "problem compiling apache2" |
182 |
emake || die "problem compiling apache2" |
147 |
|
183 |
|
148 |
mv apache2 apache2.${mpm} |
|
|
149 |
done |
150 |
|
151 |
# build ssl version of apache bench (ab-ssl) |
184 |
# build ssl version of apache bench (ab-ssl) |
152 |
if useq ssl; then |
185 |
if useq ssl; then |
153 |
cd support |
186 |
cd support |
Lines 196-214
Link Here
|
196 |
# the ssl version of apache bench |
229 |
# the ssl version of apache bench |
197 |
useq ssl && doexe support/ab-ssl |
230 |
useq ssl && doexe support/ab-ssl |
198 |
|
231 |
|
199 |
# install mpm bins |
|
|
200 |
for mpm in ${mpms}; do |
201 |
doexe ${S}/apache2.${mpm} |
202 |
done |
203 |
|
204 |
# symlink the default mpm |
205 |
for i in prefork worker peruser threadpool leader; do |
206 |
if [ -x ${D}/usr/sbin/apache2.${i} ]; then |
207 |
dosym /usr/sbin/apache2.${i} /usr/sbin/apache2 |
208 |
break |
209 |
fi |
210 |
done |
211 |
|
212 |
# modules.d config file snippets |
232 |
# modules.d config file snippets |
213 |
insinto /etc/apache2/modules.d |
233 |
insinto /etc/apache2/modules.d |
214 |
doins ${GENTOO_PATCHDIR}/conf/modules.d/45_mod_dav.conf |
234 |
doins ${GENTOO_PATCHDIR}/conf/modules.d/45_mod_dav.conf |
Lines 355-378
Link Here
|
355 |
einfo "USERDIR is set to: ${USERDIR}" |
375 |
einfo "USERDIR is set to: ${USERDIR}" |
356 |
} |
376 |
} |
357 |
|
377 |
|
358 |
select_mpms() { |
|
|
359 |
useq mpm-prefork && mpms="${mpms} prefork" |
360 |
useq mpm-worker && mpms="${mpms} worker" |
361 |
useq mpm-peruser && mpms="${mpms} peruser" |
362 |
useq mpm-threadpool && mpms="${mpms} threadpool" |
363 |
useq mpm-leader && mpms="${mpms} leader" |
364 |
|
365 |
if [ "x${mpms}" = "x" ]; then |
366 |
if useq threads; then |
367 |
einfo "Threads specified without a mpm-specification, using mpm-worker." |
368 |
mpms="worker" |
369 |
else |
370 |
einfo "No MPM style was specified, defaulting to mpm-prefork." |
371 |
mpms="prefork" |
372 |
fi |
373 |
fi |
374 |
} |
375 |
|
376 |
parse_modules_config() { |
378 |
parse_modules_config() { |
377 |
local name="" |
379 |
local name="" |
378 |
local disable="" |
380 |
local disable="" |