1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-05 01:55:52 +00:00
freebsd-ports/net/samba36/files/pkg-install.in
Timur I. Bakeyev 4bef4dd3c2 Add new version of Samba - 3.6.0.
Most significant improvement is the support of SMB2 protocol.
2011-10-16 22:35:25 +00:00

45 lines
1.4 KiB
Bash

#! /bin/sh
#
PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
EXAMPLESDIR="%%EXAMPLESDIR%%"
SAMBA_CONFIG="%%SAMBA_CONFIG%%"
SAMBA_CONFDIR="%%SAMBA_CONFDIR%%"
SAMBA_SPOOL="%%SAMBA_SPOOL%%"
SAMBA_LOGDIR="%%SAMBA_LOGDIR%%"
SAMBA_RUNDIR="%%SAMBA_RUNDIR%%"
SAMBA_LOCKDIR="%%SAMBA_LOCKDIR%%"
SAMBA_PRIVATEDIR="%%SAMBA_PRIVATEDIR%%"
SAMBA_OWNER=root
SAMBA_GROUP=wheel
INSTALL_DATA="install -c -m 0444"
MKDIR="mkdir -p"
CHMOD="chmod"
CHOWN="chown"
post-install() {
${MKDIR} ${SAMBA_SPOOL} && ${CHMOD} 1777 ${SAMBA_SPOOL}
${MKDIR} ${SAMBA_LOGDIR} && ${CHMOD} 0755 ${SAMBA_LOGDIR}
${MKDIR} ${SAMBA_RUNDIR} && ${CHMOD} 0755 ${SAMBA_RUNDIR}
${MKDIR} ${SAMBA_LOCKDIR} && ${CHMOD} 0755 ${SAMBA_LOCKDIR}
${MKDIR} ${SAMBA_PRIVATEDIR} && ${CHMOD} 0700 ${SAMBA_PRIVATEDIR}
if [ $(id -u) -eq 0 ]; then
INSTALL_DATA="${INSTALL_DATA} -o ${SAMBA_OWNER} -g ${SAMBA_GROUP}"
${CHOWN} ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_SPOOL}
${CHOWN} ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_LOGDIR}
${CHOWN} ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_RUNDIR}
${CHOWN} ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_LOCKDIR}
${CHOWN} ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_PRIVATEDIR}
fi
${INSTALL_DATA} ${EXAMPLESDIR}/${SAMBA_CONFIG}.sample ${SAMBA_CONFDIR}
if [ ! -f ${SAMBA_CONFDIR}/${SAMBA_CONFIG} ]; then
${INSTALL_DATA} ${EXAMPLESDIR}/${SAMBA_CONFIG}.sample ${SAMBA_CONFDIR}/${SAMBA_CONFIG}
fi
}
case $2 in
POST-INSTALL)
post-install
;;
esac