aboutsummaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>2009-04-02 14:11:51 +0000
committerrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>2009-04-02 14:11:51 +0000
commit0c700aec845def5dc0d56d56b4fd216b9dc1f5fb (patch)
treec7a737ed8e2c356ee92f1916f926327b7280f1cd /dev
parentc962246be6aa3b715e2510d07496c7d8f72ca33a (diff)
downloadslackbuilds-0c700aec845def5dc0d56d56b4fd216b9dc1f5fb.tar.gz
slackbuilds-0c700aec845def5dc0d56d56b4fd216b9dc1f5fb.tar.bz2
mod_python: adding mkbuild
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@2132 370017ae-e619-0410-ac65-c121f96126d4
Diffstat (limited to 'dev')
-rw-r--r--dev/python/mod_python/Manifest25
-rw-r--r--dev/python/mod_python/mod_python-3.3.1.diff12
-rwxr-xr-xdev/python/mod_python/mod_python.SlackBuild296
-rwxr-xr-xdev/python/mod_python/mod_python.build145
4 files changed, 307 insertions, 171 deletions
diff --git a/dev/python/mod_python/Manifest b/dev/python/mod_python/Manifest
new file mode 100644
index 00000000..240d6aff
--- /dev/null
+++ b/dev/python/mod_python/Manifest
@@ -0,0 +1,25 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+DIST mod_python-3.3.1.tgz 447954 MD5 a3b0150176b726bd2833dac3a7837dc5 RMD160 f78f93172963317f4318f8f2455419743c8fb4f5 SHA1 e538170fd78e09408b6d8593da980b126a0fef93 SHA256 ad2331fd5fcfd720ef9e3482973fc2d06eff36ba0c44693cfa42056a62175a6b SHA512 b3c3d5ed624e0152d8904a7566be80c04622889b79350bb981e8adfbcc62a22cde6ebe609d76a67c57096b8d3fcdfd6c59e47aac39b73e614f8192e3061164f9
+DIST mod_python-3.3.tgz
+MKBUILD mod_python.mkbuild 5003 MD5 2cd617be92015f20e80a06fac22b3a8c RMD160 0bf5a13fc0bfa4272585f015a858b8d75a58e6b5 SHA1 a1800ab4ac071b42642a8bc40ff592e5babe233f SHA256 ae25a066c50faff979b80652f497f3e5c22bc0dc7a58569921ac0d01be1b2069 SHA512 f1a0c2ede525b207636207457b7ea76ef3f6ba10957c0fcd79a607c412e05bddbebc0c86ea6c33428d6b0df8750be7d51b30fcf414374dfbd0159dd31b5d9f90
+PATCH mod_python-3.3.1.diff 516 MD5 9adc3977ca7110b2f293622bfbf21b16 RMD160 24348d48af36f13f171e0b050395ccbd663727e4 SHA1 2fe2fee84becc11fa38942147e984b0b4d05166a SHA256 df323c28ba04cc30a9ddf1d9b0e9f0d2abeb15f961533ef941e6180dab1de0c7 SHA512 605bf82f9216b842deb65823dfe70961ac5593150291ee7559f6768bde1fa7eac30d0074f3c273d286ee3cc152cf7f805503910246455375e994479561bd2065
+SLACKBUILD mod_python.SlackBuild 9532 MD5 a6bdc9f7da9dd5ca2144c240ff69a897 RMD160 d15fe0c29bc2152cd5d10003517f506ca15d2d5f SHA1 3ba9686db4dc6a0acfefc8e558a607516ec7b5f8 SHA256 bdd86c71a94e1a12ba167715e99c41ba0e463ce34969188ff1ed4994ad812657 SHA512 f716d0ee5d1ecc72d2299978b32d2807f07b2fb5d2b3cf208ba95073d49b2a95ed96707c5931b2e587c69079512b7802982b3f19d4f0e6012a3b5d03fd7aadf3
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBAgAGBQJJ1MhFAAoJEEHL93ESzgei/44P+gKe0J2U7nwf4y5P+r5co2zu
+k2gwPFzEMz6BA3amFbXIADpYkEIl/cANDIIqh4vrvzedyJzFQbw1VUxuNTak5Zd6
+kwQOH/Q2S2XbFSqxzqEazxZCdQjHZ5RVoUb5cSCc0Aba+Aza1RKqpi2MWxy0LkWB
+bBVkcEqK8IoOoqdjT08QKxIikTocTlWRYQasWt2LXnFdSnANpZHK+OSeDnfhSjcm
+CC4MoLfaP1zIWvKTV9SQX1ixNgTTq0CFrQmFm+JxOEZ43MKTJQx7SvDahxLO7COX
+mEAcUR6yKNaturLObRYMA64ktdD7JCSByK0RUWTrQBaWX1oI44Sti5aV7dOw3Tks
+h5o3vdFOIcm+rZFdRy0PKaj0hBs5P14N+SV2yTD01Z1dkUqqIJ1qP9p/Waog/YWo
+Baa44Zjbx0F+iJwwFed0i3Uy0Yls3H7kTmp9GG6S7eLwxNMTiz5zUqXucQxq/47g
+4xmvDvuX32obB0lvm8qipkrQ6fYi0CnbdGrZkxonWzRnbI/W74mQZ8OJIzpNtvm6
+/Khi96A4x6fWytHwAnQGsq+rHB0IyAjXoKa6deQNza/K6/eZXz57FeArJ4u4u1OK
+/YBEU1ZMlyXyvABicxgNJIvTYiYwYvN+pccGjeARvqxlRIU9r7H2/dtHV+lmlaho
+XdMVBVFV/1kgiPvzFJnC
+=ZwwU
+-----END PGP SIGNATURE-----
diff --git a/dev/python/mod_python/mod_python-3.3.1.diff b/dev/python/mod_python/mod_python-3.3.1.diff
new file mode 100644
index 00000000..216b0497
--- /dev/null
+++ b/dev/python/mod_python/mod_python-3.3.1.diff
@@ -0,0 +1,12 @@
+diff -rNu mod_python-3.3.1/src/connobject.c mod_python-3.3.1-atomix/src/connobject.c
+--- mod_python-3.3.1/src/connobject.c 2006-12-03 05:36:37.000000000 +0100
++++ mod_python-3.3.1-atomix/src/connobject.c 2008-10-02 14:10:02.000000000 +0200
+@@ -139,7 +139,7 @@
+ bytes_read = 0;
+
+ while ((bytes_read < len || len == 0) &&
+- !(b == APR_BRIGADE_SENTINEL(b) ||
++ !(b == APR_BRIGADE_SENTINEL(bb) ||
+ APR_BUCKET_IS_EOS(b) || APR_BUCKET_IS_FLUSH(b))) {
+
+ const char *data;
diff --git a/dev/python/mod_python/mod_python.SlackBuild b/dev/python/mod_python/mod_python.SlackBuild
index 9e3ce25c..7b3056f9 100755
--- a/dev/python/mod_python/mod_python.SlackBuild
+++ b/dev/python/mod_python/mod_python.SlackBuild
@@ -1,48 +1,292 @@
#!/bin/bash
#
-# mod_python.SlackBuild is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or any later version.
+# mod_python.SlackBuild is free software; you can redistribute
+# it and/or modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the License,
+# or any later version.
#
-# mod_python.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+# mod_python.SlackBuild is distributed in the hope that it will
+# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place - Suite 330, Boston, MA 02111-1307, USA
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#
-# SlackBuild script to call mod_python.build with correct settings
+# slackbuild for mod_python, by Silvio Rhatto
+# requires:
+# tested: mod_python-3.3.1
+# model: generic.mkSlackBuild $Rev: 805 $
#
-CWD="`pwd`"
-
+# Look for slackbuildrc
if [ -f ~/.slackbuildrc ]; then
source ~/.slackbuildrc
elif [ -f /etc/slackbuildrc ]; then
source /etc/slackbuildrc
fi
-# default settings
-PACKAGE="mod_python"
-VERSION=${VERSION:=2.7.11}
-ARCH="${ARCH:=x86_64}"
-BUILD=${BUILD:=6rha}
-SRC_DIR=${SRC:=$CWD}
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="mod_python"
+PKG_NAME="mod_python"
+ARCH=${ARCH:=i486}
+SRC_VERSION=${VERSION:=3.3.1}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rha}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
REPOS=${REPOS:=$TMP}
+SLACKBUILD_PATH=${SLACKBUILD_PATH:="dev/python/mod_python"}
+PREFIX=${PREFIX:=/usr}
+PKG_WORK="$TMP/$SRC_NAME"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:=""}
+
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
+
+if [ "$ARCH" = "i386" ]; then
+ SLKCFLAGS="-O2 -march=i386 -mtune=i686"
+elif [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686"
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIR="$PREFIX/lib64"
+ LDFLAGS="-L/lib64 -L/usr/lib64"
+fi
+
+# Set error codes (used by createpkg)
+ERROR_WGET=31; ERROR_MAKE=32; ERROR_INSTALL=33
+ERROR_MD5=34; ERROR_CONF=35; ERROR_HELP=36
+ERROR_TAR=37; ERROR_MKPKG=38; ERROR_GPG=39
+ERROR_PATCH=40; ERROR_VCS=41; ERROR_MKDIR=42
+ERROR_MANIFEST=43;
-rm -rf $TMP/$PACKAGE
-mkdir -p $SRC_DIR/$PACKAGE $TMP/$PACKAGE
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_WORK" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
-export PACKAGE VERSION ARCH BUILD SRC_DIR TMP REPOS
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR
-if which simpletrack &> /dev/null; then
- simpletrack $PACKAGE.build
+# Dowload source if necessary
+SRC="$SRC_NAME-$VERSION.tgz"
+URL="http://www.apache.org/dist/httpd/modpython/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! gzip -t "$SRC_DIR/$SRC" 2> /dev/null; then
+ wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
+fi
+
+# Import minimized signing key from
+if echo [[SIGNING KEY URL]] | grep -q -v "SIGNING KEY URL"; then
+ lynx -dump [[SIGNING KEY URL]] | gpg --import || exit $ERROR_GPG
+elif echo A879FCF5 | grep -q -v "SIGNING KEY ID"; then
+ gpg --recv-keys A879FCF5 || exit $ERROR_GPG
else
- slacktrack -b $REPOS -x $TMP,$SRC_DIR,/dev -jefkzp "$PACKAGE-$VERSION-$ARCH-$BUILD.tgz" "./$PACKAGE.build"
+ gpg --import << EOKEY || exit $ERROR_GPG
+[[SIGNING KEY]]
+EOKEY
fi
-if [ "$CLEANUP" == "yes" ]; then
- rm -rf $TMP/$PACKAGE
+# Download source's signature if necessary and check it
+if echo [[SIGNING URL]] | grep -q -v "SIGNING URL"; then
+ SIGNATURE="`basename [[SIGNING URL]]`"
+ if [ ! -s "$SRC_DIR/$SIGNATURE" ]; then
+ wget "[[SIGNING URL]]" -O "$SRC_DIR/$SIGNATURE" || exit $ERROR_WGET
+ fi
+else
+ if [ -s "$SRC_DIR/$SRC.sig" ]; then
+ SIGNATURE="$SRC.sig"
+ elif [ -s "$SRC_DIR/$SRC.asc" ]; then
+ SIGNATURE="$SRC.asc"
+ else
+ echo Trying to get signature file from $URL.sig...
+ if wget "$URL.sig" -O "$SRC_DIR/$SRC.sig"; then
+ SIGNATURE="$SRC.sig"
+ else
+ rm $SRC_DIR/$SRC.sig
+ echo Trying to get signature file from $URL.asc...
+ if wget "$URL.asc" -O "$SRC_DIR/$SRC.asc"; then
+ SIGNATURE="$SRC.asc"
+ else
+ rm $SRC_DIR/$SRC.asc
+ echo "Error getting source's signature file"
+ exit $ERROR_GPG
+ fi
+ fi
+ fi
+fi
+
+echo Checking $SRC_DIR/$SRC with gpg using $SRC_DIR/$SIGNATURE...
+gpg --verify "$SRC_DIR/$SIGNATURE" "$SRC_DIR/$SRC" || exit $ERROR_GPG
+echo Success.
+
+# Check Manifest file
+if [ -e "$CWD/Manifest" ]; then
+
+ # Manifest signature checking
+ if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" $CWD/Manifest; then
+ echo "Checking Manifest signature..."
+ gpg --verify $CWD/Manifest
+ if [ "$?" != "0" ]; then
+ exit $ERROR_MANIFEST
+ fi
+ fi
+
+ MANIFEST_LINES="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | wc -l`"
+
+ for ((MANIFEST_COUNT=1; MANIFEST_COUNT <= $MANIFEST_LINES; MANIFEST_COUNT++)); do
+
+ MANIFEST_LINE="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | head -n $MANIFEST_COUNT | tail -n 1`"
+ MANIFEST_FILE="`echo $MANIFEST_LINE | awk '{ print $2 }'`"
+ MANIFEST_FILE_TYPE="`echo $MANIFEST_LINE | awk '{ print $1 }'`"
+
+ if [ -e "$SRC_DIR/$MANIFEST_FILE" ]; then
+ MANIFEST_FILE="$SRC_DIR/$MANIFEST_FILE"
+ else
+ MANIFEST_FILE="`find $CWD -name $MANIFEST_FILE`"
+ fi
+
+ if [ ! -e "$MANIFEST_FILE" ] || [ -d "$MANIFEST_FILE" ]; then
+ continue
+ fi
+
+ echo "Checking Manifest for $MANIFEST_FILE_TYPE $MANIFEST_FILE integrity..."
+
+ SIZE_SRC="`wc -c $MANIFEST_FILE | awk '{ print $1 }'`"
+ SIZE_MANIFEST="`echo $MANIFEST_LINE | awk '{ print $3 }'`"
+
+ # Check source code size
+ if [ "$SIZE_SRC" != "$SIZE_MANIFEST" ]; then
+ echo "SIZE Manifest: $SIZE_MANIFEST; SIZE $SRC: $SIZE_SRC"
+ exit $ERROR_MANIFEST
+ else
+ echo "Size match."
+ fi
+
+ # Check source code integrity
+ for ALGO in md5 rmd160 sha1 sha256 sha512; do
+ if [ $ALGO = "rmd160" ]; then
+ ALGO_SRC="`openssl rmd160 $MANIFEST_FILE | awk '{ print $2 }'`"
+ else
+ ALGO_SRC="`"$ALGO"sum $MANIFEST_FILE | awk '{ print $1 }'`"
+ fi
+ ALGO="`echo $ALGO | tr '[:lower:]' '[:upper:]'`"
+ ALGO_MANIFEST=$(echo $MANIFEST_LINE | sed "s/.* $ALGO //" | awk '{ print $1 }')
+ if [ "$ALGO_SRC" != "$ALGO_MANIFEST" ]; then
+ echo "$ALGO Manifest: $ALGO_MANIFEST; $ALGO $SRC: $ALGO_SRC"
+ exit $ERROR_MANIFEST
+ else
+ echo "$ALGO match."
+ fi
+ done
+
+ done
+
+else
+ exit $ERROR_MANIFEST
+fi
+
+# Untar
+cd "$PKG_WORK"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`"
+cd "$PKG_SRC"
+
+# Patch source
+patches=" [[PATCH URLS]]
+ $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff
+ $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff"
+for patch in $patches; do
+ patch="`basename $patch`"
+ if [ -f "$CWD/$patch" ]; then
+ patch -Np1 < "$CWD/$patch" || exit $ERROR_PATCH
+ elif [ -f "$CWD/patches/$patch" ]; then
+ patch -Np1 < "$CWD/patches/$patch" || exit $ERROR_PATCH
+ elif [ -f "$CWD/$patch.gz" ]; then
+ gzip -dc "$CWD/$patch.gz" | patch -Np1 || exit $ERROR_PATCH
+ elif [ -f "$CWD/patches/$patch.gz" ]; then
+ gzip -dc "$CWD/patches/$patch.gz" | patch -Np1 || exit $ERROR_PATCH
+ elif [ -f "$SRC_DIR/$patch" ]; then
+ if [ "`basename $patch .gz`" != "$patch" ]; then
+ gzip -dc $SRC_DIR/$patch | patch -Np1 || exit $ERROR_PATCH
+ elif [ "`basename $patch .bz2`" != "$patch" ]; then
+ bzip2 -dc $SRC_DIR/$patch | patch -Np1 || exit $ERROR_PATCH
+ else
+ patch -Np1 < "$SRC_DIR/$patch" || exit $ERROR_PATCH
+ fi
+ fi
+done
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS" \
+ ./configure \
+ --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
+# Strip binaries
+( cd "$PKG"
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Install documentation
+DOCS="COPYRIGHT CREDITS LICENSE NEWS NOTICE README"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+for doc in $DOCS; do
+ if [ -f "$doc" ]; then
+ cp -a $doc "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+ fi
+done
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ _ |-----handy-ruler---------------------------------------------------|
+mod_python: mod_python (Apache/Python Integration)
+mod_python:
+mod_python: Mod_python is an Apache module that embeds the Python interpreter
+mod_python: within the server. With mod_python you can write web-based
+mod_python: applications in Python that will run many times faster than
+mod_python: traditional CGI and will have access to advanced features such as
+mod_python: ability to retain database connections and other data between hits
+mod_python: and access to Apache internals
+mod_python:
+mod_python:
+mod_python:
+EODESC
+
+# Build the package
+cd "$PKG"
+mkdir -p $REPOS/$SLACKBUILD_PATH
+makepkg -l y -c n "$REPOS/$SLACKBUILD_PATH/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
+
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then
+ rm -rf "$PKG_WORK" "$PKG"
fi
diff --git a/dev/python/mod_python/mod_python.build b/dev/python/mod_python/mod_python.build
deleted file mode 100755
index af432724..00000000
--- a/dev/python/mod_python/mod_python.build
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/bin/bash
-#
-# mod_python.build is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or any later version.
-#
-# mod_python.build is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place - Suite 330, Boston, MA 02111-1307, USA
-#
-# build script for mod_python
-# by rhatto at riseup.net
-# build it with slacktrack, example:
-#
-# slacktrack -jefkzp "mod_python-2.7.11-x86_64-1rha.tgz" "./mod_python.build"
-#
-
-CWD="`pwd`"
-
-if [ -f "/etc/slackbuildrc" ]; then
- source /etc/slackbuildrc
-fi
-
-if [ -f "~/.slackbuildrc" ]; then
- source ~/.slackbuildrc
-fi
-
-# default settings
-PACKAGE="mod_python"
-VERSION=${VERSION:=2.7.11}
-ARCH="${ARCH:=x86_64}"
-BUILD=${BUILD:=6rha}
-SRC_DIR=${SRC:=$CWD}
-TMP=${TMP:=/tmp}
-
-# ------- error codes for createpkg --------------
-ERROR_WGET=31; ERROR_MAKE=32; ERROR_INSTALL=33
-ERROR_MD5=34; ERROR_CONF=35; ERROR_HELP=36
-ERROR_TAR=37; ERROR_MKPKG=38; ERROR_GPG=39
-ERROR_PATCH=40
-
-if [ "$ARCH" == "x86_64" ]; then
- export CFLAGS="-fPIC"
- export LDFLAGS="-L/lib64 -L/usr/lib64 -fPIC"
- LIBDIR=/usr/lib64
-else
- LIBDIR=/usr/lib
-fi
-
-RTOOL="wget"
-PACKAGE_EXT="tgz"
-SRC="$PACKAGE-$VERSION.$PACKAGE_EXT"
-URL="http://ftp.unicamp.br/pub/apache/httpd/modpython/$SRC"
-
-SRC_DIR="$SRC_DIR/$PACKAGE"
-
-if [ ! -d "$SRC_DIR" ]; then
- mkdir -p $SRC_DIR
-fi
-
-if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then
- wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
-fi
-
-TMP="$TMP/$PACKAGE"
-
-if [ ! -d "$TMP" ]; then
- mkdir -p $TMP
-fi
-
-cd $TMP
-
-tar xvf $SRC_DIR/$SRC || exit $ERROR_TAR
-cd $PACKAGE-$VERSION
-
-if [ -f "$CWD/$PACKAGE-$VERSION.diff" ]; then
- patch -p1 < $CWD/$PACKAGE-$VERSION.diff || exit $ERROR_PATCH
-fi
-
-if [ -f "$CWD/$PACKAGE-$VERSION-$ARCH.diff" ]; then
- patch -p1 < $CWD/$PACKAGE-$VERSION-$ARCH.diff || exit $ERROR_PATCH
-fi
-
-./configure || exit $ERROR_CONF
-
-# coxa, favor corrigir!
-if [ "$ARCH" == "x86_64" ]; then
- sed -e 's/^OPT=$/OPT=-fPIC -DEAPI/' src/Makefile > src/Makefile.new
- sed -e 's/^PY_STD_LIB=\/usr\/lib/PY_STD_LIB=\/usr\/lib64/' src/Makefile.new > src/Makefile
- # mv src/Makefile.new src/Makefile
- mv lib lib64
-else
- sed -e 's/^OPT=$/OPT=-DEAPI/' src/Makefile > src/Makefile.new
- mv src/Makefile.new src/Makefile
-fi
-
-make || exit $ERROR_MAKE
-make install || exit $ERROR_INSTALL
-
-# strip
-strip --strip-unneeded /usr/libexec/apache/mod_python.so
-
-CWD="`pwd`"
-
-mkdir /install
-
-cat << EOF > /install/slack-desc
-# HOW TO EDIT THIS FILE:
-# The "handy ruler" below makes it easier to edit a package description. Line
-# up the first '|' above the ':' following the base package name, and the '|'
-# on the right side marks the last column you can put a character in. You must
-# make exactly 11 lines for the formatting to be correct. It's also
-# customary to leave one space after the ':'.
-
- |-----handy-ruler-----------------------------------------------------|
-mod_python: mod_python (Apache/Python Integration)
-mod_python:
-mod_python: Mod_python is an Apache module that embeds the Python interpreter
-mod_python: within the server. With mod_python you can write web-based
-mod_python: applications in Python that will run many times faster than
-mod_python: traditional CGI and will have access to advanced features such as
-mod_python: ability to retain database connections and other data between hits
-mod_python: and access to Apache internals
-mod_python:
-mod_python:
-mod_python:
-EOF
-
-# docs
-mkdir -p /usr/doc/$PACKAGE-$VERSION
-
-for file in COPYRIGHT CREDITS NEWS README; do
- cp $CWD/$file* /usr/doc/$PACKAGE-$VERSION/
-done
-
-# install script
-echo '( echo Now dont forget to edit your main config and add )' > /install/doinst.sh
-echo '( echo LoadModule python_module /usr/libexec/apache/mod_python.so )' >> /install/doinst.sh
-echo '( echo If your configuration uses ClearModuleList, then also add )' >> /install/doinst.sh
-echo '( echo AddModule mod_python.c )' >> /install/doinst.sh
-