From 9b526a439ee673bb2870f0124230605e172f274e Mon Sep 17 00:00:00 2001 From: David Spencer Date: Tue, 31 May 2016 23:16:44 +0100 Subject: network/GeoIP: Updated for version 1.6.9. Signed-off-by: David Spencer --- network/GeoIP/GeoIP.SlackBuild | 46 +++++++++++++++++++++++++++--------------- network/GeoIP/GeoIP.info | 24 ++++++++++++++++------ network/GeoIP/README | 24 ++++++++++++++++++++-- network/GeoIP/doinst.sh | 15 -------------- network/GeoIP/slack-desc | 6 +++--- 5 files changed, 73 insertions(+), 42 deletions(-) delete mode 100644 network/GeoIP/doinst.sh (limited to 'network') diff --git a/network/GeoIP/GeoIP.SlackBuild b/network/GeoIP/GeoIP.SlackBuild index f7b74c7435ea..36e83661f1eb 100644 --- a/network/GeoIP/GeoIP.SlackBuild +++ b/network/GeoIP/GeoIP.SlackBuild @@ -24,10 +24,14 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# revision date 2011/08/31 +# This product includes GeoLite data created by MaxMind, +# available from http://www.maxmind.com +# (Creative Commons Attribution-ShareAlike 4.0 International License) + +# Maintained by David Spencer PRGNAM=GeoIP -VERSION=${VERSION:-1.5.1} +VERSION=${VERSION:-1.6.9} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -68,10 +72,10 @@ tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION chown -R root:root . find -L . \ - \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \ - -exec chmod 755 {} \; -o \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; # We need to update the configuration files in this tarball... autoreconf -i @@ -91,28 +95,38 @@ CXXFLAGS="$SLKCFLAGS" \ make make install DESTDIR=$PKG -# Let's not clobber config files -mv $PKG/etc/GeoIP.conf $PKG/etc/GeoIP.conf.new - -# Other distros (and some other software) look in /var/lib/GeoIP/ -mkdir -p $PKG/var/lib -mv $PKG/usr/share/GeoIP $PKG/var/lib -ln -s ../../var/lib/GeoIP $PKG/usr/share/GeoIP - find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true find $PKG/usr/man -type f -exec gzip -9 {} \; +mkdir -p $PKG/var/lib/GeoIP +if [ "${MINIDATA:-no}" = "yes" ]; then + DATAFILES="GeoIP GeoIPv6" +else + DATAFILES="GeoIP GeoIPv6 GeoLiteCity GeoLiteCityv6 GeoIPASNum GeoIPASNumv6" +fi +for datafile in $DATAFILES ; do + if [ -e $CWD/$datafile.dat.gz ]; then + zcat $CWD/$datafile.dat.gz > $PKG/var/lib/GeoIP/$datafile.dat + fi +done +# As an absolute minimum we'll package the ipv4 country data file from the source tree: +if [ ! -e $PKG/var/lib/GeoIP/GeoIP.dat ]; then + cat data/GeoIP.dat > $PKG/var/lib/GeoIP/GeoIP.dat +fi +# It's traditional to make the data available in /usr/share/GeoIP too: +mkdir -p $PKG/usr/share +ln -s ../../var/lib/GeoIP $PKG/usr/share/GeoIP + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ - AUTHORS COPYING ChangeLog INSTALL README TODO \ - $PKG/usr/doc/$PRGNAM-$VERSION + AUTHORS COPYING ChangeLog INSTALL LICENSE NEWS.md README.md \ + $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild 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.${PKGTYPE:-tgz} diff --git a/network/GeoIP/GeoIP.info b/network/GeoIP/GeoIP.info index 047d2f4a78d2..326212274f1c 100644 --- a/network/GeoIP/GeoIP.info +++ b/network/GeoIP/GeoIP.info @@ -1,10 +1,22 @@ PRGNAM="GeoIP" -VERSION="1.5.1" -HOMEPAGE="http://www.maxmind.com/app/c" -DOWNLOAD="http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.5.1.tar.gz" -MD5SUM="36b82f3558e6e2ebdd11a56c5db21dbc" +VERSION="1.6.9" +HOMEPAGE="https://github.com/maxmind/geoip-api-c" +DOWNLOAD="https://github.com/maxmind/geoip-api-c/releases/download/v1.6.9/GeoIP-1.6.9.tar.gz \ + https://sourceforge.net/projects/slackbuildsdirectlinks/files/GeoIP/GeoIP.dat.gz \ + https://sourceforge.net/projects/slackbuildsdirectlinks/files/GeoIP/GeoIPv6.dat.gz \ + https://sourceforge.net/projects/slackbuildsdirectlinks/files/GeoIP/GeoLiteCity.dat.gz \ + https://sourceforge.net/projects/slackbuildsdirectlinks/files/GeoIP/GeoLiteCityv6.dat.gz \ + https://sourceforge.net/projects/slackbuildsdirectlinks/files/GeoIP/GeoIPASNum.dat.gz \ + https://sourceforge.net/projects/slackbuildsdirectlinks/files/GeoIP/GeoIPASNumv6.dat.gz" +MD5SUM="7475942dc8155046dddb4846f587a7e6 \ + b2be0bf3152fff8e64f3012bd4a3d924 \ + 99c46748c54cc18d98379f9f969f62c9 \ + 6d11391a7753bc999a1d9e420a81b14b \ + a0793331f873aac66b1d518052300006 \ + 9320054fcfe235011195f7a4af08ccf4 \ + f21142e024d1e1b7d35f38c60937e220" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" -MAINTAINER="Niels Horn" -EMAIL="niels.horn@gmail.com" +MAINTAINER="David Spencer" +EMAIL="baildon.research@googlemail.com" diff --git a/network/GeoIP/README b/network/GeoIP/README index da5b75385e0a..812d54da6b94 100644 --- a/network/GeoIP/README +++ b/network/GeoIP/README @@ -3,5 +3,25 @@ geolocation data and services. GeoIP provides businesses with a non-invasive way to determine geographical and other information about their Internet visitors in real-time. -To name a few applications, GeoIP can be used for delivering -customized content, targeted ads, and web log statistics. +This SlackBuild packages a recent full set of GeoLite data files +(Creative Commons licensed), totalling 56Mb uncompressed. + +To keep the data files up-to-date, see the geoipupdate SlackBuild. + +If you don't want the full set of data files, you have three choices: + +(1) You can download only the data files you want before running the +SlackBuild. + +(2) You can remove the data files you don't want from the directory +/var/lib/GeoIP after installation. + +(3) You can run the SlackBuild with the option 'MINIDATA=yes'. Only the +ipv4 (and optionally ipv6) country data will be packaged. + + MINIDATA=yes ./GeoIP.SlackBuild + + + This product includes GeoLite data created by MaxMind, + available from http://www.maxmind.com + Creative Commons Attribution-ShareAlike 4.0 International License diff --git a/network/GeoIP/doinst.sh b/network/GeoIP/doinst.sh deleted file mode 100644 index 80437eb1bf14..000000000000 --- a/network/GeoIP/doinst.sh +++ /dev/null @@ -1,15 +0,0 @@ -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/GeoIP.conf.new - diff --git a/network/GeoIP/slack-desc b/network/GeoIP/slack-desc index 37957f0c2b07..21b69dd9088a 100644 --- a/network/GeoIP/slack-desc +++ b/network/GeoIP/slack-desc @@ -12,8 +12,8 @@ GeoIP: GeoIP is the proprietary technology that drives MaxMind's IP GeoIP: geolocation data and services. GeoIP provides businesses with a GeoIP: non-invasive way to determine geographical and other information GeoIP: about their Internet visitors in real-time. -GeoIP: To name a few applications, GeoIP can be used for delivering -GeoIP: customized content, targeted ads and web log statistics. GeoIP: -GeoIP: Homepage: http://www.maxmind.com/download/geoip/api/c/ +GeoIP: "This product includes GeoLite data created by MaxMind, available +GeoIP: from http://www.maxmind.com" (CC BY-SA 4.0) +GeoIP: GeoIP: -- cgit v1.2.3