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

Diff of /eclass/apache-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.35 Revision 1.36
1# Copyright 1999-2014 Gentoo Foundation 1# Copyright 1999-2014 Gentoo Foundation
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/eclass/apache-2.eclass,v 1.35 2014/02/12 00:03:21 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/apache-2.eclass,v 1.36 2014/05/22 13:58:46 polynomial-c Exp $
4 4
5# @ECLASS: apache-2.eclass 5# @ECLASS: apache-2.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# apache-devs@gentoo.org 7# apache-devs@gentoo.org
8# @BLURB: Provides a common set of functions for apache-2.x ebuilds 8# @BLURB: Provides a common set of functions for apache-2.x ebuilds
9# @DESCRIPTION: 9# @DESCRIPTION:
10# This eclass handles apache-2.x ebuild functions such as LoadModule generation 10# This eclass handles apache-2.x ebuild functions such as LoadModule generation
11# and inter-module dependency checking. 11# and inter-module dependency checking.
12 12
13inherit autotools eutils flag-o-matic multilib ssl-cert user toolchain-funcs 13inherit autotools eutils flag-o-matic multilib ssl-cert user toolchain-funcs versionator
14
15[[ ${CATEGORY}/${PN} != www-servers/apache ]] \
16 && die "Do not use this eclass with anything else than www-servers/apache ebuilds!"
17
18case ${EAPI:-0} in
19 0|1|2|3)
20 die "This eclass requires >=EAPI-4"
21 ;;
22esac
23
24# settings which are version specific go in here:
25case $(get_version_component_range 1-2) in
26 2.4)
27 DEFAULT_MPM_THREADED="event" #509922
28 RDEPEND=">=dev-libs/apr-1.5.1" #492578
29 ;;
30 *)
31 DEFAULT_MPM_THREADED="worker"
32 RDEPEND=">=dev-libs/apr-1.4.5" #368651
33 ;;
34esac
14 35
15# ============================================================================== 36# ==============================================================================
16# INTERNAL VARIABLES 37# INTERNAL VARIABLES
17# ============================================================================== 38# ==============================================================================
18 39
79 100
80DEPEND="dev-lang/perl 101DEPEND="dev-lang/perl
81 =dev-libs/apr-1* 102 =dev-libs/apr-1*
82 =dev-libs/apr-util-1*[ldap?] 103 =dev-libs/apr-util-1*[ldap?]
83 dev-libs/libpcre 104 dev-libs/libpcre
105 apache2_modules_deflate? ( sys-libs/zlib )
106 apache2_modules_mime? ( app-misc/mime-types )
84 ldap? ( =net-nds/openldap-2* ) 107 ldap? ( =net-nds/openldap-2* )
85 selinux? ( sec-policy/selinux-apache ) 108 selinux? ( sec-policy/selinux-apache )
86 ssl? ( >=dev-libs/openssl-0.9.8f ) 109 ssl? ( >=dev-libs/openssl-0.9.8m )
87 !=www-servers/apache-1*" 110 !=www-servers/apache-1*"
88RDEPEND="${DEPEND}" 111RDEPEND+=" ${DEPEND}"
89PDEPEND="~app-admin/apache-tools-${PV}" 112PDEPEND="~app-admin/apache-tools-${PV}"
90 113
91S="${WORKDIR}/httpd-${PV}" 114S="${WORKDIR}/httpd-${PV}"
92 115
93# ============================================================================== 116# ==============================================================================
119 fi 142 fi
120 done 143 done
121 144
122 if [[ -z "${MY_MPM}" ]] ; then 145 if [[ -z "${MY_MPM}" ]] ; then
123 if use threads ; then 146 if use threads ; then
124 MY_MPM=worker 147 MY_MPM=${DEFAULT_MPM_THREADED}
125 elog 148 elog
126 elog "Selected default threaded MPM: ${MY_MPM}" 149 elog "Selected default threaded MPM: ${MY_MPM}"
127 elog 150 elog
128 else 151 else
129 MY_MPM=prefork 152 MY_MPM=prefork
227 fi 250 fi
228 251
229 MY_CONF="--enable-so=static" 252 MY_CONF="--enable-so=static"
230 253
231 if use ldap ; then 254 if use ldap ; then
232 MY_CONF="${MY_CONF} --enable-authnz_ldap=${mod_type} --enable-ldap=${mod_type}" 255 MY_CONF+=" --enable-authnz_ldap=${mod_type} --enable-ldap=${mod_type}"
233 MY_MODS="${MY_MODS} ldap authnz_ldap" 256 MY_MODS+=" ldap authnz_ldap"
234 else 257 else
235 MY_CONF="${MY_CONF} --disable-authnz_ldap --disable-ldap" 258 MY_CONF+=" --disable-authnz_ldap --disable-ldap"
236 fi 259 fi
237 260
238 if use ssl ; then 261 if use ssl ; then
239 MY_CONF="${MY_CONF} --with-ssl=/usr --enable-ssl=${mod_type}" 262 MY_CONF+=" --with-ssl=/usr --enable-ssl=${mod_type}"
240 MY_MODS="${MY_MODS} ssl" 263 MY_MODS+=" ssl"
241 else 264 else
242 MY_CONF="${MY_CONF} --without-ssl --disable-ssl" 265 MY_CONF+=" --without-ssl --disable-ssl"
243 fi 266 fi
244 267
245 if use suexec ; then 268 if use suexec ; then
246 elog "You can manipulate several configure options of suexec" 269 elog "You can manipulate several configure options of suexec"
247 elog "through the following environment variables:" 270 elog "through the following environment variables:"
254 elog " SUEXEC_MINGID: Minimum GID, which is allowed to run scripts via suexec (default: 100)" 277 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)" 278 elog " SUEXEC_USERDIR: User subdirectories (like /home/user/html) (default: public_html)"
256 elog " SUEXEC_UMASK: Umask for the suexec process (default: 077)" 279 elog " SUEXEC_UMASK: Umask for the suexec process (default: 077)"
257 elog 280 elog
258 281
259 MY_CONF="${MY_CONF} --with-suexec-safepath=${SUEXEC_SAFEPATH:-/usr/local/bin:/usr/bin:/bin}" 282 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}" 283 MY_CONF+=" --with-suexec-logfile=${SUEXEC_LOGFILE:-/var/log/apache2/suexec_log}"
261 MY_CONF="${MY_CONF} --with-suexec-bin=/usr/sbin/suexec" 284 MY_CONF+=" --with-suexec-bin=/usr/sbin/suexec"
262 MY_CONF="${MY_CONF} --with-suexec-userdir=${SUEXEC_USERDIR:-public_html}" 285 MY_CONF+=" --with-suexec-userdir=${SUEXEC_USERDIR:-public_html}"
263 MY_CONF="${MY_CONF} --with-suexec-caller=${SUEXEC_CALLER:-apache}" 286 MY_CONF+=" --with-suexec-caller=${SUEXEC_CALLER:-apache}"
264 MY_CONF="${MY_CONF} --with-suexec-docroot=${SUEXEC_DOCROOT:-/var/www}" 287 MY_CONF+=" --with-suexec-docroot=${SUEXEC_DOCROOT:-/var/www}"
265 MY_CONF="${MY_CONF} --with-suexec-uidmin=${SUEXEC_MINUID:-1000}" 288 MY_CONF+=" --with-suexec-uidmin=${SUEXEC_MINUID:-1000}"
266 MY_CONF="${MY_CONF} --with-suexec-gidmin=${SUEXEC_MINGID:-100}" 289 MY_CONF+=" --with-suexec-gidmin=${SUEXEC_MINGID:-100}"
267 MY_CONF="${MY_CONF} --with-suexec-umask=${SUEXEC_UMASK:-077}" 290 MY_CONF+=" --with-suexec-umask=${SUEXEC_UMASK:-077}"
268 MY_CONF="${MY_CONF} --enable-suexec=${mod_type}" 291 MY_CONF+=" --enable-suexec=${mod_type}"
269 MY_MODS="${MY_MODS} suexec" 292 MY_MODS+=" suexec"
270 else 293 else
271 MY_CONF="${MY_CONF} --disable-suexec" 294 MY_CONF+=" --disable-suexec"
272 fi 295 fi
273 296
274 for x in ${IUSE_MODULES} ; do 297 for x in ${IUSE_MODULES} ; do
275 if use apache2_modules_${x} ; then 298 if use apache2_modules_${x} ; then
276 MY_CONF="${MY_CONF} --enable-${x}=${mod_type}" 299 MY_CONF+=" --enable-${x}=${mod_type}"
277 MY_MODS="${MY_MODS} ${x}" 300 MY_MODS+=" ${x}"
278 else 301 else
279 MY_CONF="${MY_CONF} --disable-${x}" 302 MY_CONF+=" --disable-${x}"
280 fi 303 fi
281 done 304 done
282 305
283 # sort and uniquify MY_MODS 306 # sort and uniquify MY_MODS
284 MY_MODS=$(echo ${MY_MODS} | tr ' ' '\n' | sort -u) 307 MY_MODS=$(echo ${MY_MODS} | tr ' ' '\n' | sort -u)
366 389
367 setup_mpm 390 setup_mpm
368 setup_modules 391 setup_modules
369 392
370 if use debug; then 393 if use debug; then
371 MY_CONF="${MY_CONF} --enable-maintainer-mode --enable-exception-hook" 394 MY_CONF+=" --enable-maintainer-mode --enable-exception-hook"
372 fi 395 fi
373 396
374 elog "Please note that you need SysV IPC support in your kernel." 397 elog "Please note that you need SysV IPC support in your kernel."
375 elog "Make sure CONFIG_SYSVIPC=y is set." 398 elog "Make sure CONFIG_SYSVIPC=y is set."
376 elog 399 elog
520 else 543 else
521 dosym /etc/init.d/apache2 /usr/sbin/apache2ctl 544 dosym /etc/init.d/apache2 /usr/sbin/apache2ctl
522 fi 545 fi
523 546
524 # provide legacy symlink for apxs, bug 177697 547 # provide legacy symlink for apxs, bug 177697
525 dosym /usr/sbin/apxs /usr/sbin/apxs2 548 dosym apxs /usr/sbin/apxs2
526 549
527 # install some documentation 550 # install some documentation
528 dodoc ABOUT_APACHE CHANGES LAYOUT README README.platforms VERSIONING 551 dodoc ABOUT_APACHE CHANGES LAYOUT README README.platforms VERSIONING
529 dodoc "${GENTOO_PATCHDIR}"/docs/* 552 dodoc "${GENTOO_PATCHDIR}"/docs/*
530 553
531 # drop in a convenient link to the manual 554 # drop in a convenient link to the manual
532 if use doc ; then 555 if use doc ; then
533 sed -i -e "s:VERSION:${PVR}:" "${D}/etc/apache2/modules.d/00_apache_manual.conf" 556 sed -i -e "s:VERSION:${PVR}:" "${D}/etc/apache2/modules.d/00_apache_manual.conf"
557 docompress -x /usr/share/doc/${PF}/manual # 503640
534 else 558 else
535 rm -f "${D}/etc/apache2/modules.d/00_apache_manual.conf" 559 rm -f "${D}/etc/apache2/modules.d/00_apache_manual.conf"
536 rm -Rf "${D}/usr/share/doc/${PF}/manual" 560 rm -Rf "${D}/usr/share/doc/${PF}/manual"
537 fi 561 fi
538 562

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

  ViewVC Help
Powered by ViewVC 1.1.20