diff options
author | Jason Graham <jgraha8@gmail.com> | 2018-05-08 15:02:16 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-05-12 06:58:25 +0700 |
commit | 8414cf022f22b5b61af6af519aa72dc816cf7b03 (patch) | |
tree | 52dbc96a27774cc4429f696c21ef0b27645c7ce7 /network | |
parent | d58415aa6d6e168970150505c96909c28e34c2ac (diff) |
network/ipv6calc: Updated for version 1.0.0.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'network')
-rw-r--r-- | network/ipv6calc/README | 19 | ||||
-rw-r--r-- | network/ipv6calc/doinst.sh | 13 | ||||
-rw-r--r-- | network/ipv6calc/ipv6calc.SlackBuild | 54 | ||||
-rw-r--r-- | network/ipv6calc/ipv6calc.info | 6 | ||||
-rw-r--r-- | network/ipv6calc/slack-desc | 2 |
5 files changed, 74 insertions, 20 deletions
diff --git a/network/ipv6calc/README b/network/ipv6calc/README index 96325ff8eb87..66599f47b4d8 100644 --- a/network/ipv6calc/README +++ b/network/ipv6calc/README @@ -5,9 +5,20 @@ into the same format shown in /proc/net/if_inet6. This utility was also used in the past to extend features on network-functions-ipv6 library, used by initscripts-ipv6. -To enable IP2Location support you will need to install the optional -dependency ip2location-c first, and then pass: +In addition to its internal databases, ipv6calc supports several +external databases. The following build options may be used to include +support for these: - IP2LOCATION=yes + IP2LOCATION=yes Enable IP2Location support (requires ip2location-c) + GEOIP=yes Enable GeoIP support (requires GeoIP) + EXTERNAL=yes Enable external db support -to this Slackbuild. +where each build option is passed to the slackbuild. Example of +enabling the IP2Location and GeoIP external database: + + IP2LOCATION=yes GEOIP=yes ./ipv6calc.SlackBuild + +The ipv6calc Apache module can be built by passing MOD_IPV6CALC=yes to +the slackbuild as: + + MOD_IPV6CALC=yes ./ipv6calc.SlackBuild diff --git a/network/ipv6calc/doinst.sh b/network/ipv6calc/doinst.sh new file mode 100644 index 000000000000..d695f1cef55a --- /dev/null +++ b/network/ipv6calc/doinst.sh @@ -0,0 +1,13 @@ +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... +} + diff --git a/network/ipv6calc/ipv6calc.SlackBuild b/network/ipv6calc/ipv6calc.SlackBuild index 206b453be2c5..a9ea0bf1d59a 100644 --- a/network/ipv6calc/ipv6calc.SlackBuild +++ b/network/ipv6calc/ipv6calc.SlackBuild @@ -4,6 +4,7 @@ # Copyright 2012, 2013 Chris Abela, Malta # Copyright 2014 Ryan P.C. McQuen, WA, ryanpcmcquen@member.fsf.org +# Copyright 2018 Jason Graham, MD <jgraha8@gmail.com> # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -24,7 +25,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=ipv6calc -VERSION=${VERSION:-0.98.0} +VERSION=${VERSION:-1.0.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -70,20 +71,38 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -if [ "$IP2LOCATION" = yes ]; then - ENABLE_IP2LOCATION="${ENABLE_IP2LOCATION:-"--enable-ip2location"}" -else - # The default is to disable ip2location - unset ENABLE_IP2LOCATION +unset ENABLE_IP2LOCATION +unset ENABLE_GEOIP +unset ENABLE_EXTERNAL +unset ENABLE_MOD_IPV6CALC + +if [ "$IP2LOCATION" = "yes" ]; then + ENABLE_IP2LOCATION="--enable-ip2location --with-ip2location-db=/usr/share/IP2Loc" +fi + +if [ "$GEOIP" = "yes" ]; then + ENABLE_GEOIP="--enable-geoip --with-geoip-db=/usr/share/GeoIP" +fi + +if [ "$EXTERNAL" = "yes" ]; then + ENABLE_EXTERNAL="--enable-external" +fi + +if [ "$MOD_IPV6CALC" = "yes" ]; then + ENABLE_MOD_IPV6CALC="--enable-mod_ipv6calc" fi CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ - --bindir=/usr/bin \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ --mandir=/usr/man \ - $ENABLE_IP2LOCATION + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --build=$ARCH-slackware-linux \ + $ENABLE_IP2LOCATION $ENABLE_GEOIP $ENABLE_EXTERNAL $ENABLE_MOD_IPV6CALC make make install DESTDIR=$PKG @@ -94,16 +113,27 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr find $PKG/usr/man -type f -exec gzip -9 {} \; for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done -# If you need more docs/scripts, have a look at the source, -# I take a minimalist approach here. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ - COPYING CREDITS ChangeLog INSTALLING LICENSE README* TODO USAGE doc \ - $PKG/usr/doc/$PRGNAM-$VERSION + CHANGES COPYING CREDITS ChangeLog LICENSE README TODO USAGE VERSION \ + doc/ipv6calc.html \ + $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 + +if [ "$MOD_IPV6CALC" = "yes" ]; then + # Move the ipv6calc.conf to the proper location + mkdir -p $PKG/etc/httpd + mv $PKG/etc/{httpd.d,httpd/extra} + mv $PKG/etc/httpd/extra/ipv6calc.conf $PKG/etc/httpd/extra/httpd-ipv6calc.conf.new + echo "config etc/httpd/extra/httpd-ipv6calc.conf.new" >> $PKG/install/doinst.sh + + # Update IP2Loc db directory + sed -i 's/\/usr\/share\/IP2Location/\/usr\/share\/IP2Loc/g' $PKG/etc/httpd/extra/httpd-ipv6calc.conf.new +fi cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/ipv6calc/ipv6calc.info b/network/ipv6calc/ipv6calc.info index 8217e94b439f..576e679891a7 100644 --- a/network/ipv6calc/ipv6calc.info +++ b/network/ipv6calc/ipv6calc.info @@ -1,8 +1,8 @@ PRGNAM="ipv6calc" -VERSION="0.98.0" +VERSION="1.0.0" HOMEPAGE="http://www.deepspace6.net/projects/ipv6calc.html" -DOWNLOAD="ftp://ftp.deepspace6.net/pub/ds6/sources/ipv6calc/ipv6calc-0.98.0.tar.gz" -MD5SUM="a245ec36d1536413ac49eac52579eea5" +DOWNLOAD="ftp://ftp.deepspace6.net/pub/ds6/sources/ipv6calc/ipv6calc-1.0.0.tar.gz" +MD5SUM="6eed2e5b8ca07330e044d809ade3b565" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" diff --git a/network/ipv6calc/slack-desc b/network/ipv6calc/slack-desc index 150b52d76072..799bc631b880 100644 --- a/network/ipv6calc/slack-desc +++ b/network/ipv6calc/slack-desc @@ -11,9 +11,9 @@ ipv6calc: ipv6calc: ipv6calc is a small utility written in C to manipulate (not only) IPv6 ipv6calc: addresses. It converts a given IPv6 address into compressed format, or ipv6calc: into the same format shown in /proc/net/if_inet6. +ipv6calc: ipv6calc: This utility was also used in the past to extend features on ipv6calc: network-functions-ipv6 library, used by initscripts-ipv6. ipv6calc: ipv6calc: Homepage: http://www.deepspace6.net/projects/ipv6calc.html ipv6calc: -ipv6calc: |