mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-24 10:02:29 +01:00
network/mod_geoip2: Updated for version 1.2.5
This commit is contained in:
parent
c34de5f8e2
commit
8900f695e5
6 changed files with 51 additions and 27 deletions
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
15
network/mod_geoip2/doinst.sh
Normal file
15
network/mod_geoip2/doinst.sh
Normal file
|
@ -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
|
||||
|
15
network/mod_geoip2/mod_geoip.conf
Normal file
15
network/mod_geoip2/mod_geoip.conf
Normal file
|
@ -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>
|
|
@ -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}
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue