> 1) It should be in an extra package with an extra source tarball.
> 2) If you are using e.g. geoiplookup you have to specifiy the using
> database everytime again by the -f argument.
> 
> For 2) it would be a solution if I am shipping it under the same
> filename and add diversions, but I am personally not a fan of this, or
> the user has to live with the -f argument.
> 
> Any suggestions?

In my opinion, it would be better to provide an update script (alike
geoipupdate, but for free databases) and commented out crontab:
$ cat /etc/cron.d/geoip
#...@weekly root /usr/bin/geoipupdate
#...@monthly root /usr/bin/geoipfreeupdate

And move *.dat to /var, because it doesn't look like a static data.

$ cat /usr/local/sbin/geoipfreeupdate
#!/bin/sh
exec 2> /dev/null
DATADIR="/usr/share/GeoIP"
GUNZIP="/bin/gunzip"
MAXMINDURL="http://geolite.maxmind.com/download/geoip/database/";
WGET="/usr/bin/wget -q -O -"
TMPDIR="/tmp"
if [ ! -d "$DATADIR" ]
then
  echo "Data directory $DATADIR/ doesn't exist!"
  exit 1
fi
if [ ! -w "$DATADIR/GeoIP.dat" -o ! -w "$DATADIR/GeoIPCity.dat" ]
then
  echo "Can't rewrite $DATADIR/*.dat files!"
  exit 1
fi
cd /tmp
$WGET $MAXMINDURL/GeoLiteCountry/GeoIP.dat.gz | $GUNZIP > GeoIP.dat
if [ $? != 0 ]
then
  echo "Can't download a free GeoLite Country database!"
  exit 1
fi
$WGET $MAXMINDURL/GeoLiteCity.dat.gz | $GUNZIP > GeoIPCity.dat
if [ $? != 0 ]
then
  echo "Can't download a free GeoLite City database!"
  exit 1
fi
mv -f GeoIP.dat GeoIPCity.dat $DATADIR/
if [ $? != 0 ]
then
  echo "Can't move databases file to $DATADIR/"
  exit 1
fi
exit 0




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to