aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--network/mod_geoip2/README8
-rw-r--r--network/mod_geoip2/README.SLACKWARE21
-rw-r--r--network/mod_geoip2/doinst.sh15
-rw-r--r--network/mod_geoip2/mod_geoip.conf15
-rw-r--r--network/mod_geoip2/mod_geoip2.SlackBuild17
-rw-r--r--network/mod_geoip2/mod_geoip2.info2
6 files changed, 51 insertions, 27 deletions
diff --git a/network/mod_geoip2/README b/network/mod_geoip2/README
index 3fed4a8e8d60..a0eb079ddbc2 100644
--- a/network/mod_geoip2/README
+++ b/network/mod_geoip2/README
@@ -3,4 +3,10 @@ that a web request originated from. It uses the GeoIP library and
database to perform the lookup. It is free software, licensed under
the Apache license.
-mod_geoip2 requires the GeoIP C Library API.
+This requires GeoIP.
+
+You will need to add the following line to /etc/httpd/httpd.conf:
+ Include /etc/httpd/mod_geoip.conf
+
+mod_geoip2 can be further configured through the Apache configuration file;
+see the README in the package's documentation directory for details.
diff --git a/network/mod_geoip2/README.SLACKWARE b/network/mod_geoip2/README.SLACKWARE
deleted file mode 100644
index 0ad7f462259d..000000000000
--- a/network/mod_geoip2/README.SLACKWARE
+++ /dev/null
@@ -1,21 +0,0 @@
-mod_geoip README.SLACKWARE
-
-To enable it, edit /etc/httpd/httpd.conf to include the following:
-
-LoadModule geoip_module lib/httpd/modules/mod_geoip.so
-
-<IfModule mod_geoip.c>
- GeoIPEnable Off
- GeoIPEnableUTF8 On
- GeoIPOutput Env
- GeoIPDBFile /usr/share/GeoIP/GeoIP.dat MemoryCache
-</IfModule>
-
-# GeoIP information is available only inside /xxx
-<Location /xxx>
- GeoIPEnable On
-</Location>
-
-mod_geoip2 can be further configured through the Apache configuration file,
-see /usr/doc/mod_geoip2-$VERSION/README for configuration details.
-
diff --git a/network/mod_geoip2/doinst.sh b/network/mod_geoip2/doinst.sh
new file mode 100644
index 000000000000..165a3d95075e
--- /dev/null
+++ b/network/mod_geoip2/doinst.sh
@@ -0,0 +1,15 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/mod_geoip.conf.new
+
diff --git a/network/mod_geoip2/mod_geoip.conf b/network/mod_geoip2/mod_geoip.conf
new file mode 100644
index 000000000000..770ff55d3023
--- /dev/null
+++ b/network/mod_geoip2/mod_geoip.conf
@@ -0,0 +1,15 @@
+# Apache configuration for mod_geoip2
+
+LoadModule geoip_module @baselibdir@/httpd/modules/mod_geoip.so
+
+<IfModule mod_geoip.c>
+ GeoIPEnable Off
+ GeoIPEnableUTF8 On
+ GeoIPOutput Env
+ GeoIPDBFile /usr/share/GeoIP/GeoIP.dat MemoryCache
+</IfModule>
+
+# GeoIP information is available only inside /xxx
+<Location /xxx>
+ GeoIPEnable On
+</Location>
diff --git a/network/mod_geoip2/mod_geoip2.SlackBuild b/network/mod_geoip2/mod_geoip2.SlackBuild
index 937a9c3fb992..fb2e98ecf1af 100644
--- a/network/mod_geoip2/mod_geoip2.SlackBuild
+++ b/network/mod_geoip2/mod_geoip2.SlackBuild
@@ -17,10 +17,13 @@ OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
fi
set -e # exit on most errors
@@ -35,13 +38,17 @@ chown -R root:root .
chmod -R a-s,u+w,go+r-w .
# Create target dir
-mkdir -p $PKG/usr/lib/httpd/modules
+mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/httpd/modules
# Compile module as DSO (dynmically shared object)
-CFLAGS="$SLACKFLAGS" apxs -L/usr/lib -I/usr/include -lGeoIP -c mod_geoip.c
+CFLAGS="$SLACKFLAGS" apxs -L/usr/lib${LIBDIRSUFFIX} -I/usr/include -lGeoIP -c mod_geoip.c
# copy into place
-cp -v .libs/mod_geoip.so $PKG/usr/lib/httpd/modules
+cp -v .libs/mod_geoip.so $PKG/usr/lib${LIBDIRSUFFIX}/httpd/modules
+
+mkdir -p $PKG/etc/httpd
+sed "s%@baselibdir@%lib${LIBDIRSUFFIX}%" $CWD/mod_geoip.conf > \
+ $PKG/etc/httpd/mod_geoip.conf.new
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
@@ -49,11 +56,11 @@ find $PKG -type f | xargs file | grep -e "executable" -e "shared object" | \
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
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/network/mod_geoip2/mod_geoip2.info b/network/mod_geoip2/mod_geoip2.info
index befa496af910..fa87a8f7dddc 100644
--- a/network/mod_geoip2/mod_geoip2.info
+++ b/network/mod_geoip2/mod_geoip2.info
@@ -2,7 +2,9 @@ PRGNAM="mod_geoip2"
VERSION="1.2.5"
HOMEPAGE="http://www.maxmind.com/app/mod_geoip"
DOWNLOAD="http://geolite.maxmind.com/download/geoip/api/mod_geoip2/mod_geoip2_1.2.5.tar.gz"
+DOWNLOAD_x86_64=""
MD5SUM="5d35c9a9cbf47c2cb636bed26cd5fa19"
+MD5SUM_x86_64=""
MAINTAINER="Zordrak"
EMAIL="slackbuilds@tpa.me.uk"
APPROVED="rworkman"