freebsd-ports/net/silc-client/pkg-install
Rong-En Fan e59a250c71 - Update to 1.0.3
PR:		ports/108075
Submitted by:	Evgueni V. Gavrilov <aquatique-ports at rambler.ru> (maintainer)
2007-01-18 16:26:34 +00:00

61 lines
1.2 KiB
Bash

#!/bin/sh
# $FreeBSD$
# based on original from op port, written by Cyrille Lefevre
# <clefevre@citeweb.net>
[ $# != 2 ] && exit 1
PKGNAME=$1
ACTION=$2
CONF_DIR=${PKG_PREFIX}/etc/silc
DOC_DIR=${PKG_PREFIX}/share/doc/silc
#/example_silc.conf
CONF_FILE=silc.conf
CONF_OWN=root
CONF_GRP=wheel
CONF_MODE=444
SAMP_SUFX=.sample
INSTALL=install
CMP=cmp
RM=rm
RMDIR=rmdir
INSTALL_DIR="${INSTALL} -d -o root -g wheel -m 755"
case "$ACTION" in
POST-INSTALL)
if [ -f "${CONF_DIR}/${CONF_FILE}" ]
then
echo "$PKGNAME: Will not overwrite existing ${CONF_DIR}/${CONF_FILE} configuration file."
else
${INSTALL} -c -o ${CONF_OWN} -g ${CONF_GRP} -m ${CONF_MODE} \
${DOC_DIR}/example_silc.conf \
${CONF_DIR}/${CONF_FILE}
fi
;;
DEINSTALL)
if ${CMP} -s ${DOC_DIR}/example_silc.conf \
${CONF_DIR}/${CONF_FILE}; then
${RM} -f ${CONF_DIR}/${CONF_FILE}
else
echo "$PKGNAME: Will not remove existing ${CONF_DIR}/${CONF_FILE} configuration file."
echo "$PKGNAME: However, if you are permanently removing this port, you should do a 'rm -f ${CONF_DIR}/${CONF_FILE}' to remove the configuration file left."
echo "$PKGNAME: Also, do not forget to 'rmdir ${CONF_DIR} 2>/dev/null'"
fi
;;
PRE-INSTALL|POST-DEINSTALL)
;;
*)
exit 1
;;
esac
exit