openbsd-ports/net/bind8/pkg/INSTALL

85 lines
1.7 KiB
Plaintext

#!/bin/sh
#
# $OpenBSD: INSTALL,v 1.3 1999/12/17 17:56:30 ho Exp $
#
# Pre/post-installation setup of named
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/}
NROOT=${DESTDIR}/var/named
SAMPLEDIR=${3:-/usr/local/share/examples/bind8}
print_usage()
{
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL}" >&2
}
pre_fix_dir()
{
if [ ! -d ${1} ]; then
rm -f ${1}
mkdir -p ${1}
fi
if [ "x${2}" != "x" ]; then
chown ${2} ${1}
chmod ${3} ${1}
else # default
chown root:wheel ${1}
chmod 0755 ${1}
fi
}
if [ $# -ne 2 -a $# -ne 3 ]; then
print_usage
exit 1
fi
# Verify/process the command
#
case $2 in
PRE-INSTALL)
# Note "descending" order
pre_fix_dir ${DESTDIR}/usr/share/doc/html/named
pre_fix_dir ${DESTDIR}/usr/libexec/named
pre_fix_dir ${NROOT}
pre_fix_dir ${NROOT}/slave named:bin 0755
pre_fix_dir ${NROOT}/master named:bin 0755
pre_fix_dir ${NROOT}/var
pre_fix_dir ${NROOT}/var/run named:bin 0755
pre_fix_dir ${NROOT}/var/tmp root:wheel 01777
pre_fix_dir ${SAMPLEDIR}
;;
POST-INSTALL)
echo "" >&2
echo "Check your /etc/rc.conf file for the 'named' options." >&2
echo "Recommended (and also OpenBSD default) values are:" >&2
echo " named_flags=\"\"" >&2
echo " named_user=named" >&2
echo " named_chroot=${NROOT}" >&2
echo "" >&2
if [ ! -d ${SAMPLEDIR} ]; then
# Oops.
exit 0
fi
echo "Sample configuration files have been installed to directory" >&2
echo " ${SAMPLEDIR}" >&2
echo "" >&2
echo "Proper modes for the sample files are [{owner,group,mode}]" >&2
echo " {root,named,640} for named.conf" >&2
echo " {root,wheel,644} for the rest" >&2
echo "" >&2
echo "Check/modify named.conf to suit your site." >&2
echo "" >&2
;;
*)
print_usage
exit 1
;;
esac
exit 0