# -*- sh -*- # start of install # # $NetBSD: install,v 1.37 2005/03/21 19:29:46 wiz Exp $ case ${STAGE} in PRE-INSTALL) # # Require that necessary users and groups exist or else fail the # installation of the package. # case ${_PKG_CREATE_USERGROUP} in YES) ${TEST} -x ./+USERGROUP && ./+USERGROUP ADD ${PKG_METADATA_DIR} ;; esac if ${TEST} -x ./+USERGROUP && ./+USERGROUP CHECK-ADD ${PKG_METADATA_DIR}; then : else exit 1 fi # # Create package directories at pre-install time. # if [ "${PKG_INSTALLATION_TYPE}" = "pkgviews" -a \ "${_PKG_CONFIG}" = "YES" -a -n "${CONF_DEPENDS}" ]; then pkg=`${PKG_ADMIN} -b -d ${DEPOTBASE} -s "" lsbest "${CONF_DEPENDS}"` sysconfdir=`${PKG_INFO} -B -K ${DEPOTBASE} $pkg | \ ${AWK} '/^PKG_SYSCONFDIR=/ { \ gsub("^PKG_SYSCONFDIR=[ ]*", ""); \ print; \ }' \ ` if [ -d $sysconfdir -a ! -d ${PKG_SYSCONFDIR} ]; then ${MKDIR} -p `${DIRNAME} ${PKG_SYSCONFDIR}` ${LN} -sf $sysconfdir ${PKG_SYSCONFDIR} fi fi case ${_PKG_CONFIG} in YES) ${TEST} -x ./+DIRS && ./+DIRS ADD ${PKG_METADATA_DIR} ;; esac ;; POST-INSTALL) # # Copy configuration/support files into place. # case ${_PKG_CONFIG} in YES) ${TEST} -x ./+FILES && ./+FILES ADD ${PKG_METADATA_DIR} ;; esac case ${_PKG_CONFIG}${_PKG_RCD_SCRIPTS} in YESYES) ${TEST} -x ./+RCD_SCRIPTS && ./+RCD_SCRIPTS ADD ${PKG_METADATA_DIR} ;; esac # # Set special permissions on any files/directories that need them. # ${TEST} -x ./+PERMS && ./+PERMS ${PKG_METADATA_DIR} # Check for any missing bits after we're finished installing. # ${TEST} -x ./+DIRS && ./+DIRS CHECK-ADD ${PKG_METADATA_DIR} ${TEST} -x ./+FILES && ./+FILES CHECK-ADD ${PKG_METADATA_DIR} ${TEST} -x ./+RCD_SCRIPTS && ./+RCD_SCRIPTS CHECK-ADD ${PKG_METADATA_DIR} ;; VIEW-INSTALL) if [ -n "${PKG_SHELL}" -a "${PKG_REGISTER_SHELLS}" = "YES" ]; then ${ECHO} "===> Updating /etc/shells" ${TOUCH} /etc/shells ${CP} /etc/shells /etc/shells.pkgsrc."$$" (${GREP} -v "^${PKG_SHELL}" /etc/shells.pkgsrc."$$" || ${TRUE}; ${ECHO} ${PKG_SHELL}) > /etc/shells ${RM} /etc/shells.pkgsrc."$$" fi # # If ${PKG_SYSCONFBASE} points outside of ${PREFIX}, then add the # package config files to the proper view. # if [ "${_PKG_CONFIG}" = "YES" -a -n "${PKG_SYSCONFDEPOTBASE}" ]; then ${SETENV} PLIST_IGNORE_FILES="${CONF_IGNORE_FILES}" \ ${LINKFARM} -t ${PKG_SYSCONFVIEWBASE} -d ${PKG_SYSCONFDEPOTBASE} ${PKGNAME} fi ;; esac # end of install