openbsd-ports/print/enscript/pkg/INSTALL
marc 401e992892 Fix side effects of --sysconfdir bsd.port.mk change
o remove ignored CONFIGURE_ARGS+=--sysconfdir=/lib
o add post-install step that calls the INSTALL script
o add install script to copy the sample config file to /etc only
  if there is no existing config in /etc
o add deinstall script to remind the user to remove /etc/enscript.conf
o add patch to install config as /lib/enscript.cfg-sample
  even though the config dir is /etc
o test installation and de-installation from source
o test installation from package
1999-04-03 09:12:57 +00:00

51 lines
1.1 KiB
Plaintext

#!/bin/sh
# $OpenBSD: INSTALL,v 1.1 1999/04/03 09:12:58 marc 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
CONFIG_SAMPLE=${PREFIX}/lib/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 "** 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 ""
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