Submitted by Xavier Santolaria <xavier@santolaria.net>. GeoIP is a C library that enables the user to find the country that any IP address or hostname originates from.
67 lines
1.6 KiB
Plaintext
67 lines
1.6 KiB
Plaintext
#!/bin/sh
|
|
# $OpenBSD: INSTALL,v 1.1.1.1 2003/06/27 14:55:35 naddy Exp $
|
|
|
|
set -e
|
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
|
PREFIX=${PKG_PREFIX:-/usr/local}
|
|
CONFIG_FILE=${SYSCONFDIR}/GeoIP.conf
|
|
SAMPLE_CONFIG_FILE=$PREFIX/share/examples/GeoIP/GeoIP.conf
|
|
DB_FILE=/var/db/GeoIP/GeoIP.dat
|
|
SAMPLE_DB_FILE=$PREFIX/share/examples/GeoIP/GeoIP.dat
|
|
|
|
do_notice()
|
|
{
|
|
echo
|
|
echo "+---------------"
|
|
echo "| The existing $1 configuration file, $CONFIG_FILE,"
|
|
echo "| and database file, ${DB_FILE}, have NOT been"
|
|
echo "| changed. You may want to compare them to the"
|
|
echo "| current sample files, $SAMPLE_CONFIG_FILE,"
|
|
echo "| and ${SAMPLE_DB_FILE} and update your configuration"
|
|
echo "| as needed."
|
|
echo "+---------------"
|
|
echo
|
|
}
|
|
|
|
do_install()
|
|
{
|
|
install -o root -g wheel -m 644 $SAMPLE_CONFIG_FILE $CONFIG_FILE
|
|
install -o root -g wheel -m 755 -d `dirname $DB_FILE`
|
|
install -o root -g wheel -m 444 $SAMPLE_DB_FILE $DB_FILE
|
|
echo
|
|
echo "+---------------"
|
|
echo "| The $1 configuration file, $CONFIG_FILE,"
|
|
echo "| and database file, ${DB_FILE}, have been"
|
|
echo "| installed. Please view these files and change"
|
|
echo "| the configuration to meet your needs."
|
|
echo "+---------------"
|
|
}
|
|
|
|
# verify proper execution
|
|
#
|
|
if [ $# -ne 2 ]; then
|
|
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Verify/process the command
|
|
#
|
|
case $2 in
|
|
PRE-INSTALL)
|
|
: nothing to pre-install for this port
|
|
;;
|
|
POST-INSTALL)
|
|
if [ -f $CONFIG_FILE ]; then
|
|
do_notice $1
|
|
else
|
|
do_install $1
|
|
fi
|
|
;;
|
|
*)
|
|
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|