openbsd-ports/print/enscript/pkg/INSTALL

53 lines
1.2 KiB
Plaintext
Raw Normal View History

#!/bin/sh
2000-07-30 16:03:31 -04:00
# $OpenBSD: INSTALL,v 1.4 2000/07/30 20:03:31 matt Exp $
#
# 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
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
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
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