2010-05-11 22:54:56 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
## Slackware build script for mod_wsgi
|
|
|
|
##
|
|
|
|
## Copyright 2008 Adis Nezirovic <adis _at_ linux.org.ba>
|
|
|
|
## Licensed under GNU GPL v2
|
|
|
|
|
|
|
|
PRGNAM=mod_wsgi
|
2010-05-13 00:37:20 +02:00
|
|
|
VERSION=3.1
|
2011-02-14 00:36:45 +01:00
|
|
|
BUILD=${BUILD:-2}
|
2010-05-11 22:54:56 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2011-02-14 00:36:45 +01:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-11 22:54:56 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
# CFLAGS are automatically picked from Python
|
2010-05-13 00:37:20 +02:00
|
|
|
if [ "$ARCH" = "x86_64" ]; then
|
|
|
|
LIBDIRSUFFIX="64"
|
|
|
|
else
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
fi
|
2010-05-11 22:54:56 +02:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
|
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
|
|
|
|
./configure
|
|
|
|
|
|
|
|
# libtool can't find shared Python library;
|
2010-05-13 00:37:20 +02:00
|
|
|
# there should be symlink to libpython in /usr/lib${LIBDIRSUFFIX}/python2.6/config
|
2010-05-11 22:54:56 +02:00
|
|
|
# see http://code.google.com/p/modwsgi/wiki/InstallationIssues
|
2010-05-13 00:37:20 +02:00
|
|
|
make LDFLAGS="-L/usr/lib${LIBDIRSUFFIX}"
|
2010-05-11 22:54:56 +02:00
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
2010-05-13 00:37:20 +02:00
|
|
|
# Strip binaries:
|
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
|
|
|
|
2011-02-14 00:36:45 +01:00
|
|
|
mkdir -p $PKG/etc/httpd/extra
|
2010-05-13 00:37:20 +02:00
|
|
|
sed "s%@baselibdir@%lib${LIBDIRSUFFIX}%" $CWD/mod_wsgi.conf > \
|
2011-02-14 00:36:45 +01:00
|
|
|
$PKG/etc/httpd/extra/mod_wsgi.conf.new
|
2010-05-13 00:37:20 +02:00
|
|
|
|
2010-05-11 22:54:56 +02:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a LICENCE README $PKG/usr/doc/$PRGNAM-$VERSION/
|
|
|
|
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README.Slackware
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
2010-05-13 00:37:20 +02:00
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
2010-05-11 22:54:56 +02:00
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:37:20 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|