1999-04-03 04:12:57 -05:00
|
|
|
#!/bin/sh
|
2000-07-30 16:03:31 -04:00
|
|
|
# $OpenBSD: INSTALL,v 1.4 2000/07/30 20:03:31 matt Exp $
|
1999-04-03 04:12:57 -05:00
|
|
|
#
|
|
|
|
# Pre/post-installation setup of enscript
|
|
|
|
|
|
|
|
set -e
|
|
|
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
|
|
|
PREFIX=${PREFIX:-/usr/local}
|
|
|
|
CONFIG_FILE=/etc/enscript.cfg
|
2000-07-30 16:03:31 -04:00
|
|
|
CONFIG_SAMPLE=${PREFIX}/share/examples/enscript/enscript.cfg-sample
|
1999-04-03 04:12:57 -05:00
|
|
|
|
|
|
|
if [ $# -ne 2 ]; then
|
|
|
|
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# install the configuration files unless an existing configuration
|
|
|
|
# is found in which case warn the user that it may need to be
|
|
|
|
# updated.
|
|
|
|
#
|
|
|
|
do_configuration()
|
|
|
|
{
|
|
|
|
if [ ! -r ${CONFIG_SAMPLE} ]; then
|
|
|
|
echo "-- Can't find configuration sample file: ${CONFIG_SAMPLE}" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -r ${CONFIG_FILE} ]; then
|
1999-04-10 03:14:56 -04:00
|
|
|
echo
|
|
|
|
echo "+---------------"
|
|
|
|
echo "| The file ${CONFIG_FILE} exists. Your existing configuration"
|
|
|
|
echo "| has not been changed. You MAY need to update your"
|
|
|
|
echo "| configuration. See the current configuration sample file"
|
|
|
|
echo "| ${CONFIG_SAMPLE}."
|
|
|
|
echo "+---------------"
|
|
|
|
echo
|
1999-04-03 04:12:57 -05:00
|
|
|
else
|
|
|
|
cp ${CONFIG_SAMPLE} ${CONFIG_FILE}
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
case $2 in
|
|
|
|
PRE-INSTALL)
|
|
|
|
: nothing to pre-install for this port
|
|
|
|
;;
|
|
|
|
POST-INSTALL)
|
|
|
|
do_configuration
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|