openbsd-ports/net/gnomeicu/pkg/INSTALL

80 lines
1.7 KiB
Plaintext
Raw Normal View History

2001-09-13 16:47:16 -04:00
#!/bin/sh
#
# $OpenBSD: INSTALL,v 1.2 2001/09/18 22:33:02 naddy Exp $
2001-09-13 16:47:16 -04:00
set -e
2001-09-13 16:47:16 -04:00
PREFIX=${PKG_PREFIX:-/usr/local}
PATH=/bin:/usr/bin:/sbin:/usr/sbin
P_NAME=gnomeicu
DEST_PFX=${SYSCONFDIR}
SOURCE_PFX=${PREFIX}/share/examples/${P_NAME}
2001-09-13 16:47:16 -04:00
do_post() {
echo
echo "+--------------- ${P_NAME}"
2001-09-13 16:47:16 -04:00
# install or take note of existing config files
for f in \
CORBA/servers/GnomeICU.gnorba \
sound/events/GnomeICU.soundlist
do
if [ -f "${DEST_PFX}/$f" ]; then
OLD_CONFS="${OLD_CONFS} $f"
else
if ! install -m 644 ${SOURCE_PFX}/$f ${DEST_PFX}/$f; then
echo "| ERROR: The following file could not be installed, exiting: ${DEST_PFX}/$f"
2001-09-13 16:47:16 -04:00
exit 1
fi
NEW_CONFS="${NEW_CONFS} $f"
fi
done
# print status report
if [ -n "${NEW_CONFS}" ]; then
echo "| The following NEW configuration files have been installed:"
echo "|"
2001-09-13 16:47:16 -04:00
for f in ${NEW_CONFS}; do
echo "| ${DEST_PFX}/$f"
2001-09-13 16:47:16 -04:00
done
fi
if [ -n "${OLD_CONFS}" ]; then
if [ -n "${NEW_CONFS}" ]; then
echo "|"
2001-09-13 16:47:16 -04:00
fi
echo "| The following OLD configuration files was found and have NOT been overwritten:"
echo "| You should however manually compare it to it's equivalent in ${SOURCE_PFX}"
echo "| and update your configuration if needed."
echo "|"
2001-09-13 16:47:16 -04:00
for f in ${OLD_CONFS}; do
echo "| ${DEST_PFX}/$f"
2001-09-13 16:47:16 -04:00
done
fi
echo "+--------------- ${P_NAME}"
2001-09-13 16:47:16 -04:00
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)
;;
POST-INSTALL)
do_post
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac
exit 0