diff options
author | 2003-10-29 07:07:01 +0000 | |
---|---|---|
committer | 2003-10-29 07:07:01 +0000 | |
commit | 957879d8908fab7bc9ee1b005c1836f3dcb95d07 (patch) | |
tree | 7ad49b497d7e93dc2c69a03914ccf3e48dbf9a01 /net-www/mod_pcgi2/mod_pcgi2-2.0.1.ebuild | |
parent | metalog fix0r (diff) | |
download | gentoo-2-957879d8908fab7bc9ee1b005c1836f3dcb95d07.tar.gz gentoo-2-957879d8908fab7bc9ee1b005c1836f3dcb95d07.tar.bz2 gentoo-2-957879d8908fab7bc9ee1b005c1836f3dcb95d07.zip |
fix compile issues with patch, needs to be sent upstream
Diffstat (limited to 'net-www/mod_pcgi2/mod_pcgi2-2.0.1.ebuild')
-rw-r--r-- | net-www/mod_pcgi2/mod_pcgi2-2.0.1.ebuild | 81 |
1 files changed, 72 insertions, 9 deletions
diff --git a/net-www/mod_pcgi2/mod_pcgi2-2.0.1.ebuild b/net-www/mod_pcgi2/mod_pcgi2-2.0.1.ebuild index 54a1322d0910..439ceb48b3bf 100644 --- a/net-www/mod_pcgi2/mod_pcgi2-2.0.1.ebuild +++ b/net-www/mod_pcgi2/mod_pcgi2-2.0.1.ebuild @@ -1,16 +1,46 @@ # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-www/mod_pcgi2/mod_pcgi2-2.0.1.ebuild,v 1.3 2003/09/06 01:54:08 msterret Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-www/mod_pcgi2/mod_pcgi2-2.0.1.ebuild,v 1.4 2003/10/29 07:06:59 robbat2 Exp $ -apachedir='1' -apache='' -use apache2 && apache=2 apachedir=2 +detectapache() { + local domsg= + [ -n "$1" ] && domsg=1 + HAVE_APACHE1= + HAVE_APACHE2= + has_version '=net-www/apache-1*' && HAVE_APACHE1=1 + has_version '=net-www/apache-2*' && HAVE_APACHE2=1 + + [ -n "${HAVE_APACHE1}" ] && APACHEVER=1 + [ -n "${HAVE_APACHE2}" ] && APACHEVER=2 + [ -n "${HAVE_APACHE1}" ] && [ -n "${HAVE_APACHE2}" ] && APACHEVER='both' + + case "${APACHEVER}" in + 1) [ -n "${domsg}" ] && einfo 'Apache1 only detected' ;; + 2) [ -n "${domsg}" ] && einfo 'Apache2 only detected';; + both) + if [ "`use apache2`" ]; then + [ -n "${domsg}" ] && einfo "Multiple Apache versions detected, using Apache2 (USE=apache2)" + APACHEVER=2 + else + [ -n "${domsg}" ] && einfo 'Multiple Apache versions detected, using Apache1 (USE=-apache2)' + APACHEVER=1 + fi ;; + *) if [ -n "${domsg}" ]; then + MSG="Unknown Apache version!"; eerror $MSG ; die $MSG + else + APACHEVER=0 + fi; ;; + esac +} +detectapache +SLOT="${APACHEVER}" +[ "${APACHEVER}" -eq '2' ] && USE_APACHE2='2' || USE_APACHE2='' DESCRIPTION="An Apache module to talk to Zope Corporation's PCGI" HOMEPAGE="http://www.zope.org/Members/phd/${PN}/" SRC_URI="http://zope.org/Members/phd/${PN}/${PV}/${P}-src.tar.gz" LICENSE="GPL-2" -SLOT="${apachedir}" +SLOT="${APACHEVER}" KEYWORDS="~x86" IUSE="apache2" @@ -21,13 +51,20 @@ DEPEND="${DEPEND} #RDEPEND="" S=${WORKDIR}/${PN/mod_} +src_unpack() { + unpack ${A} + epatch ${FILESDIR}/${PN}-2.0.1-macrofix.patch +} + src_compile() { - if use apache2; then + detectapache true + if [ -n "${USE_APACHE2}" ]; then apxs2 \ -n pcgi2 \ -DUNIX -DAPACHE2 -DMOD_PCGI2 \ - -c mod_pcgi2.c pcgi-wrapper.c parseinfo.c - #-o mod_pcgi.so \ + -c mod_pcgi2.c pcgi-wrapper.c parseinfo.c \ + || die "axps2 failed!" + #-o mod_pcgi2.so \ else apxs \ -Wc,-DMOD_PCGI2 \ @@ -35,14 +72,40 @@ src_compile() { -Wc,-DHAVE_UNION_SEMUN \ -I./ \ -o mod_pcgi2.so \ - -c mod_pcgi2.c parseinfo.c pcgi-wrapper.c + -c mod_pcgi2.c parseinfo.c pcgi-wrapper.c \ + || die "axps failed!" fi } src_install() { + detectapache dodoc NEWS README TODO ChangeLog exeinto /usr/lib/apache${apache}-extramodules doexe .libs/${PN}.so insinto /etc/apache${apache}/conf/modules.d doins ${FILESDIR}/20_mod_pcgi.conf } + +pkg_postinst() { + detectapache + if [ -n "${USE_APACHE2}" ] ; then + einfo "Add '-D PCGI' to your APACHE2_OPTS in /etc/conf.d/apache2" + else + einfo "1. Execute the command:" + einfo " \"ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config\"" + einfo "2. Edit /etc/conf.d/apache and add \"-D PCGI\" to APACHE_OPTS" + fi +} + +pkg_config() { + detectapache + if [ -n "${USE_APACHE2}" ] ; then + einfo "Add '-D PCGI' to your APACHE2_OPTS in /etc/conf.d/apache2" + else + ${ROOT}/usr/sbin/apacheaddmod \ + ${ROOT}/etc/apache/conf/apache.conf \ + extramodules/mod_pcgi2.so mod_pcgi2.c pcgi_module \ + before=perl define=pcgi addconf=conf/modules.d/20_mod_pcgi.conf + :; + fi +} |