update eclasses

git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@361 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
geos_one 2008-03-28 19:19:39 +00:00
parent 8a91e12280
commit 2cc238b426
2 changed files with 56 additions and 60 deletions

View File

@ -1,16 +1,16 @@
# Copyright 1999-2007 Gentoo Foundation # Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/apache-2.eclass,v 1.5 2007/12/31 23:46:24 hollow Exp $ # $Header: /var/cvsroot/gentoo-x86/eclass/apache-2.eclass,v 1.11 2008/03/23 13:03:53 hollow Exp $
# @ECLASS: apache-2 # @ECLASS: apache-2.eclass
# @MAINTAINER: apache-devs@gentoo.org # @MAINTAINER:
# @BLURB: Provides a common set of functions for >=apache-2.2* ebuilds # apache-devs@gentoo.org
# @BLURB: Provides a common set of functions for apache-2.x ebuilds
# @DESCRIPTION: # @DESCRIPTION:
# This eclass handles common apache ebuild functions in a sane way and providing # This eclass handles apache-2.x ebuild functions such as LoadModule generation
# information about where certain interfaces are located such as LoadModule # and inter-module dependency checking.
# generation and inter-module dependency checking.
inherit depend.apache eutils flag-o-matic multilib autotools inherit autotools confutils eutils flag-o-matic multilib
# ============================================================================== # ==============================================================================
# INTERNAL VARIABLES # INTERNAL VARIABLES
@ -27,37 +27,37 @@ GENTOO_PATCHNAME="gentoo-${PF}"
# files are located # files are located
GENTOO_PATCHDIR="${WORKDIR}/${GENTOO_PATCHNAME}" GENTOO_PATCHDIR="${WORKDIR}/${GENTOO_PATCHNAME}"
# @ECLASS-VARIABLE: GENTOO_DEVELOPER # @VARIABLE: GENTOO_DEVELOPER
# @DESCRIPTION: # @DESCRIPTION:
# This variable needs to be set in the ebuild and contains the name of the # This variable needs to be set in the ebuild and contains the name of the
# gentoo developer who created the patch tarball # gentoo developer who created the patch tarball
# @ECLASS-VARIABLE: GENTOO_PATCHSTAMP # @VARIABLE: GENTOO_PATCHSTAMP
# @DESCRIPTION: # @DESCRIPTION:
# This variable needs to be set in the ebuild and contains the date the patch # This variable needs to be set in the ebuild and contains the date the patch
# tarball was created at in YYMMDD format # tarball was created at in YYYYMMDD format
SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2 SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2
http://dev.gentoo.org/~${GENTOO_DEVELOPER}/dist/apache/${GENTOO_PATCHNAME}-${GENTOO_PATCHSTAMP}.tar.bz2 http://dev.gentoo.org/~${GENTOO_DEVELOPER}/dist/apache/${GENTOO_PATCHNAME}-${GENTOO_PATCHSTAMP}.tar.bz2
http://ftp.mars.arge.at/pub/${GENTOO_PATCHNAME}-${GENTOO_PATCHSTAMP}.tar.bz2" http://ftp.mars.arge.at/pub/${GENTOO_PATCHNAME}-${GENTOO_PATCHSTAMP}.tar.bz2"
# @ECLASS-VARIABLE: IUSE_MPMS_FORK # @VARIABLE: IUSE_MPMS_FORK
# @DESCRIPTION: # @DESCRIPTION:
# This variable needs to be set in the ebuild and contains a list of forking # This variable needs to be set in the ebuild and contains a list of forking
# (i.e. non-threaded) MPMS # (i.e. non-threaded) MPMs
# @ECLASS-VARIABLE: IUSE_MPMS_THREAD # @VARIABLE: IUSE_MPMS_THREAD
# @DESCRIPTION: # @DESCRIPTION:
# This variable needs to be set in the ebuild and contains a list of threaded # This variable needs to be set in the ebuild and contains a list of threaded
# MPMS # MPMs
# @ECLASS-VARIABLE: IUSE_MODULES # @VARIABLE: IUSE_MODULES
# @DESCRIPTION: # @DESCRIPTION:
# This variable needs to be set in the ebuild and contains a list of available # This variable needs to be set in the ebuild and contains a list of available
# built-in modules # built-in modules
IUSE_MPMS="${IUSE_MPMS_FORK} ${IUSE_MPMS_THREAD}" IUSE_MPMS="${IUSE_MPMS_FORK} ${IUSE_MPMS_THREAD}"
IUSE="${IUSE} debug doc ldap selinux ssl static suexec threads" IUSE="${IUSE} debug doc mozldap ldap selinux ssl static suexec threads"
for module in ${IUSE_MODULES} ; do for module in ${IUSE_MODULES} ; do
IUSE="${IUSE} apache2_modules_${module}" IUSE="${IUSE} apache2_modules_${module}"
@ -74,7 +74,7 @@ DEPEND="dev-lang/perl
ldap? ( =net-nds/openldap-2* ) ldap? ( =net-nds/openldap-2* )
mozldap? ( =dev-libs/mozldap-6* ) mozldap? ( =dev-libs/mozldap-6* )
selinux? ( sec-policy/selinux-apache ) selinux? ( sec-policy/selinux-apache )
ssl? ( dev-libs/openssl ) ssl? ( >=dev-libs/openssl-0.9.8f )
!=www-servers/apache-1*" !=www-servers/apache-1*"
RDEPEND="${DEPEND}" RDEPEND="${DEPEND}"
PDEPEND="~app-admin/apache-tools-${PV}" PDEPEND="~app-admin/apache-tools-${PV}"
@ -86,7 +86,7 @@ S="${WORKDIR}/httpd-${PV}"
# ============================================================================== # ==============================================================================
# @ECLASS-VARIABLE: MY_MPM # @ECLASS-VARIABLE: MY_MPM
# DESCRIPTION: # @DESCRIPTION:
# This internal variable contains the selected MPM after a call to setup_mpm() # This internal variable contains the selected MPM after a call to setup_mpm()
# @FUNCTION: setup_mpm # @FUNCTION: setup_mpm
@ -135,7 +135,7 @@ setup_mpm() {
fi fi
} }
# @ECLASS-VARIABLE: MODULE_CRITICAL # @VARIABLE: MODULE_CRITICAL
# @DESCRIPTION: # @DESCRIPTION:
# This variable needs to be set in the ebuild and contains a space-separated # This variable needs to be set in the ebuild and contains a space-separated
# list of modules critical for the default apache. A user may still # list of modules critical for the default apache. A user may still
@ -166,7 +166,7 @@ check_module_critical() {
fi fi
} }
# @ECLASS-VARIABLE: MODULE_DEPENDS # @VARIABLE: MODULE_DEPENDS
# @DESCRIPTION: # @DESCRIPTION:
# This variable needs to be set in the ebuild and contains a space-separated # This variable needs to be set in the ebuild and contains a space-separated
# list of dependency tokens each with a module and the module it depends on # list of dependency tokens each with a module and the module it depends on
@ -196,12 +196,12 @@ check_module_depends() {
} }
# @ECLASS-VARIABLE: MY_CONF # @ECLASS-VARIABLE: MY_CONF
# DESCRIPTION: # @DESCRIPTION:
# This internal variable contains the econf options for the current module # This internal variable contains the econf options for the current module
# selection after a call to setup_modules() # selection after a call to setup_modules()
# @ECLASS-VARIABLE: MY_MODS # @ECLASS-VARIABLE: MY_MODS
# DESCRIPTION: # @DESCRIPTION:
# This internal variable contains a sorted, space separated list of currently # This internal variable contains a sorted, space separated list of currently
# selected modules after a call to setup_modules() # selected modules after a call to setup_modules()
@ -227,12 +227,7 @@ setup_modules() {
die "ldap and mozldap USE conflict" die "ldap and mozldap USE conflict"
fi fi
if use ldap || use mozldap ; then if use ldap || use mozldap ; then
if ( ! built_with_use 'dev-libs/apr-util' ldap ) || ( ! built_with_use 'dev-libs/apr-util' mozldap ) ; then confutils_use_depend_built_with_all ldap dev-libs/apr-util ldap
eerror "dev-libs/apr-util is missing LDAP support. For apache to have"
eerror "ldap support, apr-util must be built with the ldap or mozldap USE-flag"
eerror "enabled."
die "ldap or mozldap USE-flag enabled while not supported in apr-util"
fi
MY_CONF="${MY_CONF} --enable-authnz_ldap=${mod_type} --enable-ldap=${mod_type}" MY_CONF="${MY_CONF} --enable-authnz_ldap=${mod_type} --enable-ldap=${mod_type}"
MY_MODS="${MY_MODS} ldap authnz_ldap" MY_MODS="${MY_MODS} ldap authnz_ldap"
else else
@ -298,7 +293,7 @@ setup_modules() {
check_module_critical check_module_critical
} }
# @ECLASS-VARIABLE: MODULE_DEFINES # @VARIABLE: MODULE_DEFINES
# @DESCRIPTION: # @DESCRIPTION:
# This variable needs to be set in the ebuild and contains a space-separated # This variable needs to be set in the ebuild and contains a space-separated
# list of tokens each mapping a module to a runtime define which can be # list of tokens each mapping a module to a runtime define which can be
@ -310,7 +305,7 @@ setup_modules() {
# This internal function generates the LoadModule lines for httpd.conf based on # This internal function generates the LoadModule lines for httpd.conf based on
# the current module selection and MODULE_DEFINES # the current module selection and MODULE_DEFINES
generate_load_module() { generate_load_module() {
local endit=0 mod_lines= mod_dir="${D}${APACHE2_MODULESDIR}" local endit=0 mod_lines= mod_dir="${D}/usr/$(get_libdir)/apache2/modules"
if use static; then if use static; then
sed -i -e "/%%LOAD_MODULE%%/d" \ sed -i -e "/%%LOAD_MODULE%%/d" \
@ -372,6 +367,10 @@ check_upgrade() {
apache-2_pkg_setup() { apache-2_pkg_setup() {
check_upgrade check_upgrade
# setup apache user and group
enewgroup apache 81
enewuser apache 81 -1 /var/www apache
setup_mpm setup_mpm
setup_modules setup_modules
@ -379,10 +378,6 @@ apache-2_pkg_setup() {
MY_CONF="${MY_CONF} --enable-maintainer-mode --enable-exception-hook" MY_CONF="${MY_CONF} --enable-maintainer-mode --enable-exception-hook"
fi fi
# setup apache user and group
enewgroup apache 81
enewuser apache 81 -1 /var/www apache
elog "Please note that you need SysV IPC support in your kernel." elog "Please note that you need SysV IPC support in your kernel."
elog "Make sure CONFIG_SYSVIPC=y is set." elog "Make sure CONFIG_SYSVIPC=y is set."
elog elog
@ -457,7 +452,7 @@ apache-2_src_compile() {
# @FUNCTION: apache-2_src_install # @FUNCTION: apache-2_src_install
# @DESCRIPTION: # @DESCRIPTION:
# This function runs emake install and generates, install and adapts the gentoo # This function runs `emake install' and generates, installs and adapts the gentoo
# specific configuration files found in the tarball # specific configuration files found in the tarball
apache-2_src_install() { apache-2_src_install() {
make DESTDIR="${D}" install || die "make install failed" make DESTDIR="${D}" install || die "make install failed"
@ -489,10 +484,8 @@ apache-2_src_install() {
# link apache2ctl to the init script # link apache2ctl to the init script
dosym /etc/init.d/apache2 /usr/sbin/apache2ctl dosym /etc/init.d/apache2 /usr/sbin/apache2ctl
# provide symlinks for all the stuff we no longer rename, bug 177697 # provide legacy symlink for apxs, bug 177697
for i in suexec apxs; do dosym /usr/sbin/apxs /usr/sbin/apxs2
dosym /usr/sbin/${i} /usr/sbin/${i}2
done
# install some thirdparty scripts # install some thirdparty scripts
exeinto /usr/sbin exeinto /usr/sbin
@ -510,16 +503,18 @@ apache-2_src_install() {
rm -Rf "${D}/usr/share/doc/${PF}/manual" rm -Rf "${D}/usr/share/doc/${PF}/manual"
fi fi
# the default webroot gets stored in /usr/share/doc # the default webroot gets stored in /usr/share/${PF}/webroot
ebegin "Installing default webroot to /usr/share/doc/${PF}" ebegin "Installing default webroot to /usr/share/${PF}/webroot"
mv -f "${D}/var/www/localhost" "${D}/usr/share/doc/${PF}/webroot" dodir /usr/share/${PF}
mv -f "${D}/var/www/localhost" "${D}/usr/share/${PF}/webroot"
eend $? eend $?
keepdir /var/www/localhost/htdocs
# set some sane permissions for suexec # set some sane permissions for suexec
if use suexec ; then if use suexec ; then
fowners 0:apache /usr/sbin/suexec fowners 0:apache /usr/sbin/suexec
fperms 4710 /usr/sbin/suexec fperms 4710 /usr/sbin/suexec
# provide legacy symlink for suexec, bug 177697
dosym /usr/sbin/suexec /usr/sbin/suexec2
fi fi
# empty dirs # empty dirs
@ -536,13 +531,14 @@ apache-2_src_install() {
# @FUNCTION: apache-2_pkg_postinst # @FUNCTION: apache-2_pkg_postinst
# @DESCRIPTION: # @DESCRIPTION:
# This function creates test certificates if SSL is enabled and installs the # This function creates test certificates if SSL is enabled and installs the
# default webroot if /var/www/localhost does not exist. We do this here because # default webroot to /var/www/localhost if it does not exist. We do this here
# the default webroot is a copy of the files that exist elsewhere and we don't # because the default webroot is a copy of the files that exist elsewhere and we
# want them to be managed/removed by portage when apache is upgraded. # don't want them to be managed/removed by portage when apache is upgraded.
apache-2_pkg_postinst() { apache-2_pkg_postinst() {
einfo
if use ssl && [[ ! -e "${ROOT}/etc/apache2/ssl/server.crt" ]] ; then if use ssl && [[ ! -e "${ROOT}/etc/apache2/ssl/server.crt" ]] ; then
cd "${ROOT}"/etc/apache2/ssl cd "${ROOT}"/etc/apache2/ssl
einfo
einfo "Generating self-signed test certificate in ${ROOT}etc/apache2/ssl ..." einfo "Generating self-signed test certificate in ${ROOT}etc/apache2/ssl ..."
yes "" 2>/dev/null | \ yes "" 2>/dev/null | \
"${ROOT}"/usr/sbin/gentestcrt.sh >/dev/null 2>&1 || \ "${ROOT}"/usr/sbin/gentestcrt.sh >/dev/null 2>&1 || \
@ -561,19 +557,19 @@ apache-2_pkg_postinst() {
else else
einfo "Installing default webroot to ${ROOT}var/www/localhost" einfo "Installing default webroot to ${ROOT}var/www/localhost"
mkdir -p "${ROOT}"/var/www/localhost mkdir -p "${ROOT}"/var/www/localhost
cp -R "${ROOT}"/usr/share/doc/${PF}/webroot/* "${ROOT}"/var/www/localhost cp -R "${ROOT}"/usr/share/${PF}/webroot/* "${ROOT}"/var/www/localhost/
chown -R apache:0 "${ROOT}"/var/www/localhost einfo
fi fi
} }
# @FUNCTION: apache-2_pkg_config # @FUNCTION: apache-2_pkg_config
# @DESCRIPTION: # @DESCRIPTION:
# This function installs -- and removes a previously existing -- default webroot # This function installs -- and overwrites -- the default webroot to
# to /var/www/localhost # /var/www/localhost
apache-2_pkg_config() { apache-2_pkg_config() {
einfo "Installing default webroot to ${ROOT}var/www/localhost" einfo "Installing default webroot to ${ROOT}var/www/localhost"
mkdir "${ROOT}"var{,/www{,/localhost}} mkdir -p "${ROOT}"/var/www/localhost
cp -R "${ROOT}"usr/share/doc/${PF}/webroot/* "${ROOT}"var/www/localhost/ cp -R "${ROOT}"/usr/share/${PF}/webroot/* "${ROOT}"/var/www/localhost/
} }
EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_config EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_config

View File

@ -18,7 +18,7 @@ if [[ -n ${LLVM_TYPE} ]] ; then
else else
case ${PV} in case ${PV} in
9999) LTYPE="svn";; 9999) LTYPE="svn";;
9999_pre*) LTYPE="snap";; 9999_pre*) LTYPE="pre";;
*) LTYPE="rel";; *) LTYPE="rel";;
esac esac
fi fi
@ -27,8 +27,8 @@ if [[ ${LTYPE} == "svn" ]] ; then
extra_eclass="subversion" extra_eclass="subversion"
ESVN_REPO_URI="http://llvm.org/svn/llvm-project/llvm/trunk/llvm" ESVN_REPO_URI="http://llvm.org/svn/llvm-project/llvm/trunk/llvm"
LVER="svn" LVER="svn"
elif [[ ${LTYPE} == "snap" ]] ; then elif [[ ${LTYPE} == "pre" ]] ; then
LVER=${PV/9999_pre} LVER=${PV/pre*}
elif [[ ${LTYPE} == "rel" ]] ; then elif [[ ${LTYPE} == "rel" ]] ; then
LVER=${PV} LVER=${PV}
else else
@ -51,7 +51,7 @@ HOMEPAGE="http://llvm.org/"
case ${LTYPE} in case ${LTYPE} in
svn) SRC_URI="";; svn) SRC_URI="";;
snap) SRC_URI="ftp://gcc.gnu.org/pub/llvm/snapshots/llvm-${LVER}.tar.bz2";; pre) SRC_URI="http://llvm.org/prereleases/${LVER}/llvm-${LVER}.tar.gz";;
rel) rel)
SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.tar.gz" SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.tar.gz"
esac esac