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
# 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
# @MAINTAINER: apache-devs@gentoo.org
# @BLURB: Provides a common set of functions for >=apache-2.2* ebuilds
# @ECLASS: apache-2.eclass
# @MAINTAINER:
# apache-devs@gentoo.org
# @BLURB: Provides a common set of functions for apache-2.x ebuilds
# @DESCRIPTION:
# This eclass handles common apache ebuild functions in a sane way and providing
# information about where certain interfaces are located such as LoadModule
# generation and inter-module dependency checking.
# This eclass handles apache-2.x ebuild functions such as LoadModule 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
@ -27,37 +27,37 @@ GENTOO_PATCHNAME="gentoo-${PF}"
# files are located
GENTOO_PATCHDIR="${WORKDIR}/${GENTOO_PATCHNAME}"
# @ECLASS-VARIABLE: GENTOO_DEVELOPER
# @VARIABLE: GENTOO_DEVELOPER
# @DESCRIPTION:
# This variable needs to be set in the ebuild and contains the name of the
# gentoo developer who created the patch tarball
# @ECLASS-VARIABLE: GENTOO_PATCHSTAMP
# @VARIABLE: GENTOO_PATCHSTAMP
# @DESCRIPTION:
# 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
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"
# @ECLASS-VARIABLE: IUSE_MPMS_FORK
# @VARIABLE: IUSE_MPMS_FORK
# @DESCRIPTION:
# 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:
# 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:
# This variable needs to be set in the ebuild and contains a list of available
# built-in modules
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
IUSE="${IUSE} apache2_modules_${module}"
@ -74,7 +74,7 @@ DEPEND="dev-lang/perl
ldap? ( =net-nds/openldap-2* )
mozldap? ( =dev-libs/mozldap-6* )
selinux? ( sec-policy/selinux-apache )
ssl? ( dev-libs/openssl )
ssl? ( >=dev-libs/openssl-0.9.8f )
!=www-servers/apache-1*"
RDEPEND="${DEPEND}"
PDEPEND="~app-admin/apache-tools-${PV}"
@ -86,7 +86,7 @@ S="${WORKDIR}/httpd-${PV}"
# ==============================================================================
# @ECLASS-VARIABLE: MY_MPM
# DESCRIPTION:
# @DESCRIPTION:
# This internal variable contains the selected MPM after a call to setup_mpm()
# @FUNCTION: setup_mpm
@ -135,7 +135,7 @@ setup_mpm() {
fi
}
# @ECLASS-VARIABLE: MODULE_CRITICAL
# @VARIABLE: MODULE_CRITICAL
# @DESCRIPTION:
# 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
@ -166,7 +166,7 @@ check_module_critical() {
fi
}
# @ECLASS-VARIABLE: MODULE_DEPENDS
# @VARIABLE: MODULE_DEPENDS
# @DESCRIPTION:
# 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
@ -196,12 +196,12 @@ check_module_depends() {
}
# @ECLASS-VARIABLE: MY_CONF
# DESCRIPTION:
# @DESCRIPTION:
# This internal variable contains the econf options for the current module
# selection after a call to setup_modules()
# @ECLASS-VARIABLE: MY_MODS
# DESCRIPTION:
# @DESCRIPTION:
# This internal variable contains a sorted, space separated list of currently
# selected modules after a call to setup_modules()
@ -227,12 +227,7 @@ setup_modules() {
die "ldap and mozldap USE conflict"
fi
if use ldap || use mozldap ; then
if ( ! built_with_use 'dev-libs/apr-util' ldap ) || ( ! built_with_use 'dev-libs/apr-util' mozldap ) ; then
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
confutils_use_depend_built_with_all ldap dev-libs/apr-util ldap
MY_CONF="${MY_CONF} --enable-authnz_ldap=${mod_type} --enable-ldap=${mod_type}"
MY_MODS="${MY_MODS} ldap authnz_ldap"
else
@ -298,7 +293,7 @@ setup_modules() {
check_module_critical
}
# @ECLASS-VARIABLE: MODULE_DEFINES
# @VARIABLE: MODULE_DEFINES
# @DESCRIPTION:
# 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
@ -310,7 +305,7 @@ setup_modules() {
# This internal function generates the LoadModule lines for httpd.conf based on
# the current module selection and MODULE_DEFINES
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
sed -i -e "/%%LOAD_MODULE%%/d" \
@ -372,6 +367,10 @@ check_upgrade() {
apache-2_pkg_setup() {
check_upgrade
# setup apache user and group
enewgroup apache 81
enewuser apache 81 -1 /var/www apache
setup_mpm
setup_modules
@ -379,10 +378,6 @@ apache-2_pkg_setup() {
MY_CONF="${MY_CONF} --enable-maintainer-mode --enable-exception-hook"
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 "Make sure CONFIG_SYSVIPC=y is set."
elog
@ -457,7 +452,7 @@ apache-2_src_compile() {
# @FUNCTION: apache-2_src_install
# @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
apache-2_src_install() {
make DESTDIR="${D}" install || die "make install failed"
@ -489,10 +484,8 @@ apache-2_src_install() {
# link apache2ctl to the init script
dosym /etc/init.d/apache2 /usr/sbin/apache2ctl
# provide symlinks for all the stuff we no longer rename, bug 177697
for i in suexec apxs; do
dosym /usr/sbin/${i} /usr/sbin/${i}2
done
# provide legacy symlink for apxs, bug 177697
dosym /usr/sbin/apxs /usr/sbin/apxs2
# install some thirdparty scripts
exeinto /usr/sbin
@ -510,16 +503,18 @@ apache-2_src_install() {
rm -Rf "${D}/usr/share/doc/${PF}/manual"
fi
# the default webroot gets stored in /usr/share/doc
ebegin "Installing default webroot to /usr/share/doc/${PF}"
mv -f "${D}/var/www/localhost" "${D}/usr/share/doc/${PF}/webroot"
# the default webroot gets stored in /usr/share/${PF}/webroot
ebegin "Installing default webroot to /usr/share/${PF}/webroot"
dodir /usr/share/${PF}
mv -f "${D}/var/www/localhost" "${D}/usr/share/${PF}/webroot"
eend $?
keepdir /var/www/localhost/htdocs
# set some sane permissions for suexec
if use suexec ; then
fowners 0:apache /usr/sbin/suexec
fperms 4710 /usr/sbin/suexec
# provide legacy symlink for suexec, bug 177697
dosym /usr/sbin/suexec /usr/sbin/suexec2
fi
# empty dirs
@ -536,13 +531,14 @@ apache-2_src_install() {
# @FUNCTION: apache-2_pkg_postinst
# @DESCRIPTION:
# 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
# the default webroot is a copy of the files that exist elsewhere and we don't
# want them to be managed/removed by portage when apache is upgraded.
# default webroot to /var/www/localhost if it does not exist. We do this here
# because the default webroot is a copy of the files that exist elsewhere and we
# don't want them to be managed/removed by portage when apache is upgraded.
apache-2_pkg_postinst() {
einfo
if use ssl && [[ ! -e "${ROOT}/etc/apache2/ssl/server.crt" ]] ; then
cd "${ROOT}"/etc/apache2/ssl
einfo
einfo "Generating self-signed test certificate in ${ROOT}etc/apache2/ssl ..."
yes "" 2>/dev/null | \
"${ROOT}"/usr/sbin/gentestcrt.sh >/dev/null 2>&1 || \
@ -561,19 +557,19 @@ apache-2_pkg_postinst() {
else
einfo "Installing default webroot to ${ROOT}var/www/localhost"
mkdir -p "${ROOT}"/var/www/localhost
cp -R "${ROOT}"/usr/share/doc/${PF}/webroot/* "${ROOT}"/var/www/localhost
chown -R apache:0 "${ROOT}"/var/www/localhost
cp -R "${ROOT}"/usr/share/${PF}/webroot/* "${ROOT}"/var/www/localhost/
einfo
fi
}
# @FUNCTION: apache-2_pkg_config
# @DESCRIPTION:
# This function installs -- and removes a previously existing -- default webroot
# to /var/www/localhost
# This function installs -- and overwrites -- the default webroot to
# /var/www/localhost
apache-2_pkg_config() {
einfo "Installing default webroot to ${ROOT}var/www/localhost"
mkdir "${ROOT}"var{,/www{,/localhost}}
cp -R "${ROOT}"usr/share/doc/${PF}/webroot/* "${ROOT}"var/www/localhost/
mkdir -p "${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

View File

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