summaryrefslogtreecommitdiff
path: root/network/mod_geoip2/mod_geoip2.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'network/mod_geoip2/mod_geoip2.SlackBuild')
-rw-r--r--network/mod_geoip2/mod_geoip2.SlackBuild59
1 files changed, 59 insertions, 0 deletions
diff --git a/network/mod_geoip2/mod_geoip2.SlackBuild b/network/mod_geoip2/mod_geoip2.SlackBuild
new file mode 100644
index 0000000000..937a9c3fb9
--- /dev/null
+++ b/network/mod_geoip2/mod_geoip2.SlackBuild
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# Slackware build script for mod_geoip2 (an Apache2 module for GeoIP)
+# Written by Zordrak (slackbuilds@tpa.me.uk)
+# Template written by Menno E. Duursma
+
+PRGNAM=mod_geoip2
+VERSION=1.2.5
+ARCH=${ARCH:-i486}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+fi
+
+set -e # exit on most errors
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM
+tar xvf $CWD/${PRGNAM}_${VERSION}.tar.gz
+cd ${PRGNAM}_${VERSION}
+chown -R root:root .
+chmod -R a-s,u+w,go+r-w .
+
+# Create target dir
+mkdir -p $PKG/usr/lib/httpd/modules
+
+# Compile module as DSO (dynmically shared object)
+CFLAGS="$SLACKFLAGS" apxs -L/usr/lib -I/usr/include -lGeoIP -c mod_geoip.c
+
+# copy into place
+cp -v .libs/mod_geoip.so $PKG/usr/lib/httpd/modules
+
+find $PKG -type f | xargs file | grep -e "executable" -e "shared object" | \
+ grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a Changes INSTALL README README.php $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE
+find $PKG/usr/doc -type f -exec chmod 0644 {} \;
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz