/[gentoo-x86]/eclass/apache-2.eclass
Gentoo

Contents of /eclass/apache-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.35 - (show annotations) (download)
Wed Feb 12 00:03:21 2014 UTC (7 months ago) by vapier
Branch: MAIN
Changes since 1.34: +8 -1 lines
add sanity check on code execution in $T to weed out bad mount/kernel settings #500928

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/apache-2.eclass,v 1.34 2014/01/31 08:29:39 vapier Exp $
4
5 # @ECLASS: apache-2.eclass
6 # @MAINTAINER:
7 # apache-devs@gentoo.org
8 # @BLURB: Provides a common set of functions for apache-2.x ebuilds
9 # @DESCRIPTION:
10 # This eclass handles apache-2.x ebuild functions such as LoadModule generation
11 # and inter-module dependency checking.
12
13 inherit autotools eutils flag-o-matic multilib ssl-cert user toolchain-funcs
14
15 # ==============================================================================
16 # INTERNAL VARIABLES
17 # ==============================================================================
18
19 # @ECLASS-VARIABLE: GENTOO_PATCHNAME
20 # @DESCRIPTION:
21 # This internal variable contains the prefix for the patch tarball.
22 # Defaults to the full name and version (including revision) of the package.
23 # If you want to override this in an ebuild, use:
24 # ORIG_PR="(revision of Gentoo stuff you want)"
25 # GENTOO_PATCHNAME="gentoo-${PN}-${PV}${ORIG_PR:+-${ORIG_PR}}"
26 [[ -n "$GENTOO_PATCHNAME" ]] || GENTOO_PATCHNAME="gentoo-${PF}"
27
28 # @ECLASS-VARIABLE: GENTOO_PATCHDIR
29 # @DESCRIPTION:
30 # This internal variable contains the working directory where patches and config
31 # files are located.
32 # Defaults to the patchset name appended to the working directory.
33 [[ -n "$GENTOO_PATCHDIR" ]] || GENTOO_PATCHDIR="${WORKDIR}/${GENTOO_PATCHNAME}"
34
35 # @VARIABLE: GENTOO_DEVELOPER
36 # @DESCRIPTION:
37 # This variable needs to be set in the ebuild and contains the name of the
38 # gentoo developer who created the patch tarball
39
40 # @VARIABLE: GENTOO_PATCHSTAMP
41 # @DESCRIPTION:
42 # This variable needs to be set in the ebuild and contains the date the patch
43 # tarball was created at in YYYYMMDD format
44
45 # @VARIABLE: GENTOO_PATCH_A
46 # @DESCRIPTION:
47 # This variable should contain the entire filename of patch tarball.
48 # Defaults to the name of the patchset, with a datestamp.
49 [[ -n "$GENTOO_PATCH_A" ]] || GENTOO_PATCH_A="${GENTOO_PATCHNAME}-${GENTOO_PATCHSTAMP}.tar.bz2"
50
51 SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2
52 http://dev.gentoo.org/~${GENTOO_DEVELOPER}/dist/apache/${GENTOO_PATCH_A}"
53
54 # @VARIABLE: IUSE_MPMS_FORK
55 # @DESCRIPTION:
56 # This variable needs to be set in the ebuild and contains a list of forking
57 # (i.e. non-threaded) MPMs
58
59 # @VARIABLE: IUSE_MPMS_THREAD
60 # @DESCRIPTION:
61 # This variable needs to be set in the ebuild and contains a list of threaded
62 # MPMs
63
64 # @VARIABLE: IUSE_MODULES
65 # @DESCRIPTION:
66 # This variable needs to be set in the ebuild and contains a list of available
67 # built-in modules
68
69 IUSE_MPMS="${IUSE_MPMS_FORK} ${IUSE_MPMS_THREAD}"
70 IUSE="${IUSE} debug doc ldap selinux ssl static suexec threads"
71
72 for module in ${IUSE_MODULES} ; do
73 IUSE="${IUSE} apache2_modules_${module}"
74 done
75
76 for mpm in ${IUSE_MPMS} ; do
77 IUSE="${IUSE} apache2_mpms_${mpm}"
78 done
79
80 DEPEND="dev-lang/perl
81 =dev-libs/apr-1*
82 =dev-libs/apr-util-1*[ldap?]
83 dev-libs/libpcre
84 ldap? ( =net-nds/openldap-2* )
85 selinux? ( sec-policy/selinux-apache )
86 ssl? ( >=dev-libs/openssl-0.9.8f )
87 !=www-servers/apache-1*"
88 RDEPEND="${DEPEND}"
89 PDEPEND="~app-admin/apache-tools-${PV}"
90
91 S="${WORKDIR}/httpd-${PV}"
92
93 # ==============================================================================
94 # INTERNAL FUNCTIONS
95 # ==============================================================================
96
97 # @ECLASS-VARIABLE: MY_MPM
98 # @DESCRIPTION:
99 # This internal variable contains the selected MPM after a call to setup_mpm()
100
101 # @FUNCTION: setup_mpm
102 # @DESCRIPTION:
103 # This internal function makes sure that only one of APACHE2_MPMS was selected
104 # or a default based on USE=threads is selected if APACHE2_MPMS is empty
105 setup_mpm() {
106 MY_MPM=""
107 for x in ${IUSE_MPMS} ; do
108 if use apache2_mpms_${x} ; then
109 if [[ -z "${MY_MPM}" ]] ; then
110 MY_MPM=${x}
111 elog
112 elog "Selected MPM: ${MY_MPM}"
113 elog
114 else
115 eerror "You have selected more then one mpm USE-flag."
116 eerror "Only one MPM is supported."
117 die "more then one mpm was specified"
118 fi
119 fi
120 done
121
122 if [[ -z "${MY_MPM}" ]] ; then
123 if use threads ; then
124 MY_MPM=worker
125 elog
126 elog "Selected default threaded MPM: ${MY_MPM}"
127 elog
128 else
129 MY_MPM=prefork
130 elog
131 elog "Selected default MPM: ${MY_MPM}"
132 elog
133 fi
134 fi
135
136 if has ${MY_MPM} ${IUSE_MPMS_THREAD} && ! use threads ; then
137 eerror "You have selected a threaded MPM but USE=threads is disabled"
138 die "invalid use flag combination"
139 fi
140
141 if has ${MY_MPM} ${IUSE_MPMS_FORK} && use threads ; then
142 eerror "You have selected a non-threaded MPM but USE=threads is enabled"
143 die "invalid use flag combination"
144 fi
145 }
146
147 # @VARIABLE: MODULE_CRITICAL
148 # @DESCRIPTION:
149 # This variable needs to be set in the ebuild and contains a space-separated
150 # list of modules critical for the default apache. A user may still
151 # disable these modules for custom minimal installation at their own risk.
152
153 # @FUNCTION: check_module_critical
154 # @DESCRIPTION:
155 # This internal function warns the user about modules critical for the default
156 # apache configuration.
157 check_module_critical() {
158 local unsupported=0
159
160 for m in ${MODULE_CRITICAL} ; do
161 if ! has ${m} ${MY_MODS} ; then
162 ewarn "Module '${m}' is required in the default apache configuration."
163 unsupported=1
164 fi
165 done
166
167 if [[ ${unsupported} -ne 0 ]] ; then
168 ewarn
169 ewarn "You have disabled one or more required modules"
170 ewarn "for the default apache configuration."
171 ewarn "Although this is not an error, please be"
172 ewarn "aware that this setup is UNSUPPORTED."
173 ewarn
174 fi
175 }
176
177 # @VARIABLE: MODULE_DEPENDS
178 # @DESCRIPTION:
179 # This variable needs to be set in the ebuild and contains a space-separated
180 # list of dependency tokens each with a module and the module it depends on
181 # separated by a colon
182
183 # @FUNCTION: check_module_depends
184 # @DESCRIPTION:
185 # This internal function makes sure that all inter-module dependencies are
186 # satisfied with the current module selection
187 check_module_depends() {
188 local err=0
189
190 for m in ${MY_MODS} ; do
191 for dep in ${MODULE_DEPENDS} ; do
192 if [[ "${m}" == "${dep%:*}" ]] ; then
193 if ! use apache2_modules_${dep#*:} ; then
194 eerror "Module '${m}' depends on '${dep#*:}'"
195 err=1
196 fi
197 fi
198 done
199 done
200
201 if [[ ${err} -ne 0 ]] ; then
202 die "invalid use flag combination"
203 fi
204 }
205
206 # @ECLASS-VARIABLE: MY_CONF
207 # @DESCRIPTION:
208 # This internal variable contains the econf options for the current module
209 # selection after a call to setup_modules()
210
211 # @ECLASS-VARIABLE: MY_MODS
212 # @DESCRIPTION:
213 # This internal variable contains a sorted, space separated list of currently
214 # selected modules after a call to setup_modules()
215
216 # @FUNCTION: setup_modules
217 # @DESCRIPTION:
218 # This internal function selects all built-in modules based on USE flags and
219 # APACHE2_MODULES USE_EXPAND flags
220 setup_modules() {
221 local mod_type=
222
223 if use static ; then
224 mod_type="static"
225 else
226 mod_type="shared"
227 fi
228
229 MY_CONF="--enable-so=static"
230
231 if use ldap ; then
232 MY_CONF="${MY_CONF} --enable-authnz_ldap=${mod_type} --enable-ldap=${mod_type}"
233 MY_MODS="${MY_MODS} ldap authnz_ldap"
234 else
235 MY_CONF="${MY_CONF} --disable-authnz_ldap --disable-ldap"
236 fi
237
238 if use ssl ; then
239 MY_CONF="${MY_CONF} --with-ssl=/usr --enable-ssl=${mod_type}"
240 MY_MODS="${MY_MODS} ssl"
241 else
242 MY_CONF="${MY_CONF} --without-ssl --disable-ssl"
243 fi
244
245 if use suexec ; then
246 elog "You can manipulate several configure options of suexec"
247 elog "through the following environment variables:"
248 elog
249 elog " SUEXEC_SAFEPATH: Default PATH for suexec (default: /usr/local/bin:/usr/bin:/bin)"
250 elog " SUEXEC_LOGFILE: Path to the suexec logfile (default: /var/log/apache2/suexec_log)"
251 elog " SUEXEC_CALLER: Name of the user Apache is running as (default: apache)"
252 elog " SUEXEC_DOCROOT: Directory in which suexec will run scripts (default: /var/www)"
253 elog " SUEXEC_MINUID: Minimum UID, which is allowed to run scripts via suexec (default: 1000)"
254 elog " SUEXEC_MINGID: Minimum GID, which is allowed to run scripts via suexec (default: 100)"
255 elog " SUEXEC_USERDIR: User subdirectories (like /home/user/html) (default: public_html)"
256 elog " SUEXEC_UMASK: Umask for the suexec process (default: 077)"
257 elog
258
259 MY_CONF="${MY_CONF} --with-suexec-safepath=${SUEXEC_SAFEPATH:-/usr/local/bin:/usr/bin:/bin}"
260 MY_CONF="${MY_CONF} --with-suexec-logfile=${SUEXEC_LOGFILE:-/var/log/apache2/suexec_log}"
261 MY_CONF="${MY_CONF} --with-suexec-bin=/usr/sbin/suexec"
262 MY_CONF="${MY_CONF} --with-suexec-userdir=${SUEXEC_USERDIR:-public_html}"
263 MY_CONF="${MY_CONF} --with-suexec-caller=${SUEXEC_CALLER:-apache}"
264 MY_CONF="${MY_CONF} --with-suexec-docroot=${SUEXEC_DOCROOT:-/var/www}"
265 MY_CONF="${MY_CONF} --with-suexec-uidmin=${SUEXEC_MINUID:-1000}"
266 MY_CONF="${MY_CONF} --with-suexec-gidmin=${SUEXEC_MINGID:-100}"
267 MY_CONF="${MY_CONF} --with-suexec-umask=${SUEXEC_UMASK:-077}"
268 MY_CONF="${MY_CONF} --enable-suexec=${mod_type}"
269 MY_MODS="${MY_MODS} suexec"
270 else
271 MY_CONF="${MY_CONF} --disable-suexec"
272 fi
273
274 for x in ${IUSE_MODULES} ; do
275 if use apache2_modules_${x} ; then
276 MY_CONF="${MY_CONF} --enable-${x}=${mod_type}"
277 MY_MODS="${MY_MODS} ${x}"
278 else
279 MY_CONF="${MY_CONF} --disable-${x}"
280 fi
281 done
282
283 # sort and uniquify MY_MODS
284 MY_MODS=$(echo ${MY_MODS} | tr ' ' '\n' | sort -u)
285 check_module_depends
286 check_module_critical
287 }
288
289 # @VARIABLE: MODULE_DEFINES
290 # @DESCRIPTION:
291 # This variable needs to be set in the ebuild and contains a space-separated
292 # list of tokens each mapping a module to a runtime define which can be
293 # specified in APACHE2_OPTS in /etc/conf.d/apache2 to enable this particular
294 # module.
295
296 # @FUNCTION: generate_load_module
297 # @DESCRIPTION:
298 # This internal function generates the LoadModule lines for httpd.conf based on
299 # the current module selection and MODULE_DEFINES
300 generate_load_module() {
301 local endit=0 mod_lines= mod_dir="${D}/usr/$(get_libdir)/apache2/modules"
302
303 if use static; then
304 sed -i -e "/%%LOAD_MODULE%%/d" \
305 "${GENTOO_PATCHDIR}"/conf/httpd.conf
306 return
307 fi
308
309 for m in ${MY_MODS} ; do
310 if [[ -e "${mod_dir}/mod_${m}.so" ]] ; then
311 for def in ${MODULE_DEFINES} ; do
312 if [[ "${m}" == "${def%:*}" ]] ; then
313 mod_lines="${mod_lines}\n<IfDefine ${def#*:}>"
314 endit=1
315 fi
316 done
317
318 mod_lines="${mod_lines}\nLoadModule ${m}_module modules/mod_${m}.so"
319
320 if [[ ${endit} -ne 0 ]] ; then
321 mod_lines="${mod_lines}\n</IfDefine>"
322 endit=0
323 fi
324 fi
325 done
326
327 sed -i -e "s:%%LOAD_MODULE%%:${mod_lines}:" \
328 "${GENTOO_PATCHDIR}"/conf/httpd.conf
329 }
330
331 # @FUNCTION: check_upgrade
332 # @DESCRIPTION:
333 # This internal function checks if the previous configuration file for built-in
334 # modules exists in ROOT and prevents upgrade in this case. Users are supposed
335 # to convert this file to the new APACHE2_MODULES USE_EXPAND variable and remove
336 # it afterwards.
337 check_upgrade() {
338 if [[ -e "${ROOT}"etc/apache2/apache2-builtin-mods ]]; then
339 eerror "The previous configuration file for built-in modules"
340 eerror "(${ROOT}etc/apache2/apache2-builtin-mods) exists on your"
341 eerror "system."
342 eerror
343 eerror "Please read http://www.gentoo.org/doc/en/apache-upgrading.xml"
344 eerror "for detailed information how to convert this file to the new"
345 eerror "APACHE2_MODULES USE_EXPAND variable."
346 eerror
347 die "upgrade not possible with existing ${ROOT}etc/apache2/apache2-builtin-mods"
348 fi
349 }
350
351 # ==============================================================================
352 # EXPORTED FUNCTIONS
353 # ==============================================================================
354
355 # @FUNCTION: apache-2_pkg_setup
356 # @DESCRIPTION:
357 # This function selects built-in modules, the MPM and other configure options,
358 # creates the apache user and group and informs about CONFIG_SYSVIPC being
359 # needed (we don't depend on kernel sources and therefore cannot check).
360 apache-2_pkg_setup() {
361 check_upgrade
362
363 # setup apache user and group
364 enewgroup apache 81
365 enewuser apache 81 -1 /var/www apache
366
367 setup_mpm
368 setup_modules
369
370 if use debug; then
371 MY_CONF="${MY_CONF} --enable-maintainer-mode --enable-exception-hook"
372 fi
373
374 elog "Please note that you need SysV IPC support in your kernel."
375 elog "Make sure CONFIG_SYSVIPC=y is set."
376 elog
377
378 if use userland_BSD; then
379 elog "On BSD systems you need to add the following line to /boot/loader.conf:"
380 elog " accf_http_load=\"YES\""
381 elog
382 fi
383 }
384
385 # @FUNCTION: apache-2_src_prepare
386 # @DESCRIPTION:
387 # This function applies patches, configures a custom file-system layout and
388 # rebuilds the configure scripts.
389 apache-2_src_prepare() {
390 # 03_all_gentoo-apache-tools.patch injects -Wl,-z,now, which is not a good
391 # idea for everyone
392 case ${CHOST} in
393 *-linux-gnu|*-solaris*|*-freebsd*)
394 # do nothing, these use GNU binutils
395 :
396 ;;
397 *-darwin*)
398 sed -i -e 's/-Wl,-z,now/-Wl,-bind_at_load/g' \
399 "${GENTOO_PATCHDIR}"/patches/03_all_gentoo_apache-tools.patch
400 ;;
401 *)
402 # patch it out to be like upstream
403 sed -i -e 's/-Wl,-z,now//g' \
404 "${GENTOO_PATCHDIR}"/patches/03_all_gentoo_apache-tools.patch
405 ;;
406 esac
407
408 # Use correct multilib libdir in gentoo patches
409 sed -i -e "s:/usr/lib:/usr/$(get_libdir):g" \
410 "${GENTOO_PATCHDIR}"/{conf/httpd.conf,init/*,patches/config.layout} \
411 || die "libdir sed failed"
412
413 epatch "${GENTOO_PATCHDIR}"/patches/*.patch
414
415 # setup the filesystem layout config
416 cat "${GENTOO_PATCHDIR}"/patches/config.layout >> "${S}"/config.layout || \
417 die "Failed preparing config.layout!"
418 sed -i -e "s:version:${PF}:g" "${S}"/config.layout
419
420 # apache2.8 instead of httpd.8 (bug #194828)
421 mv docs/man/{httpd,apache2}.8
422 sed -i -e 's/httpd\.8/apache2.8/g' Makefile.in
423
424 # patched-in MPMs need the build environment rebuilt
425 sed -i -e '/sinclude/d' configure.in
426 AT_M4DIR=build eautoreconf
427
428 # This package really should upgrade to using pcre's .pc file.
429 cat <<-\EOF >"${T}"/pcre-config
430 #!/bin/sh
431 [ "${flag}" = "--version" ] && set -- --modversion
432 exec ${PKG_CONFIG} libpcre "$@"
433 EOF
434 chmod a+x "${T}"/pcre-config
435 }
436
437 # @FUNCTION: apache-2_src_configure
438 # @DESCRIPTION:
439 # This function adds compiler flags and runs econf and emake based on MY_MPM and
440 # MY_CONF
441 apache-2_src_configure() {
442 tc-export PKG_CONFIG
443
444 # Sanity check in case people have bad mounts/TPE settings. #500928
445 if ! "${T}"/pcre-config --help >/dev/null ; then
446 eerror "Could not execute ${T}/pcre-config; do you have bad mount"
447 eerror "permissions in ${T} or have TPE turned on in your kernel?"
448 die "check your runtime settings #500928"
449 fi
450
451 # Instead of filtering --as-needed (bug #128505), append --no-as-needed
452 # Thanks to Harald van Dijk
453 append-ldflags $(no-as-needed)
454
455 # peruser MPM debugging with -X is nearly impossible
456 if has peruser ${IUSE_MPMS} && use apache2_mpms_peruser ; then
457 use debug && append-flags -DMPM_PERUSER_DEBUG
458 fi
459
460 # econf overwrites the stuff from config.layout, so we have to put them into
461 # our myconf line too
462 ac_cv_path_PKGCONFIG=${PKG_CONFIG} \
463 econf \
464 --includedir=/usr/include/apache2 \
465 --libexecdir=/usr/$(get_libdir)/apache2/modules \
466 --datadir=/var/www/localhost \
467 --sysconfdir=/etc/apache2 \
468 --localstatedir=/var \
469 --with-mpm=${MY_MPM} \
470 --with-apr="${SYSROOT}"/usr \
471 --with-apr-util="${SYSROOT}"/usr \
472 --with-pcre="${T}"/pcre-config \
473 --with-z=/usr \
474 --with-port=80 \
475 --with-program-name=apache2 \
476 --enable-layout=Gentoo \
477 ${MY_CONF} || die "econf failed!"
478
479 sed -i -e 's:apache2\.conf:httpd.conf:' include/ap_config_auto.h
480 }
481
482 # @FUNCTION: apache-2_src_install
483 # @DESCRIPTION:
484 # This function runs `emake install' and generates, installs and adapts the gentoo
485 # specific configuration files found in the tarball
486 apache-2_src_install() {
487 emake DESTDIR="${D}" MKINSTALLDIRS="mkdir -p" install || die "make install failed"
488
489 # install our configuration files
490 keepdir /etc/apache2/vhosts.d
491 keepdir /etc/apache2/modules.d
492
493 generate_load_module
494 insinto /etc/apache2
495 doins -r "${GENTOO_PATCHDIR}"/conf/*
496 use apache2_modules_mime_magic && doins docs/conf/magic
497
498 insinto /etc/logrotate.d
499 newins "${GENTOO_PATCHDIR}"/scripts/apache2-logrotate apache2
500
501 # generate a sane default APACHE2_OPTS
502 APACHE2_OPTS="-D DEFAULT_VHOST -D INFO"
503 use doc && APACHE2_OPTS="${APACHE2_OPTS} -D MANUAL"
504 use ssl && APACHE2_OPTS="${APACHE2_OPTS} -D SSL -D SSL_DEFAULT_VHOST"
505 use suexec && APACHE2_OPTS="${APACHE2_OPTS} -D SUEXEC"
506 if has negotiation ${APACHE2_MODULES} && use apache2_modules_negotiation; then
507 APACHE2_OPTS="${APACHE2_OPTS} -D LANGUAGE"
508 fi
509
510 sed -i -e "s:APACHE2_OPTS=\".*\":APACHE2_OPTS=\"${APACHE2_OPTS}\":" \
511 "${GENTOO_PATCHDIR}"/init/apache2.confd || die "sed failed"
512
513 newconfd "${GENTOO_PATCHDIR}"/init/apache2.confd apache2
514 newinitd "${GENTOO_PATCHDIR}"/init/apache2.initd apache2
515
516 # install apache2ctl wrapper for our init script if available
517 if test -e "${GENTOO_PATCHDIR}"/scripts/apache2ctl; then
518 exeinto /usr/sbin
519 doexe "${GENTOO_PATCHDIR}"/scripts/apache2ctl
520 else
521 dosym /etc/init.d/apache2 /usr/sbin/apache2ctl
522 fi
523
524 # provide legacy symlink for apxs, bug 177697
525 dosym /usr/sbin/apxs /usr/sbin/apxs2
526
527 # install some documentation
528 dodoc ABOUT_APACHE CHANGES LAYOUT README README.platforms VERSIONING
529 dodoc "${GENTOO_PATCHDIR}"/docs/*
530
531 # drop in a convenient link to the manual
532 if use doc ; then
533 sed -i -e "s:VERSION:${PVR}:" "${D}/etc/apache2/modules.d/00_apache_manual.conf"
534 else
535 rm -f "${D}/etc/apache2/modules.d/00_apache_manual.conf"
536 rm -Rf "${D}/usr/share/doc/${PF}/manual"
537 fi
538
539 # the default icons and error pages get stored in
540 # /usr/share/apache2/{error,icons}
541 dodir /usr/share/apache2
542 mv -f "${D}/var/www/localhost/error" "${D}/usr/share/apache2/error"
543 mv -f "${D}/var/www/localhost/icons" "${D}/usr/share/apache2/icons"
544 rm -rf "${D}/var/www/localhost/"
545 eend $?
546
547 # set some sane permissions for suexec
548 if use suexec ; then
549 fowners 0:${SUEXEC_CALLER:-apache} /usr/sbin/suexec
550 fperms 4710 /usr/sbin/suexec
551 # provide legacy symlink for suexec, bug 177697
552 dosym /usr/sbin/suexec /usr/sbin/suexec2
553 fi
554
555 # empty dirs
556 for i in /var/lib/dav /var/log/apache2 /var/cache/apache2 ; do
557 keepdir ${i}
558 fowners apache:apache ${i}
559 fperms 0750 ${i}
560 done
561 }
562
563 # @FUNCTION: apache-2_pkg_postinst
564 # @DESCRIPTION:
565 # This function creates test certificates if SSL is enabled and installs the
566 # default index.html to /var/www/localhost if it does not exist. We do this here
567 # because the default webroot is a copy of the files that exist elsewhere and we
568 # don't want them to be managed/removed by portage when apache is upgraded.
569 apache-2_pkg_postinst() {
570 if use ssl && [[ ! -e "${ROOT}/etc/ssl/apache2/server.pem" ]]; then
571 SSL_ORGANIZATION="${SSL_ORGANIZATION:-Apache HTTP Server}"
572 install_cert /etc/ssl/apache2/server
573 ewarn
574 ewarn "The location of SSL certificates has changed. If you are"
575 ewarn "upgrading from ${CATEGORY}/${PN}-2.2.13 or earlier (or remerged"
576 ewarn "*any* apache version), you might want to move your old"
577 ewarn "certificates from /etc/apache2/ssl/ to /etc/ssl/apache2/ and"
578 ewarn "update your config files."
579 ewarn
580 fi
581
582 if [[ ! -e "${ROOT}/var/www/localhost" ]] ; then
583 mkdir -p "${ROOT}/var/www/localhost/htdocs"
584 echo "<html><body><h1>It works!</h1></body></html>" > "${ROOT}/var/www/localhost/htdocs/index.html"
585 fi
586
587 echo
588 elog "Attention: cgi and cgid modules are now handled via APACHE2_MODULES flags"
589 elog "in make.conf. Make sure to enable those in order to compile them."
590 elog "In general, you should use 'cgid' with threaded MPMs and 'cgi' otherwise."
591 echo
592
593 }
594
595 EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_install pkg_postinst

  ViewVC Help
Powered by ViewVC 1.1.20