diff --git a/www-apache/mod_python/Manifest b/www-apache/mod_python/Manifest new file mode 100644 index 000000000..5b2f8601a --- /dev/null +++ b/www-apache/mod_python/Manifest @@ -0,0 +1 @@ +DIST mod_python-3.5.0.tgz 571403 SHA256 0ef09058ed98b41c18d899d8b710a0cce2df2b53c44d877401133b3f28bdca90 SHA512 a8838c807db36bd316e44c43c1b1db6d6565a30d1823664f3d44667f5843274ff5f77a849fcfa226fcfb6d399ef2dd983939ff0f6db8849a3e7d25ceafe0c765 WHIRLPOOL 677db711d64d7519eca27890e865cbf773f97253b0ff97b1192b9b8a89c1427c3906b6ba5fa1fcfe146ee5c5d5afc25c141b80119df3741a80db160b0b7a64c8 diff --git a/www-apache/mod_python/files/16_mod_python.conf b/www-apache/mod_python/files/16_mod_python.conf new file mode 100644 index 000000000..9fbe3624a --- /dev/null +++ b/www-apache/mod_python/files/16_mod_python.conf @@ -0,0 +1,33 @@ + +LoadModule python_module modules/mod_python.so + +# Mod_python is a module that embeds the Python language interpreter +# within the server, allowing Apache handlers to be written in Python. + +# This will cause files beneath /home/httpd/htdocs with the extension .spam +# to be handled by the Python script /home/httpd/htdocs/eggs.py +# +# +# AddHandler python-program .spam +# PythonHandler eggs +# + +# This will cause all requests to the /python heirachy of your +# webserver to be handled by the python script /path/to/myhandler.py +# +# +# SetHandler python-program +# PythonPath "sys.path + ['/path/to']" +# PythonHandler myhandler +# + +# This will cause all requests to the /python heirachy of your +# webserver to be handled by mod_python's Publisher handler +# +# +# SetHandler python-program +# PythonHandler mod_python.publisher +# + + +# vim: ts=4 filetype=apache diff --git a/www-apache/mod_python/files/mod_python-3.5.0-buildsystem.patch b/www-apache/mod_python/files/mod_python-3.5.0-buildsystem.patch new file mode 100644 index 000000000..5941a5016 --- /dev/null +++ b/www-apache/mod_python/files/mod_python-3.5.0-buildsystem.patch @@ -0,0 +1,35 @@ +--- mod_python-3.5.0/scripts/Makefile.in ++++ mod_python-3.5.0/scripts/Makefile.in +@@ -26,4 +26,5 @@ + rm -f Makefile + + install: ++ $(INSTALL) -d $(DESTDIR)$(BINDIR) + $(INSTALL) -m 0755 mod_python $(DESTDIR)$(BINDIR)/mod_python +--- mod_python-3.5.0/dist/Makefile.in ++++ mod_python-3.5.0/dist/Makefile.in +@@ -34,9 +34,9 @@ + install_py_lib: mod_python src + @cd src; $(MAKE) psp_parser.c + if test -z "$(DESTDIR)" ; then \ +- $(PYTHON_BIN) setup.py install --optimize 2 --force ; \ ++ $(PYTHON_BIN) setup.py install --no-compile --force ; \ + else \ +- $(PYTHON_BIN) setup.py install --optimize 2 --force --root $(DESTDIR) ; \ ++ $(PYTHON_BIN) setup.py install --no-compile --force --root $(DESTDIR) ; \ + fi + + mod_python.so: +--- mod_python-3.5.0/Makefile.in ++++ mod_python-3.5.0/Makefile.in +@@ -31,8 +31,8 @@ + dso: @DSO@ + + do_dso: +- @cd src && $(MAKE) +- @cd dist && $(MAKE) build ++ cd src && $(MAKE) ++ cd dist && $(MAKE) build + @echo + @echo 'Now run sudo make install' + @echo ' (or, if you only want to perform a partial install,' diff --git a/www-apache/mod_python/files/mod_python-3.5.0-no-git-version.patch b/www-apache/mod_python/files/mod_python-3.5.0-no-git-version.patch new file mode 100644 index 000000000..7a840da13 --- /dev/null +++ b/www-apache/mod_python/files/mod_python-3.5.0-no-git-version.patch @@ -0,0 +1,10 @@ +--- dist/version.sh 2013-11-12 04:21:34.000000000 +0100 ++++ dist/version.sh.patched 2014-11-29 17:56:58.000000000 +0100 +@@ -5,6 +5,5 @@ + MAJ=`awk '/MP_VERSION_MAJOR/ {print $3}' $MPV_PATH` + MIN=`awk '/MP_VERSION_MINOR/ {print $3}' $MPV_PATH` + PCH=`awk '/MP_VERSION_PATCH/ {print $3}' $MPV_PATH` +-GIT=`git describe --always` + +-echo $MAJ.$MIN.$PCH-$GIT ++echo $MAJ.$MIN.$PCH- diff --git a/www-apache/mod_python/metadata.xml b/www-apache/mod_python/metadata.xml new file mode 100644 index 000000000..3ebe14c49 --- /dev/null +++ b/www-apache/mod_python/metadata.xml @@ -0,0 +1,21 @@ + + + + + xmw@gentoo.org + Michael Weber + + + Mod_python is an Apache module that embeds the Python interpreter within + the server. With mod_python you can write web-based applications in Python + that will run many times faster than traditional CGI and will have access + to advanced features such as ability to retain database connections and + other data between hits and access to Apache internals. + + + Mod_PythonはウェブサーバーにPythonインタープリタを埋め込むApacheモジュールです。 + Mod_PythonはPython言語のウェブベース・アプリケーションを従来のCGIよりも何倍も高> + 速に走らせることができ、データデータベースのコネクション保持に関するより高度なア + クセス機能やヒット間の他のデータやApache内部へのアクセス機能を持ちます。 + + diff --git a/www-apache/mod_python/mod_python-3.5.0.ebuild b/www-apache/mod_python/mod_python-3.5.0.ebuild new file mode 100644 index 000000000..e45a51872 --- /dev/null +++ b/www-apache/mod_python/mod_python-3.5.0.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-apache/mod_python/mod_python-3.5.0.ebuild,v 1.8 2015/06/02 05:18:18 jmorgan Exp $ + +EAPI=5 + +PYTHON_COMPAT=( python2_7 python3_3 python3_4 ) + +inherit apache-module eutils python-single-r1 + +DESCRIPTION="An Apache2 module providing an embedded Python interpreter" +HOMEPAGE="http://modpython.org/" +SRC_URI="http://dist.modpython.org/dist/${P}.tgz" + +LICENSE="Apache-2.0" +KEYWORDS="alpha amd64 ia64 ~mips ppc sparc x86" +IUSE="doc test" +SLOT="0" + +APACHE2_MOD_CONF="16_${PN}" +APACHE2_MOD_DEFINE="PYTHON" +need_apache2 + +RDEPEND="${RDEPEND}" +DEPEND="${DEPEND} + test? ( + app-admin/apache-tools + net-misc/curl + )" + +src_prepare() { + epatch "${FILESDIR}"/${P}-buildsystem.patch + epatch "${FILESDIR}"/${P}-no-git-version.patch + + export CFLAGS="$(apxs2 -q CFLAGS)" + export LDFLAGS="$(apxs2 -q LDFLAGS)" +} + +src_compile() { + default +} + +src_test() { + cd test || die + PYTHONPATH="$(ls -d ${S}/dist/build/lib.*)" ${PYTHON} test.py || die +} + +src_install() { + default + + use doc && dohtml -r doc-html/* + + apache-module_src_install +}