SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "apache-mod-wsgi-python3"

# SliTaz package receipt.

PACKAGE="apache-mod-wsgi-python3"
SOURCE="apache-mod-wsgi"
VERSION="5.0.2"
CATEGORY="network"
SHORT_DESC="Python WSGI adapter module for Apache."
MAINTAINER="erjo@slitaz.org"
LICENSE="Apache"
WEB_SITE="https://github.com/GrahamDumpleton/mod_wsgi"
REPOLOGY="apmod:wsgi"

TARBALL="$SOURCE-$VERSION.tar.gz"
WGET_URL="$WEB_SITE/archive/$VERSION.tar.gz"

DEPENDS="apache python3"
BUILD_DEPENDS="acl acl-dev apache apache-dev apr-dev \
apr-util-dev python3-dev sed"

HOST_ARCH="i486 x86_64"

current_version()
{
    wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
    sed '/archive.*tar/!d;s|.*/\(.*\).tar.*|\1|;q'
}

# Rules to configure and make the package.
compile_rules()
{
    ./configure         \
        --prefix=/usr     \
        --with-python=python3 &&
    make &&
    make install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/etc/apache/extra $fs/usr/share/apache/modules

    cp -a $install/usr/share/apache/modules/mod_wsgi.so \
        $fs/usr/share/apache/modules/mod_wsgi_py3.so
    cp $stuff/httpd-mod-wsgi-py3.conf    $fs/etc/apache/extra
}

post_install()
{
    if ! grep -q  WSGI_PY3 "$1/etc/apache/httpd.conf"; then
        # Enable WSGI_PY3 module
        echo "# Python WSGI_PY3 module" >> "$1/etc/apache/httpd.conf"
        echo "Include /etc/apache/extra/httpd-mod-wsgi-py3.conf" >> "$1/etc/apache/httpd.conf"
    fi
}

post_remove()
{
    # Remove WSGI configuration
    sed -i    -e s/\# Python WSGI_PY3.*//        \
        -e s/.*httpd-mod-wsgi-py3.conf//    \
        "$1/etc/apache/httpd.conf"
}
6107 packages and 261132 files in current database (Mon Jul 7 00:01:25 2025)