Lines 2-7
Link Here
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/www-servers/apache/apache-2.2.6.ebuild,v 1.10 2007/09/11 20:21:51 wolf31o2 Exp $ |
3 |
# $Header: /var/cvsroot/gentoo-x86/www-servers/apache/apache-2.2.6.ebuild,v 1.10 2007/09/11 20:21:51 wolf31o2 Exp $ |
4 |
|
4 |
|
|
|
5 |
EAPI="prefix" |
6 |
|
5 |
inherit eutils flag-o-matic multilib autotools |
7 |
inherit eutils flag-o-matic multilib autotools |
6 |
|
8 |
|
7 |
# latest gentoo apache files |
9 |
# latest gentoo apache files |
Lines 18-24
Link Here
|
18 |
# some helper scripts are apache-1.1, thus both are here |
20 |
# some helper scripts are apache-1.1, thus both are here |
19 |
LICENSE="Apache-2.0 Apache-1.1" |
21 |
LICENSE="Apache-2.0 Apache-1.1" |
20 |
SLOT="2" |
22 |
SLOT="2" |
21 |
KEYWORDS="alpha amd64 ~arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~x86-fbsd" |
23 |
KEYWORDS="alpha amd64 ~arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~x86-fbsd ~x86-macos" |
22 |
IUSE="debug doc ldap mpm-event mpm-itk mpm-peruser mpm-prefork mpm-worker no-suexec selinux ssl static-modules threads" |
24 |
IUSE="debug doc ldap mpm-event mpm-itk mpm-peruser mpm-prefork mpm-worker no-suexec selinux ssl static-modules threads" |
23 |
|
25 |
|
24 |
DEPEND="dev-lang/perl |
26 |
DEPEND="dev-lang/perl |
Lines 81-87
Link Here
|
81 |
|
83 |
|
82 |
# setup apache user and group |
84 |
# setup apache user and group |
83 |
enewgroup apache 81 |
85 |
enewgroup apache 81 |
84 |
enewuser apache 81 -1 /var/www apache |
86 |
enewuser apache 81 -1 $EPREFIX/var/www apache |
85 |
|
87 |
|
86 |
if ! use no-suexec ; then |
88 |
if ! use no-suexec ; then |
87 |
elog |
89 |
elog |
Lines 91-97
Link Here
|
91 |
elog " SUEXEC_SAFEPATH: Default PATH for suexec (default: /usr/local/bin:/usr/bin:/bin)" |
93 |
elog " SUEXEC_SAFEPATH: Default PATH for suexec (default: /usr/local/bin:/usr/bin:/bin)" |
92 |
elog " SUEXEC_LOGFILE: Path to the suexec logfile (default: /var/log/apache2/suexec_log)" |
94 |
elog " SUEXEC_LOGFILE: Path to the suexec logfile (default: /var/log/apache2/suexec_log)" |
93 |
elog " SUEXEC_CALLER: Name of the user Apache is running as (default: apache)" |
95 |
elog " SUEXEC_CALLER: Name of the user Apache is running as (default: apache)" |
94 |
elog " SUEXEC_DOCROOT: Directory in which suexec will run scripts (default: /var/www)" |
96 |
elog " SUEXEC_DOCROOT: Directory in which suexec will run scripts (default: $EPREFIX/var/www)" |
95 |
elog " SUEXEC_MINUID: Minimum UID, which is allowed to run scripts via suexec (default: 1000)" |
97 |
elog " SUEXEC_MINUID: Minimum UID, which is allowed to run scripts via suexec (default: 1000)" |
96 |
elog " SUEXEC_MINGID: Minimum GID, which is allowed to run scripts via suexec (default: 100)" |
98 |
elog " SUEXEC_MINGID: Minimum GID, which is allowed to run scripts via suexec (default: 100)" |
97 |
elog " SUEXEC_USERDIR: User subdirectories (like /home/user/html) (default: public_html)" |
99 |
elog " SUEXEC_USERDIR: User subdirectories (like /home/user/html) (default: public_html)" |
Lines 104-109
Link Here
|
104 |
unpack ${A} |
106 |
unpack ${A} |
105 |
cd "${S}" |
107 |
cd "${S}" |
106 |
|
108 |
|
|
|
109 |
# Prepend the prefix to the install locations |
110 |
if ! test -z "$EPREFIX"; then |
111 |
sed -i -e "s| /| $EPREFIX/|" \ |
112 |
"${GENTOO_PATCHDIR}"/{conf/httpd.conf,init/*,patches/config.layout} |
113 |
fi |
114 |
# Prepend the prefix to the config files (unfortunally $EPREFIX is variable) |
115 |
if test ! -z "$EPREFIX"; then |
116 |
FILES=`find "${GENTOO_PATCHDIR}"/conf -type f` |
117 |
for FILE in $FILES; do |
118 |
mv $FILE $FILE.old |
119 |
perl -ne "s%([^\w\.])(/var|/usr|/etc|/sbin)%\$1$EPREFIX\$2%; print" < $FILE.old > $FILE |
120 |
rm $FILE.old |
121 |
done |
122 |
fi |
123 |
|
107 |
# Use correct multilib libdir in gentoo patches |
124 |
# Use correct multilib libdir in gentoo patches |
108 |
sed -i -e "s:/usr/lib:/usr/$(get_libdir):g" \ |
125 |
sed -i -e "s:/usr/lib:/usr/$(get_libdir):g" \ |
109 |
"${GENTOO_PATCHDIR}"/{conf/httpd.conf,init/*,patches/config.layout} \ |
126 |
"${GENTOO_PATCHDIR}"/{conf/httpd.conf,init/*,patches/config.layout} \ |
Lines 117-122
Link Here
|
117 |
# 80-99 Security patches (80_all_${PV}_cve-####-####.patch) |
134 |
# 80-99 Security patches (80_all_${PV}_cve-####-####.patch) |
118 |
|
135 |
|
119 |
epatch "${GENTOO_PATCHDIR}"/patches/*.patch |
136 |
epatch "${GENTOO_PATCHDIR}"/patches/*.patch |
|
|
137 |
if use x86-macos; then |
138 |
epatch ${FILESDIR}/${P}-macos-bindnow.patch |
139 |
fi |
120 |
|
140 |
|
121 |
# setup the filesystem layout config |
141 |
# setup the filesystem layout config |
122 |
cat "${GENTOO_PATCHDIR}"/patches/config.layout >> "${S}"/config.layout || \ |
142 |
cat "${GENTOO_PATCHDIR}"/patches/config.layout >> "${S}"/config.layout || \ |
Lines 134-140
Link Here
|
134 |
|
154 |
|
135 |
# Instead of filtering --as-needed (bug #128505), append --no-as-needed |
155 |
# Instead of filtering --as-needed (bug #128505), append --no-as-needed |
136 |
# Thanks to Harald van Dijk |
156 |
# Thanks to Harald van Dijk |
|
|
157 |
if ! use x86-macos; then |
137 |
append-ldflags -Wl,--no-as-needed |
158 |
append-ldflags -Wl,--no-as-needed |
|
|
159 |
fi |
138 |
|
160 |
|
139 |
# peruser MPM debugging with -X is nearly impossible |
161 |
# peruser MPM debugging with -X is nearly impossible |
140 |
use mpm-peruser && use debug && append-flags -DMPM_PERUSER_DEBUG |
162 |
use mpm-peruser && use debug && append-flags -DMPM_PERUSER_DEBUG |
Lines 157-175
Link Here
|
157 |
|
179 |
|
158 |
if use ssl; then |
180 |
if use ssl; then |
159 |
mods="${mods} ssl" |
181 |
mods="${mods} ssl" |
160 |
myconf="${myconf} --with-ssl=/usr --enable-ssl=${modtype}" |
182 |
myconf="${myconf} --with-ssl=$EPREFIX/usr --enable-ssl=${modtype}" |
161 |
fi |
183 |
fi |
162 |
|
184 |
|
163 |
# Only build suexec with USE=-no-suexec |
185 |
# Only build suexec with USE=-no-suexec |
164 |
if use no-suexec ; then |
186 |
if use no-suexec ; then |
165 |
myconf="${myconf} --disable-suexec" |
187 |
myconf="${myconf} --disable-suexec" |
166 |
else |
188 |
else |
167 |
myconf="${myconf} --with-suexec-safepath=${SUEXEC_SAFEPATH:-/usr/local/bin:/usr/bin:/bin}" |
189 |
myconf="${myconf} --with-suexec-safepath=${SUEXEC_SAFEPATH:-$EPREFIX/usr/local/bin:$EPREFIX/usr/bin:$EPREFIX/bin}" |
168 |
myconf="${myconf} --with-suexec-logfile=${SUEXEC_LOGFILE:-/var/log/apache2/suexec_log}" |
190 |
myconf="${myconf} --with-suexec-logfile=${SUEXEC_LOGFILE:-$EPREFIX/var/log/apache2/suexec_log}" |
169 |
myconf="${myconf} --with-suexec-bin=/usr/sbin/suexec" |
191 |
myconf="${myconf} --with-suexec-bin=/usr/sbin/suexec" |
170 |
myconf="${myconf} --with-suexec-userdir=${SUEXEC_USERDIR:-public_html}" |
192 |
myconf="${myconf} --with-suexec-userdir=${SUEXEC_USERDIR:-public_html}" |
171 |
myconf="${myconf} --with-suexec-caller=${SUEXEC_CALLER:-apache}" |
193 |
myconf="${myconf} --with-suexec-caller=${SUEXEC_CALLER:-apache}" |
172 |
myconf="${myconf} --with-suexec-docroot=${SUEXEC_DOCROOT:-/var/www}" |
194 |
myconf="${myconf} --with-suexec-docroot=${SUEXEC_DOCROOT:-$EPREFIX/var/www}" |
173 |
myconf="${myconf} --with-suexec-uidmin=${SUEXEC_MINUID:-1000}" |
195 |
myconf="${myconf} --with-suexec-uidmin=${SUEXEC_MINUID:-1000}" |
174 |
myconf="${myconf} --with-suexec-gidmin=${SUEXEC_MINGID:-100}" |
196 |
myconf="${myconf} --with-suexec-gidmin=${SUEXEC_MINGID:-100}" |
175 |
myconf="${myconf} --with-suexec-umask=${SUEXEC_UMASK:-077}" |
197 |
myconf="${myconf} --with-suexec-umask=${SUEXEC_UMASK:-077}" |
Lines 181-198
Link Here
|
181 |
# our myconf line too |
203 |
# our myconf line too |
182 |
|
204 |
|
183 |
econf \ |
205 |
econf \ |
184 |
--includedir=/usr/include/apache2 \ |
206 |
--includedir=$EPREFIX/usr/include/apache2 \ |
185 |
--libexecdir=/usr/$(get_libdir)/apache2/modules \ |
207 |
--libexecdir=$EPREFIX/usr/$(get_libdir)/apache2/modules \ |
186 |
--datadir=/var/www/localhost \ |
208 |
--datadir=$EPREFIX/var/www/localhost \ |
187 |
--sysconfdir=/etc/apache2 \ |
209 |
--sysconfdir=$EPREFIX/etc/apache2 \ |
188 |
--localstatedir=/var \ |
210 |
--localstatedir=$EPREFIX/var \ |
189 |
--with-mpm=${mpm} \ |
211 |
--with-mpm=${mpm} \ |
190 |
--with-perl=/usr/bin/perl \ |
212 |
--with-perl=$EPREFIX/usr/bin/perl \ |
191 |
--with-expat=/usr \ |
213 |
--with-expat=$EPREFIX/usr \ |
192 |
--with-z=/usr \ |
214 |
--with-z=$EPREFIX/usr \ |
193 |
--with-apr=/usr \ |
215 |
--with-apr=$EPREFIX/usr \ |
194 |
--with-apr-util=/usr \ |
216 |
--with-apr-util=$EPREFIX/usr \ |
195 |
--with-pcre=/usr \ |
217 |
--with-pcre=$EPREFIX/usr \ |
196 |
--with-port=80 \ |
218 |
--with-port=80 \ |
197 |
--with-program-name=apache2 \ |
219 |
--with-program-name=apache2 \ |
198 |
--enable-layout=Gentoo \ |
220 |
--enable-layout=Gentoo \ |
Lines 235-241
Link Here
|
235 |
# create our LoadModule lines |
257 |
# create our LoadModule lines |
236 |
if ! use static-modules ; then |
258 |
if ! use static-modules ; then |
237 |
load_module="" |
259 |
load_module="" |
238 |
moddir="${D}/usr/$(get_libdir)/apache2/modules" |
260 |
moddir="${ED}/usr/$(get_libdir)/apache2/modules" |
239 |
for m in $(echo ${mods}|tr ' ' '\n'|sort -u) ; do |
261 |
for m in $(echo ${mods}|tr ' ' '\n'|sort -u) ; do |
240 |
endid="no" |
262 |
endid="no" |
241 |
|
263 |
|
Lines 296-310
Link Here
|
296 |
|
318 |
|
297 |
# drop in a convenient link to the manual |
319 |
# drop in a convenient link to the manual |
298 |
if use doc ; then |
320 |
if use doc ; then |
299 |
sed -i -e "s:VERSION:${PVR}:" "${D}/etc/apache2/modules.d/00_apache_manual.conf" |
321 |
sed -i -e "s:VERSION:${PVR}:" "${ED}/etc/apache2/modules.d/00_apache_manual.conf" |
300 |
else |
322 |
else |
301 |
rm -f "${D}/etc/apache2/modules.d/00_apache_manual.conf" |
323 |
rm -f "${ED}/etc/apache2/modules.d/00_apache_manual.conf" |
302 |
rm -Rf "${D}/usr/share/doc/${PF}/manual" |
324 |
rm -Rf "${ED}/usr/share/doc/${PF}/manual" |
303 |
fi |
325 |
fi |
304 |
|
326 |
|
305 |
# the default webroot gets stored in /usr/share/doc |
327 |
# the default webroot gets stored in /usr/share/doc |
306 |
ebegin "Installing default webroot to /usr/share/doc/${PF}" |
328 |
ebegin "Installing default webroot to /usr/share/doc/${PF}" |
307 |
mv -f "${D}/var/www/localhost" "${D}/usr/share/doc/${PF}/webroot" |
329 |
mv -f "${ED}/var/www/localhost" "${ED}/usr/share/doc/${PF}/webroot" |
308 |
eend $? |
330 |
eend $? |
309 |
keepdir /var/www/localhost/htdocs |
331 |
keepdir /var/www/localhost/htdocs |
310 |
|
332 |
|
Lines 330-341
Link Here
|
330 |
|
352 |
|
331 |
pkg_postinst() { |
353 |
pkg_postinst() { |
332 |
# Automatically generate test certificates if ssl USE flag is being set |
354 |
# Automatically generate test certificates if ssl USE flag is being set |
333 |
if use ssl && [[ ! -e "${ROOT}/etc/apache2/ssl/server.crt" ]] ; then |
355 |
if use ssl && [[ ! -e "${EROOT}/etc/apache2/ssl/server.crt" ]] ; then |
334 |
cd "${ROOT}"/etc/apache2/ssl |
356 |
cd "${EROOT}"/etc/apache2/ssl |
335 |
einfo |
357 |
einfo |
336 |
einfo "Generating self-signed test certificate in ${ROOT}/etc/apache2/ssl ..." |
358 |
einfo "Generating self-signed test certificate in ${EROOT}/etc/apache2/ssl ..." |
337 |
yes "" 2>/dev/null | \ |
359 |
yes "" 2>/dev/null | \ |
338 |
"${ROOT}"/usr/sbin/gentestcrt.sh >/dev/null 2>&1 || \ |
360 |
"${EROOT}"/usr/sbin/gentestcrt.sh >/dev/null 2>&1 || \ |
339 |
die "gentestcrt.sh failed" |
361 |
die "gentestcrt.sh failed" |
340 |
einfo |
362 |
einfo |
341 |
fi |
363 |
fi |
Lines 344-372
Link Here
|
344 |
# that exist elsewhere and we don't want them managed/removed by portage |
366 |
# that exist elsewhere and we don't want them managed/removed by portage |
345 |
# when apache is upgraded. |
367 |
# when apache is upgraded. |
346 |
|
368 |
|
347 |
if [[ -e "${ROOT}/var/www/localhost" ]] ; then |
369 |
if [[ -e "${EROOT}/var/www/localhost" ]] ; then |
348 |
elog "The default webroot has not been installed into" |
370 |
elog "The default webroot has not been installed into" |
349 |
elog "${ROOT}/var/www/localhost because the directory already exists" |
371 |
elog "${EROOT}/var/www/localhost because the directory already exists" |
350 |
elog "and we do not want to overwrite any files you have put there." |
372 |
elog "and we do not want to overwrite any files you have put there." |
351 |
elog |
373 |
elog |
352 |
elog "If you would like to install the latest webroot, please run" |
374 |
elog "If you would like to install the latest webroot, please run" |
353 |
elog "emerge --config =${PF}" |
375 |
elog "emerge --config =${PF}" |
354 |
else |
376 |
else |
355 |
einfo "Installing default webroot to ${ROOT}/var/www/localhost" |
377 |
einfo "Installing default webroot to ${EROOT}/var/www/localhost" |
356 |
mkdir -p "${ROOT}"/var/www/localhost |
378 |
mkdir -p "${EROOT}"/var/www/localhost |
357 |
cp -R "${ROOT}"/usr/share/doc/${PF}/webroot/* "${ROOT}"/var/www/localhost |
379 |
cp -R "${EROOT}"/usr/share/doc/${PF}/webroot/* "${EROOT}"/var/www/localhost |
358 |
chown -R apache:0 "${ROOT}"/var/www/localhost |
380 |
chown -R apache:0 "${EROOT}"/var/www/localhost |
359 |
fi |
381 |
fi |
360 |
|
382 |
|
361 |
# Previous installations of apache-2.2 installed the upstream configuration |
383 |
# Previous installations of apache-2.2 installed the upstream configuration |
362 |
# files, which shouldn't even have been installed! |
384 |
# files, which shouldn't even have been installed! |
363 |
if has_version '>=www-servers/apache-2.2.4' ; then |
385 |
if has_version '>=www-servers/apache-2.2.4' ; then |
364 |
[ -f "${ROOT}"/etc/apache2/apache2.conf ] && \ |
386 |
[ -f "${EROOT}"/etc/apache2/apache2.conf ] && \ |
365 |
rm -f "${ROOT}"/etc/apache2/apache2.conf >/dev/null 2>&1 |
387 |
rm -f "${EROOT}"/etc/apache2/apache2.conf >/dev/null 2>&1 |
366 |
|
388 |
|
367 |
for i in extra original ; do |
389 |
for i in extra original ; do |
368 |
[ -d "${ROOT}"/etc/apache2/$i ] && \ |
390 |
[ -d "${EROOT}"/etc/apache2/$i ] && \ |
369 |
rm -rf "${ROOT}"/etc/apache2/$i >/dev/null 2>&1 |
391 |
rm -rf "${EROOT}"/etc/apache2/$i >/dev/null 2>&1 |
370 |
done |
392 |
done |
371 |
fi |
393 |
fi |
372 |
|
394 |
|
Lines 403-414
Link Here
|
403 |
elog "to continue working correctly." |
425 |
elog "to continue working correctly." |
404 |
elog |
426 |
elog |
405 |
elog "Also note that some configuration directives have been" |
427 |
elog "Also note that some configuration directives have been" |
406 |
elog "split into their own files under ${ROOT}/etc/apache2/modules.d/" |
428 |
elog "split into their own files under ${EROOT}/etc/apache2/modules.d/" |
407 |
elog "and that some modules, foremost the authentication related ones," |
429 |
elog "and that some modules, foremost the authentication related ones," |
408 |
elog "have been renamed." |
430 |
elog "have been renamed." |
409 |
elog |
431 |
elog |
410 |
elog "Some examples:" |
432 |
elog "Some examples:" |
411 |
elog " - USERDIR is now configureable in ${ROOT}etc/apache2/modules.d/00_mod_userdir.conf." |
433 |
elog " - USERDIR is now configureable in ${EROOT}etc/apache2/modules.d/00_mod_userdir.conf." |
412 |
elog |
434 |
elog |
413 |
elog "For more information on what you may need to change, please" |
435 |
elog "For more information on what you may need to change, please" |
414 |
elog "see the overview of changes at:" |
436 |
elog "see the overview of changes at:" |
Lines 420-431
Link Here
|
420 |
|
442 |
|
421 |
# Cleanup the vim backup files, placed in /etc/apache2 by the last |
443 |
# Cleanup the vim backup files, placed in /etc/apache2 by the last |
422 |
# patchtarball (gentoo-apache-2.2.4-r7-20070615) |
444 |
# patchtarball (gentoo-apache-2.2.4-r7-20070615) |
423 |
rm -f "${ROOT}/etc/apache2/modules.d/*.conf~" |
445 |
rm -f "${EROOT}/etc/apache2/modules.d/*.conf~" |
424 |
} |
446 |
} |
425 |
|
447 |
|
426 |
pkg_config() { |
448 |
pkg_config() { |
427 |
einfo "Installing default webroot to ${ROOT}/var/www/localhost" |
449 |
einfo "Installing default webroot to ${EROOT}/var/www/localhost" |
428 |
cp -R "${ROOT}"/usr/share/doc/${PF}/webroot/* "${ROOT}"/var/www/localhost |
450 |
cp -R "${EROOT}"/usr/share/doc/${PF}/webroot/* "${EROOT}"/var/www/localhost |
429 |
} |
451 |
} |
430 |
|
452 |
|
431 |
parse_modules_config() { |
453 |
parse_modules_config() { |
Lines 475-481
Link Here
|
475 |
} |
497 |
} |
476 |
|
498 |
|
477 |
select_modules_config() { |
499 |
select_modules_config() { |
478 |
parse_modules_config "${ROOT}"/etc/apache2/apache2-builtin-mods || \ |
500 |
parse_modules_config "${EROOT}"/etc/apache2/apache2-builtin-mods || \ |
479 |
parse_modules_config "${GENTOO_PATCHDIR}"/conf/apache2-builtin-mods || \ |
501 |
parse_modules_config "${GENTOO_PATCHDIR}"/conf/apache2-builtin-mods || \ |
480 |
return 1 |
502 |
return 1 |
481 |
} |
503 |
} |