Initial import of mod_python.
authorTilman Klar <phoenix@gentoo.org>
Mon, 21 Oct 2002 12:43:23 +0000 (12:43 +0000)
committerTilman Klar <phoenix@gentoo.org>
Mon, 21 Oct 2002 12:43:23 +0000 (12:43 +0000)
dev-python/mod_python/ChangeLog [new file with mode: 0644]
dev-python/mod_python/files/digest-mod_python-2.7.8 [new file with mode: 0644]
dev-python/mod_python/files/mod_python.conf [new file with mode: 0644]
dev-python/mod_python/files/patch-2.7.8.diff [new file with mode: 0644]
dev-python/mod_python/mod_python-2.7.8.ebuild [new file with mode: 0644]

diff --git a/dev-python/mod_python/ChangeLog b/dev-python/mod_python/ChangeLog
new file mode 100644 (file)
index 0000000..e3dc54f
--- /dev/null
@@ -0,0 +1,10 @@
+# ChangeLog for dev-python/mod_python
+# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/mod_python/ChangeLog,v 1.1 2002/10/21 12:43:23 phoenix Exp $
+
+*mod_python-2.7.8 (21 Oct 2002)
+
+  21 Oct 2002; phoen][x <phoenix@gentoo.org> ChangeLog, mod_python-2.7.8.ebuild,
+  files/digest-mod_python-2.7.8, files/mod_python.conf, files/patch-2.7.8.diff : 
+
+  Initial import. Use this ebuild to add python support to your apache webserver.
diff --git a/dev-python/mod_python/files/digest-mod_python-2.7.8 b/dev-python/mod_python/files/digest-mod_python-2.7.8
new file mode 100644 (file)
index 0000000..6beff81
--- /dev/null
@@ -0,0 +1,2 @@
+MD5 4d5bee8317bfb45a3bb09f02b435e917 mod_python-2.7.8.tgz 176639
+MD5 52e9b875597a208fca9d393e710087b6 apache_1.3.26.tar.gz 2303147
diff --git a/dev-python/mod_python/files/mod_python.conf b/dev-python/mod_python/files/mod_python.conf
new file mode 100644 (file)
index 0000000..82c6f81
--- /dev/null
@@ -0,0 +1,5 @@
+<IfModule mod_phyton.c>
+
+       AddHandler python-program .py 
+
+</IfModule>
diff --git a/dev-python/mod_python/files/patch-2.7.8.diff b/dev-python/mod_python/files/patch-2.7.8.diff
new file mode 100644 (file)
index 0000000..d9e04e7
--- /dev/null
@@ -0,0 +1,11 @@
+--- src/Makefile.in
++++ src/Makefile.in    2000/11/27 11:11:21
+@@ -59,7 +59,7 @@
+ INCLUDES=@INCLUDES@
+ LIBS=@LIBS@
+ LDFLAGS=@LDFLAGS@
+-OPT=
++OPT=$(OPTFLAGS)
+ CFLAGS=$(OPT) $(INCLUDES) 
+ srcdir=.
+ 
diff --git a/dev-python/mod_python/mod_python-2.7.8.ebuild b/dev-python/mod_python/mod_python-2.7.8.ebuild
new file mode 100644 (file)
index 0000000..1a50a8d
--- /dev/null
@@ -0,0 +1,89 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/mod_python/mod_python-2.7.8.ebuild,v 1.1 2002/10/21 12:43:23 phoenix Exp $
+
+DESCRIPTION="Python module for Apache"
+SRC_URI="http://www.modpython.org/dist/${P}.tgz"
+HOMEPAGE="http://www.modpython.org/"
+LICENSE="AS-IS"
+KEYWORDS="~x86"
+SLOT="0"
+DEPEND=">=net-www/apache-1.3.26-r2
+       dev-lang/python"
+
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+       unpack ${A}
+       cd ${S}
+       # This patch from SuSE fixes the missing CFLAGS.
+       # If you remove it, your apache will most likely 
+       # fail (lots of dieing pids in error_log).
+       patch -p0 < ${FILESDIR}/patch-2.7.8.diff
+}
+
+src_compile() {
+       # If we dont add that, ./configure breaks this ebuild
+       # because the last task (make depend) is somehow borked
+       echo 'echo "configure done"' >> configure
+
+       export OPTFLAGS="`/usr/sbin/apxs -q CFLAGS`"
+       ./configure \
+               --with-apxs=/usr/sbin/apxs \
+               --prefix=/usr \
+               --host=${CHOST} || die "configure failed" 
+
+       cp Makefile Makefile.orig
+       sed -e 's/LIBEXECDIR=\/usr\/lib\/apache/LIBEXECDIR=${D}\/usr\/lib\/apache-extramodules/' \
+               -e 's/PY_STD_LIB=/PY_STD_LIB=${D}/' \
+               Makefile.orig > Makefile
+
+       cd src
+       cp Makefile Makefile.orig
+       sed -e 's/CFLAGS=$(OPT) $(INCLUDES)/CFLAGS=$(OPT) $(INCLUDES) -DEAPI -O0/' \
+               Makefile.orig > Makefile
+
+
+       emake || die "emake failed"
+}
+
+
+src_install() {
+       mkdir -p ${D}/usr/lib/apache-extramodules
+       mkdir ${D}/usr/lib/python2.2
+       mkdir -p /etc/apache/conf/addon-modules
+
+       # compileall.py is needed or make install will fail
+       cp /usr/lib/python2.2/compileall.py ${D}usr/lib/python2.2/
+       emake D=${D} install || die
+       rm ${D}usr/lib/python2.2/compileall.py
+
+       insinto /etc/apache/conf/addon-modules
+       doins ${FILESDIR}/mod_python.conf  
+       dodoc COPYRIGHT CREDITS NEWS README 
+       insinto /usr/share/doc/${P}/html
+       doins doc-html/*
+       insinto /usr/share/doc/${P}/html/icons
+       doins doc-html/icons/*
+}
+
+pkg_postinst() {
+       einfo
+       einfo "To have Apache run python programs, please do the following:"
+       einfo "1. Execute the command:"
+       einfo " \"ebuild /var/db/pkg/dev-python/${PF}/${PF}.ebuild config\""
+       einfo "2. Edit /etc/conf.d/apache and add \"-D PYTHON\""
+       einfo
+       einfo "That will include the ${PN} mime types in your configuration"
+       einfo "automagically and setup Apache to load ${PN} when it starts."
+       einfo
+}
+
+
+pkg_config() {
+       ${ROOT}/usr/sbin/apacheaddmod \
+               ${ROOT}/etc/apache/conf/apache.conf \
+               extramodules/mod_python.so mod_python.c python_module \
+               before=perl define=PYTHON addconf=conf/addon-modules/mod_python.conf
+       :;
+}