Gentoo Archives: gentoo-commits

From: "Benedikt Boehm (hollow)" <hollow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-servers/apache: ChangeLog apache-2.2.6-r1.ebuild
Date: Fri, 21 Sep 2007 20:16:37
Message-Id: E1IYonb-0002f5-UU@stork.gentoo.org
1 hollow 07/09/21 20:08:27
2
3 Modified: ChangeLog
4 Added: apache-2.2.6-r1.ebuild
5 Log:
6 fix #192179, #192218, #192746, #193295, #193354
7 (Portage version: 2.1.3.9)
8
9 Revision Changes Path
10 1.31 www-servers/apache/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/apache/ChangeLog?rev=1.31&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/apache/ChangeLog?rev=1.31&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/apache/ChangeLog?r1=1.30&r2=1.31
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/www-servers/apache/ChangeLog,v
19 retrieving revision 1.30
20 retrieving revision 1.31
21 diff -u -r1.30 -r1.31
22 --- ChangeLog 16 Sep 2007 11:07:34 -0000 1.30
23 +++ ChangeLog 21 Sep 2007 20:08:27 -0000 1.31
24 @@ -1,6 +1,11 @@
25 # ChangeLog for www-servers/apache
26 # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/www-servers/apache/ChangeLog,v 1.30 2007/09/16 11:07:34 hollow Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/www-servers/apache/ChangeLog,v 1.31 2007/09/21 20:08:27 hollow Exp $
29 +
30 +*apache-2.2.6-r1 (21 Sep 2007)
31 +
32 + 21 Sep 2007; Benedikt Böhm <hollow@g.o> +apache-2.2.6-r1.ebuild:
33 + fix #192179, #192218, #192746, #193295, #193354
34
35 16 Sep 2007; Benedikt Böhm <hollow@g.o> apache-2.0.58-r2.ebuild,
36 apache-2.0.59-r5.ebuild, apache-2.0.61.ebuild, -apache-2.2.4-r12.ebuild:
37
38
39
40 1.1 www-servers/apache/apache-2.2.6-r1.ebuild
41
42 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/apache/apache-2.2.6-r1.ebuild?rev=1.1&view=markup
43 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/apache/apache-2.2.6-r1.ebuild?rev=1.1&content-type=text/plain
44
45 Index: apache-2.2.6-r1.ebuild
46 ===================================================================
47 # Copyright 1999-2007 Gentoo Foundation
48 # Distributed under the terms of the GNU General Public License v2
49 # $Header: /var/cvsroot/gentoo-x86/www-servers/apache/apache-2.2.6-r1.ebuild,v 1.1 2007/09/21 20:08:27 hollow Exp $
50
51 inherit eutils flag-o-matic multilib autotools
52
53 # latest gentoo apache files
54 GENTOO_PATCHNAME="gentoo-${PF}"
55 GENTOO_PATCHSTAMP="20070921"
56 GENTOO_DEVSPACE="hollow"
57 GENTOO_PATCHDIR="${WORKDIR}/${GENTOO_PATCHNAME}"
58
59 DESCRIPTION="The Apache Web Server."
60 HOMEPAGE="http://httpd.apache.org/"
61 SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2
62 http://dev.gentoo.org/~${GENTOO_DEVSPACE}/dist/apache/${GENTOO_PATCHNAME}-${GENTOO_PATCHSTAMP}.tar.bz2"
63
64 # some helper scripts are apache-1.1, thus both are here
65 LICENSE="Apache-2.0 Apache-1.1"
66 SLOT="2"
67 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
68 IUSE="debug doc ldap mpm-event mpm-itk mpm-peruser mpm-prefork mpm-worker no-suexec selinux ssl static-modules threads"
69
70 DEPEND="dev-lang/perl
71 =dev-libs/apr-1*
72 =dev-libs/apr-util-1*
73 dev-libs/expat
74 dev-libs/libpcre
75 sys-libs/zlib
76 ldap? ( =net-nds/openldap-2* )
77 selinux? ( sec-policy/selinux-apache )
78 ssl? ( dev-libs/openssl )
79 !=www-servers/apache-1*
80 !=app-admin/apache-tools-2.2.4-r2"
81
82 RDEPEND="${DEPEND}
83 app-misc/mime-types"
84
85 PDEPEND="~app-admin/apache-tools-${PV}"
86
87 S="${WORKDIR}/httpd-${PV}"
88
89 pkg_setup() {
90 if use ldap && ! built_with_use 'dev-libs/apr-util' ldap ; then
91 eerror "dev-libs/apr-util is missing LDAP support. For apache to have"
92 eerror "ldap support, apr-util must be built with the ldap USE-flag"
93 eerror "enabled."
94 die "ldap USE-flag enabled while not supported in apr-util"
95 fi
96
97 # Select the default MPM module
98 MPM_LIST="event itk peruser prefork worker"
99 for x in ${MPM_LIST} ; do
100 if use mpm-${x} ; then
101 if [[ "x${mpm}" == "x" ]] ; then
102 mpm=${x}
103 elog
104 elog "Selected MPM: ${mpm}"
105 elog
106 else
107 eerror "You have selected more then one mpm USE-flag."
108 eerror "Only one MPM is supported."
109 die "more then one mpm was specified"
110 fi
111 fi
112 done
113
114 if [[ "x${mpm}" == "x" ]] ; then
115 if use threads ; then
116 mpm=worker
117 elog
118 elog "Selected default threaded MPM: ${mpm}";
119 elog
120 else
121 mpm=prefork
122 elog
123 elog "Selected default MPM: ${mpm}";
124 elog
125 fi
126 fi
127
128 # setup apache user and group
129 enewgroup apache 81
130 enewuser apache 81 -1 /var/www apache
131
132 if ! use no-suexec ; then
133 elog
134 elog "You can manipulate several configure options of suexec"
135 elog "through the following environment variables:"
136 elog
137 elog " SUEXEC_SAFEPATH: Default PATH for suexec (default: /usr/local/bin:/usr/bin:/bin)"
138 elog " SUEXEC_LOGFILE: Path to the suexec logfile (default: /var/log/apache2/suexec_log)"
139 elog " SUEXEC_CALLER: Name of the user Apache is running as (default: apache)"
140 elog " SUEXEC_DOCROOT: Directory in which suexec will run scripts (default: /var/www)"
141 elog " SUEXEC_MINUID: Minimum UID, which is allowed to run scripts via suexec (default: 1000)"
142 elog " SUEXEC_MINGID: Minimum GID, which is allowed to run scripts via suexec (default: 100)"
143 elog " SUEXEC_USERDIR: User subdirectories (like /home/user/html) (default: public_html)"
144 elog " SUEXEC_UMASK: Umask for the suexec process (default: 077)"
145 elog
146 fi
147 }
148
149 src_unpack() {
150 unpack ${A}
151 cd "${S}"
152
153 # Use correct multilib libdir in gentoo patches
154 sed -i -e "s:/usr/lib:/usr/$(get_libdir):g" \
155 "${GENTOO_PATCHDIR}"/{conf/httpd.conf,init/*,patches/config.layout} \
156 || die "libdir sed failed"
157
158 #### Patch Organization
159 # 00-19 Gentoo specific (00_all_some-title.patch)
160 # 20-39 Additional MPMs (20_all_${MPM}_some-title.patch)
161 # 40-59 USE-flag based (40_all_${USE}_some-title.patch)
162 # 60-79 Version specific (60_all_${PV}_some-title.patch)
163 # 80-99 Security patches (80_all_${PV}_cve-####-####.patch)
164
165 epatch "${GENTOO_PATCHDIR}"/patches/*.patch
166
167 # setup the filesystem layout config
168 cat "${GENTOO_PATCHDIR}"/patches/config.layout >> "${S}"/config.layout || \
169 die "Failed preparing config.layout!"
170 sed -i -e "s:version:${PF}:g" "${S}"/config.layout
171
172 # patched-in MPMs need the build environment rebuilt
173 sed -i -e '/sinclude/d' configure.in
174 AT_GNUCONF_UPDATE=yes AT_M4DIR=build eautoreconf
175 }
176
177 src_compile() {
178 local modtype="shared" myconf=""
179 cd "${S}"
180
181 # Instead of filtering --as-needed (bug #128505), append --no-as-needed
182 # Thanks to Harald van Dijk
183 append-ldflags -Wl,--no-as-needed
184
185 # peruser MPM debugging with -X is nearly impossible
186 use mpm-peruser && use debug && append-flags -DMPM_PERUSER_DEBUG
187
188 use static-modules && modtype="static"
189 select_modules_config || die "determining modules failed"
190
191 if use ldap ; then
192 mods="${mods} ldap authnz_ldap"
193 myconf="${myconf} --enable-authnz-ldap=${modtype} --enable-ldap=${modtype}"
194 fi
195
196 if use threads || use mpm-worker || use mpm-event; then
197 mods="${mods} cgid"
198 myconf="${myconf} --enable-cgid=${modtype}"
199 else
200 mods="${mods} cgi"
201 myconf="${myconf} --enable-cgi=${modtype}"
202 fi
203
204 if use ssl; then
205 mods="${mods} ssl"
206 myconf="${myconf} --with-ssl=/usr --enable-ssl=${modtype}"
207 fi
208
209 # Only build suexec with USE=-no-suexec
210 if use no-suexec ; then
211 myconf="${myconf} --disable-suexec"
212 else
213 myconf="${myconf} --with-suexec-safepath=${SUEXEC_SAFEPATH:-/usr/local/bin:/usr/bin:/bin}"
214 myconf="${myconf} --with-suexec-logfile=${SUEXEC_LOGFILE:-/var/log/apache2/suexec_log}"
215 myconf="${myconf} --with-suexec-bin=/usr/sbin/suexec"
216 myconf="${myconf} --with-suexec-userdir=${SUEXEC_USERDIR:-public_html}"
217 myconf="${myconf} --with-suexec-caller=${SUEXEC_CALLER:-apache}"
218 myconf="${myconf} --with-suexec-docroot=${SUEXEC_DOCROOT:-/var/www}"
219 myconf="${myconf} --with-suexec-uidmin=${SUEXEC_MINUID:-1000}"
220 myconf="${myconf} --with-suexec-gidmin=${SUEXEC_MINGID:-100}"
221 myconf="${myconf} --with-suexec-umask=${SUEXEC_UMASK:-077}"
222 myconf="${myconf} --enable-suexec=${modtype}"
223 mods="${mods} suexec"
224 fi
225
226 # econf overwrites the stuff from config.layout, so we have to put them into
227 # our myconf line too
228
229 econf \
230 --includedir=/usr/include/apache2 \
231 --libexecdir=/usr/$(get_libdir)/apache2/modules \
232 --datadir=/var/www/localhost \
233 --sysconfdir=/etc/apache2 \
234 --localstatedir=/var \
235 --with-mpm=${mpm} \
236 --with-perl=/usr/bin/perl \
237 --with-expat=/usr \
238 --with-z=/usr \
239 --with-apr=/usr \
240 --with-apr-util=/usr \
241 --with-pcre=/usr \
242 --with-port=80 \
243 --with-program-name=apache2 \
244 --enable-layout=Gentoo \
245 $(use_enable debug maintainer-mode) \
246 $(use_enable debug exception-hook) \
247 ${myconf} ${MY_BUILTINS} || die "econf failed!"
248
249 sed -i -e 's:apache2\.conf:httpd.conf:' include/ap_config_auto.h
250
251 emake || die "emake failed"
252 }
253
254 src_install () {
255 emake DESTDIR="${D}" install || die "emake install failed"
256
257 # This is a mapping of module names to the -D options in APACHE2_OPTS
258 # Used for creating optional LoadModule lines
259 mod_defines="
260 auth_digest:AUTH_DIGEST
261 authnz_ldap:AUTHNZ_LDAP
262 cache:CACHE
263 dav:DAV
264 dav_fs:DAV
265 dav_lock:DAV
266 disk_cache:CACHE
267 file_cache:CACHE
268 info:INFO
269 ldap:LDAP
270 mem_cache:CACHE
271 proxy:PROXY
272 proxy_ajp:PROXY
273 proxy_balancer:PROXY
274 proxy_connect:PROXY
275 proxy_http:PROXY
276 ssl:SSL
277 status:INFO
278 suexec:SUEXEC
279 userdir:USERDIR
280 "
281
282 # create our LoadModule lines
283 if ! use static-modules ; then
284 load_module=""
285 moddir="${D}/usr/$(get_libdir)/apache2/modules"
286 for m in $(echo ${mods}|tr ' ' '\n'|sort -u) ; do
287 endid="no"
288
289 if [[ -e "${moddir}/mod_${m}.so" ]] ; then
290 for def in ${mod_defines} ; do
291 if [[ "${m}" == "${def%:*}" ]] ; then
292 load_module="${load_module}\n<IfDefine ${def#*:}>"
293 endid="yes"
294 fi
295 done
296 load_module="${load_module}\nLoadModule ${m}_module modules/mod_${m}.so"
297 if [[ "${endid}" == "yes" ]] ; then
298 load_module="${load_module}\n</IfDefine>"
299 fi
300 fi
301 done
302 fi
303 sed -i -e "s:%%LOAD_MODULE%%:${load_module}:" \
304 "${GENTOO_PATCHDIR}"/conf/httpd.conf || die "sed failed"
305
306 # Install our configuration files
307 insinto /etc/apache2
308 doins docs/conf/magic
309 doins -r "${GENTOO_PATCHDIR}"/conf/*
310 insinto /etc/logrotate.d
311 newins "${GENTOO_PATCHDIR}"/scripts/apache2-logrotate apache2
312
313 # generate a sane default APACHE2_OPTS
314 APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE"
315 use doc && APACHE2_OPTS="${APACHE2_OPTS} -D MANUAL"
316 use ssl && APACHE2_OPTS="${APACHE2_OPTS} -D SSL -D SSL_DEFAULT_VHOST"
317 use no-suexec || APACHE2_OPTS="${APACHE2_OPTS} -D SUEXEC"
318
319 sed -i -e "s:APACHE2_OPTS=\".*\":APACHE2_OPTS=\"${APACHE2_OPTS}\":" \
320 "${GENTOO_PATCHDIR}"/init/apache2.confd || die "sed failed"
321
322 newconfd "${GENTOO_PATCHDIR}"/init/apache2.confd apache2
323 newinitd "${GENTOO_PATCHDIR}"/init/apache2.initd apache2
324
325 # Link apache2ctl to the init script
326 dosym /etc/init.d/apache2 /usr/sbin/apache2ctl
327
328 # provide symlinks for all the stuff we no longer rename, bug 177697
329 for i in suexec apxs; do
330 dosym /usr/sbin/${i} /usr/sbin/${i}2
331 done
332
333 # Install some thirdparty scripts
334 exeinto /usr/sbin
335 use ssl && doexe "${GENTOO_PATCHDIR}"/scripts/gentestcrt.sh
336
337 # Install some documentation
338 dodoc ABOUT_APACHE CHANGES LAYOUT README README.platforms VERSIONING
339 dodoc "${GENTOO_PATCHDIR}"/docs/*
340
341 # drop in a convenient link to the manual
342 if use doc ; then
343 sed -i -e "s:VERSION:${PVR}:" "${D}/etc/apache2/modules.d/00_apache_manual.conf"
344 else
345 rm -f "${D}/etc/apache2/modules.d/00_apache_manual.conf"
346 rm -Rf "${D}/usr/share/doc/${PF}/manual"
347 fi
348
349 # the default webroot gets stored in /usr/share/doc
350 ebegin "Installing default webroot to /usr/share/doc/${PF}"
351 mv -f "${D}/var/www/localhost" "${D}/usr/share/doc/${PF}/webroot"
352 eend $?
353 keepdir /var/www/localhost/htdocs
354
355 if ! use no-suexec ; then
356 # Set some sane permissions for suexec
357 fowners 0:apache /usr/sbin/suexec
358 fperms 4710 /usr/sbin/suexec
359 fi
360
361 keepdir /etc/apache2/vhosts.d
362 keepdir /etc/apache2/modules.d
363
364 # empty dirs
365 for i in /var/lib/dav /var/log/apache2 /var/cache/apache2 ; do
366 keepdir ${i}
367 fowners apache:apache ${i}
368 fperms 0755 ${i}
369 done
370
371 # We'll be needing /etc/apache2/ssl if USE=ssl
372 use ssl && keepdir /etc/apache2/ssl
373 }
374
375 pkg_postinst() {
376 # Automatically generate test certificates if ssl USE flag is being set
377 if use ssl && [[ ! -e "${ROOT}/etc/apache2/ssl/server.crt" ]] ; then
378 cd "${ROOT}"/etc/apache2/ssl
379 einfo
380 einfo "Generating self-signed test certificate in ${ROOT}etc/apache2/ssl ..."
381 yes "" 2>/dev/null | \
382 "${ROOT}"/usr/sbin/gentestcrt.sh >/dev/null 2>&1 || \
383 die "gentestcrt.sh failed"
384 einfo
385 fi
386
387 # we do this here because the default webroot is a copy of the files
388 # that exist elsewhere and we don't want them managed/removed by portage
389 # when apache is upgraded.
390
391 if [[ -e "${ROOT}/var/www/localhost" ]] ; then
392 elog "The default webroot has not been installed into"
393 elog "${ROOT}var/www/localhost because the directory already exists"
394 elog "and we do not want to overwrite any files you have put there."
395 elog
396 elog "If you would like to install the latest webroot, please run"
397 elog "emerge --config =${PF}"
398 else
399 einfo "Installing default webroot to ${ROOT}var/www/localhost"
400 mkdir -p "${ROOT}"/var/www/localhost
401 cp -R "${ROOT}"/usr/share/doc/${PF}/webroot/* "${ROOT}"/var/www/localhost
402 chown -R apache:0 "${ROOT}"/var/www/localhost
403 fi
404
405 # Previous installations of apache-2.2 installed the upstream configuration
406 # files, which shouldn't even have been installed!
407 if has_version '>=www-servers/apache-2.2.4' ; then
408 [ -f "${ROOT}"/etc/apache2/apache2.conf ] && \
409 rm -f "${ROOT}"/etc/apache2/apache2.conf >/dev/null 2>&1
410
411 for i in extra original ; do
412 [ -d "${ROOT}"/etc/apache2/$i ] && \
413 rm -rf "${ROOT}"/etc/apache2/$i >/dev/null 2>&1
414 done
415 fi
416
417 # Note regarding IfDefine changes
418 if has_version '<www-servers/apache-2.2.6-r1' ; then
419 elog
420 elog "When upgrading from versions 2.2.6 or earlier, please be aware"
421 elog "that the define for mod_authnz_ldap has changed from AUTH_LDAP"
422 elog "to AUTHNZ_LDAP. Additionally mod_auth_digest needs to be enabled"
423 elog "with AUTH_DIGEST now."
424 elog
425 fi
426
427 # Note the changes regarding DEFAULT_VHOST and SSL_DEFAULT_VHOST
428 if has_version '<www-servers/apache-2.2.4-r7' ; then
429 elog
430 elog "Listen directives have been moved into the default virtual host"
431 elog "configuation. At least DEFAULT_VHOST has been enabled for you"
432 elog "(depending on your USE-flags."
433 elog
434 elog "If you disable DEFAULT_VHOST or SSL_DEFAULT_VHOST, there would"
435 elog "be no listening sockets available."
436 elog
437 fi
438
439 # Note the user of the config changes
440 if has_version '<www-servers/apache-2.2.4-r5' ; then
441 elog
442 elog "Please make sure that you update your /etc directory."
443 elog "Between the versions, we had to changes some config files"
444 elog "and move some stuff out of the main httpd.conf file to a seperate"
445 elog "modules.d entry."
446 elog
447 elog "Thus please update your /etc directory either via etc-update,"
448 elog "dispatch-conf or conf-update !"
449 elog
450 fi
451
452 # Check for dual/upgrade install
453 if has_version '<www-servers/apache-2.2.0' ; then
454 elog
455 elog "When upgrading from versions below 2.2.0 to this version, you"
456 elog "need to rebuild all your modules. Please do so for your modules"
457 elog "to continue working correctly."
458 elog
459 elog "Also note that some configuration directives have been"
460 elog "split into their own files under ${ROOT}etc/apache2/modules.d/"
461 elog "and that some modules, foremost the authentication related ones,"
462 elog "have been renamed."
463 elog
464 elog "Some examples:"
465 elog " - USERDIR is now configureable in ${ROOT}etc/apache2/modules.d/00_mod_userdir.conf."
466 elog
467 elog "For more information on what you may need to change, please"
468 elog "see the overview of changes at:"
469 elog "http://httpd.apache.org/docs/2.2/new_features_2_2.html"
470 elog "and the upgrading guide at:"
471 elog "http://httpd.apache.org/docs/2.2/upgrading.html"
472 elog
473 fi
474
475 # Cleanup the vim backup files, placed in /etc/apache2 by the last
476 # patchtarball (gentoo-apache-2.2.4-r7-20070615)
477 rm -f "${ROOT}/etc/apache2/modules.d/*.conf~"
478 }
479
480 pkg_config() {
481 einfo "Installing default webroot to ${ROOT}var/www/localhost"
482 cp -R "${ROOT}"/usr/share/doc/${PF}/webroot/* "${ROOT}"/var/www/localhost
483 }
484
485 parse_modules_config() {
486 local name=""
487 local disable=""
488 local version="undef"
489 MY_BUILTINS=""
490 mods=""
491 [[ -f "${1}" ]] || return 1
492
493 for i in $(sed 's/#.*//' < $1) ; do
494 if [[ "$i" == "VERSION:" ]] ; then
495 version="select"
496 elif [[ "${version}" == "select" ]] ; then
497 version="$i"
498 # start with - option for backwards compatibility only
499 elif [[ "$i" == "-" ]] ; then
500 disable="true"
501 elif [[ -z "${name}" ]] && [[ "$i" != "${i/mod_/}" ]] ; then
502 name="${i/mod_/}"
503 elif [[ -n "${disable}" ]] || [[ "$i" == "disabled" ]] ; then
504 MY_BUILTINS="${MY_BUILTINS} --disable-${name}"
505 name="" ; disable=""
506 elif [[ "$i" == "static" ]] || use static-modules ; then
507 MY_BUILTINS="${MY_BUILTINS} --enable-${name}=static"
508 name="" ; disable=""
509 elif [[ "$i" == "shared" ]] ; then
510 MY_BUILTINS="${MY_BUILTINS} --enable-${name}=shared"
511 mods="${mods} ${name}"
512 name="" ; disable=""
513 else
514 ewarn "Parse error in ${1} - unknown option: $i"
515 fi
516 done
517
518 # reject the file if it's unversioned or doesn't match our
519 # package major.minor. This is to make upgrading work smoothly.
520 if [[ "${version}" != "${PV%.*}" ]] ; then
521 mods=""
522 MY_BUILTINS=""
523 return 1
524 fi
525
526 einfo "Using ${1}"
527 einfo "options: ${MY_BUILTINS}"
528 einfo "LoadModules: ${mods}"
529 }
530
531 select_modules_config() {
532 parse_modules_config "${ROOT}"/etc/apache2/apache2-builtin-mods || \
533 parse_modules_config "${GENTOO_PATCHDIR}"/conf/apache2-builtin-mods || \
534 return 1
535 }
536
537
538
539 --
540 gentoo-commits@g.o mailing list