53 lines
1.2 KiB
Plaintext
53 lines
1.2 KiB
Plaintext
#!/bin/sh
|
|
# $OpenBSD: INSTALL,v 1.5 2003/04/26 14:55:32 sturm Exp $
|
|
#
|
|
# Pre/post-installation setup of enscript
|
|
|
|
set -e
|
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
|
PREFIX=${PKG_PREFIX:-/usr/local}
|
|
CONFIG_FILE=${SYSCONFDIR}/enscript.cfg
|
|
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
|
|
|