Subject: Re: netatalk and pkg/9948
To: None <mcmahill@mtl.mit.edu>
From: Johnny C. Lam <lamj@stat.cmu.edu>
List: tech-pkg
Date: 07/12/2000 17:10:41
mcmahill@mtl.mit.edu writes:
> and if they do exist, print a message like "configuration files already
> exist, please verify they work with this version of pkg-##" or something
> like that.
> 
> We really do need a good and documented way of installing sample config
> files, not md5'ing config files that the user must change and not deleting
> config files that a user may have spent some time configuring.

I was going to commit something like the following to pkg/INSTALL.
Would this suffice?

#!/bin/sh
#
# $NetBSD$

PKGNAME=$1
STAGE=$2

case ${STAGE} in
PRE-INSTALL)
	;;
POST-INSTALL)
	ETCDIR=/etc/netatalk

	mkdir -p ${ETCDIR}

	echo "Installing configuration files:"
	for file in \
		AppleVolumes.default \
		AppleVolumes.system \
		atalkd.conf \
		papd.conf
	do
		if [ ! -f ${ETCDIR}/${file} ]
		then
			echo "	${file}"
			cp ${PKG_PREFIX}/share/examples/netatalk/${file} \
				${ETCDIR}/${file}
			chmod 644 ${ETCDIR}/${file}
		fi
	done
	echo "done."

	if [ -f ${PKG_PREFIX}/etc/atalkd.conf ]
	then
		cat << EOF
===========================================================================
You may want to merge the configuration files in ${PKG_PREFIX}/etc from a
previous installation of netatalk with the files in the new netatalk config
file directory ${ETCDIR}.
===========================================================================
EOF
	fi
	;;
*)
	echo "Unexpected argument: $2"
	exit 1
	;;
esac
exit 0