From d3fa3dfc30ecf000aefd23619208fdc992780670 Mon Sep 17 00:00:00 2001 From: Amy Fong Date: Tue, 8 Apr 2014 11:50:02 -0400 Subject: Package mod_wsgi openstack-dashboard uses mod_wsgi to interface with apache Signed-off-by: Amy Fong --- .../mod-wsgi/files/configure_var.patch | 100 +++++++++++++++++++++ .../recipes-support/mod-wsgi/mod-wsgi_3.4.bb | 57 ++++++++++++ 2 files changed, 157 insertions(+) create mode 100644 meta-openstack/recipes-support/mod-wsgi/files/configure_var.patch create mode 100644 meta-openstack/recipes-support/mod-wsgi/mod-wsgi_3.4.bb diff --git a/meta-openstack/recipes-support/mod-wsgi/files/configure_var.patch b/meta-openstack/recipes-support/mod-wsgi/files/configure_var.patch new file mode 100644 index 0000000..0f2c883 --- /dev/null +++ b/meta-openstack/recipes-support/mod-wsgi/files/configure_var.patch @@ -0,0 +1,100 @@ +--- + configure.ac | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +--- a/configure.ac ++++ b/configure.ac +@@ -73,18 +73,28 @@ + + AC_SUBST(PYTHON) + ++if test -z "${PYTHON_VERSION}"; then + PYTHON_VERSION=`${PYTHON} -c 'from sys import stdout; \ + from distutils import sysconfig; \ + stdout.write((sysconfig.get_config_var("VERSION")))'` ++fi + ++if test -z "${PYTHON_INCLUDEPY}"; then + CPPFLAGS1=`${PYTHON} -c 'from sys import stdout; \ + from distutils import sysconfig; \ + stdout.write("-I" + sysconfig.get_config_var("INCLUDEPY"))'` ++else ++CPPFLAGS1="${PYTHON_INCLUDEPY}" ++fi + ++if test -z "${PYTHON_CFLAGS}"; then + CPPFLAGS2=`${PYTHON} -c 'from sys import stdout; \ + from distutils import sysconfig; \ + stdout.write(" ".join(filter(lambda x: x.startswith("-D"), \ + sysconfig.get_config_var("CFLAGS").split())))'` ++else ++CPPFLAGS2="${PYTHON_CFLAGS}" ++fi + + if test "${ENABLE_EMBEDDED}" != "yes"; then + CPPFLAGS3="-DMOD_WSGI_DISABLE_EMBEDDED" +@@ -96,22 +106,43 @@ + + AC_SUBST(CPPFLAGS) + ++if test -z "${PYTHON_LIBDIR}"; then + PYTHONLIBDIR=`${PYTHON} -c 'from sys import stdout; \ + from distutils import sysconfig; \ + stdout.write(sysconfig.get_config_var("LIBDIR"))'` ++else ++PYTHONLIBDIR="${PYTHON_LIBDIR}" ++fi ++if test -z "${PYTHON_CFGDIR}"; then + PYTHONCFGDIR=`${PYTHON} -c 'from sys import stdout; \ + import distutils.sysconfig; \ + stdout.write(distutils.sysconfig.get_python_lib(plat_specific=1, \ + standard_lib=1) +"/config")'` ++else ++PYTHONCFGDIR="${PYTHON_CFGDIR}" ++fi ++if test -z "${PYTHON_FRAMEWORKDIR}"; then + PYTHONFRAMEWORKDIR=`${PYTHON} -c 'from sys import stdout; \ + from distutils import sysconfig; \ + stdout.write(sysconfig.get_config_var("PYTHONFRAMEWORKDIR"))'` ++else ++PYTHONFRAMEWORKDIR="${PYTHON_FRAMEWORKDIR}" ++fi ++ ++if test -z "${PYTHON_FRAMEWORKPREFIX}"; then + PYTHONFRAMEWORKPREFIX=`${PYTHON} -c 'from sys import stdout; \ + from distutils import sysconfig; \ + stdout.write(sysconfig.get_config_var("PYTHONFRAMEWORKPREFIX"))'` ++else ++PYTHONFRAMEWORKPREFIX="${PYTHON_FRAMEWORKPREFIX}" ++fi ++if test -z "${PYTHON_FRAMEWORK}"; then + PYTHONFRAMEWORK=`${PYTHON} -c 'from sys import stdout; \ + from distutils import sysconfig; \ + stdout.write(sysconfig.get_config_var("PYTHONFRAMEWORK"))'` ++else ++PYTHONFRAMEWORK="${PYTHON_FRAMEWORK}" ++fi + + if test "${PYTHONFRAMEWORKDIR}" = "no-framework" -o \ + "${ENABLE_FRAMEWORK}" != "yes"; then +@@ -119,12 +150,20 @@ + LDFLAGS2="-L${PYTHONCFGDIR}" + + LDLIBS1="-lpython${PYTHON_VERSION}" ++ if test -z "${PYTHON_LIBS}"; then + LDLIBS2=`${PYTHON} -c 'from sys import stdout; \ + from distutils import sysconfig; \ + stdout.write(sysconfig.get_config_var("LIBS"))'` ++ else ++ LDLIBS3="${PYTHON_LIBS}" ++ fi ++ if test -z "${PYTHON_SYSLIBS}"; then + LDLIBS3=`${PYTHON} -c 'from sys import stdout; \ + from distutils import sysconfig; \ + stdout.write(sysconfig.get_config_var("SYSLIBS"))'` ++ else ++ LDLIBS3="${PYTHON_SYSLIBS}" ++ fi + else + LDFLAGS1="-Wl,-F${PYTHONFRAMEWORKPREFIX} -framework ${PYTHONFRAMEWORK}" + diff --git a/meta-openstack/recipes-support/mod-wsgi/mod-wsgi_3.4.bb b/meta-openstack/recipes-support/mod-wsgi/mod-wsgi_3.4.bb new file mode 100644 index 0000000..af0dd3d --- /dev/null +++ b/meta-openstack/recipes-support/mod-wsgi/mod-wsgi_3.4.bb @@ -0,0 +1,57 @@ +SUMMARY = "Supports the Python WSGI interface" +DESCRIPTION = "\ + The aim of mod_wsgi is to implement a simple to use Apache module which can host \ + any Python application which supports the Python WSGI interface. The module would \ + be suitable for use in hosting high performance production web sites, as well as \ + your average self managed personal sites running on web hosting services." + +HOMEPAGE = "http://code.google.com/p/modwsgi/" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENCE;md5=3b83ef96387f14655fc854ddc3c6bd57" + +SRCNAME = "mod_wsgi" +SRC_URI = "\ + http://modwsgi.googlecode.com/files/${SRCNAME}-${PV}.tar.gz \ + file://configure_var.patch \ + " + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +SRC_URI[md5sum] = "f42d69190ea0c337ef259cbe8d94d985" +SRC_URI[sha256sum] = "ae85c98e9e146840ab3c3e4490e6774f9bef0f99b9f679fca786b2adb5b4b6e8" + +inherit autotools distutils-base + +DEPENDS += "apache2-native apache2 python-native" +RDEPENDS = "python" + +EXTRA_OECONF = "\ + --with-apxs=${STAGING_BINDIR_CROSS}/apxs \ + --disable-framework \ + PYTHON_VERSION=${PYTHON_BASEVERSION} \ + PYTHON_INCLUDEPY=-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \ + PYTHON_CFLAGS='-DNDEBUG' \ + PYTHON_LIBDIR=${STAGING_LIBDIR} \ + PYTHON_CFGDIR=${STAGING_LIBDIR}/python${PYTHON_BASEVERSION}/config \ + PYTHON_FRAMEWORKDIR='no-framework' \ + PYTHON_FRAMEWORKPREFIX=' ' \ + PYTHON_FRAMEWORK=' ' \ + PYTHON_LIBS='-lpthread -ldl -lpthread -lutil' \ + PYTHON_SYSLIBS='-lm' \ + " + +CFLAGS += " -I${STAGING_INCDIR}/apache2" + +FILES_${PN} += "/etc/apache2/" +FILES_${PN}-dbg += "${libdir}/apache2/modules/.debug" + +do_install_append() { + mkdir -p ${D}/etc/apache2/modules.d/ + echo "LoadModule wsgi_module ${libdir}/apache2/modules/mod_wsgi.so" > \ + ${D}/etc/apache2/modules.d/wsgi.load +} + +# to load: +# LoadModule wsgi_module modules/mod_wsgi.so + +# Apache/2.2.2 (Unix) mod_wsgi/1.0 Python/2.3 configured -- cgit v1.2.3-54-g00ecf