2001-11-19 17:18:44 +01:00
|
|
|
# start of install
|
|
|
|
#
|
2004-10-12 00:04:19 +02:00
|
|
|
# $NetBSD: install,v 1.32 2004/10/11 22:04:19 reed Exp $
|
2003-09-05 13:34:25 +02:00
|
|
|
|
|
|
|
if [ -z "${CONF_FILES}" -a -z "${CONF_FILES_PERMS}" -a \
|
|
|
|
-z "${SUPPORT_FILES}" -a -z "${SUPPORT_FILES_PERMS}" -o \
|
|
|
|
"${_PKG_CONFIG}" = "NO" ]; then
|
|
|
|
:
|
|
|
|
else
|
|
|
|
MAKE_DIRS="${MAKE_DIRS} \"${PKG_SYSCONFDIR}\""
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "${RCD_SCRIPTS}" -o "${_PKG_RCD_SCRIPTS}" = "NO" ]; then
|
|
|
|
:
|
|
|
|
else
|
|
|
|
MAKE_DIRS="${MAKE_DIRS} \"${RCD_SCRIPTS_DIR}\""
|
|
|
|
fi
|
2001-11-19 17:18:44 +01:00
|
|
|
|
|
|
|
case ${STAGE} in
|
|
|
|
PRE-INSTALL)
|
2002-10-05 01:35:51 +02:00
|
|
|
msginit
|
2002-06-20 22:15:46 +02:00
|
|
|
_pkg_exit=0
|
|
|
|
if [ -n "${PKG_GROUPS}" ]; then
|
2002-10-05 01:35:51 +02:00
|
|
|
_print_group_header=1
|
2001-11-26 21:37:38 +01:00
|
|
|
eval set -- ${PKG_GROUPS}
|
2002-06-20 22:15:46 +02:00
|
|
|
for groupset; do
|
|
|
|
save_IFS="${IFS}"; IFS=":"
|
|
|
|
set -- ${groupset}
|
|
|
|
group="$1"; groupid="$2"
|
|
|
|
IFS="${save_IFS}"
|
|
|
|
|
|
|
|
# We need to check that ${PKG_GROUP} exists before
|
|
|
|
# adding the user. Do it with chgrp to be able to
|
|
|
|
# use NIS.
|
|
|
|
#
|
|
|
|
${TOUCH} /tmp/grouptest.$$
|
|
|
|
if ${CHGRP} ${group} /tmp/grouptest.$$ >/dev/null 2>&1; then
|
2001-11-26 21:37:38 +01:00
|
|
|
${ECHO} "Group '${group}' already exists."
|
2002-06-20 22:15:46 +02:00
|
|
|
elif [ "${_PKG_CREATE_USERGROUP}" = "NO" ]; then
|
2002-10-05 01:35:51 +02:00
|
|
|
if [ ${_print_group_header} -gt 0 ]; then
|
|
|
|
_print_group_header=0
|
|
|
|
msgadd ""
|
|
|
|
msgadd "The following groups need to be created for ${PKGNAME}:"
|
|
|
|
msgadd ""
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
|
|
|
if [ -z "${groupid}" ]; then
|
|
|
|
groupid_str=
|
|
|
|
else
|
|
|
|
groupid_str=" (${groupid})"
|
|
|
|
fi
|
2002-10-05 01:35:51 +02:00
|
|
|
msgadd "#${group}${groupid_str}"
|
2002-06-20 22:15:46 +02:00
|
|
|
_pkg_exit=1
|
|
|
|
else
|
2001-11-26 21:37:38 +01:00
|
|
|
groupid_option=
|
2002-06-20 22:15:46 +02:00
|
|
|
if [ -n "${groupid}" ]; then
|
2001-12-04 22:05:06 +01:00
|
|
|
groupid_option="-g"
|
2001-11-26 21:37:38 +01:00
|
|
|
fi
|
|
|
|
${ECHO} "Creating group: ${group}"
|
2001-12-04 22:05:06 +01:00
|
|
|
${GROUPADD} ${groupid_option} ${groupid} "${group}"
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
|
|
|
${RM} -f /tmp/grouptest.$$
|
2001-11-26 21:37:38 +01:00
|
|
|
done
|
2001-11-19 17:18:44 +01:00
|
|
|
fi
|
2002-06-20 22:15:46 +02:00
|
|
|
if [ -n "${PKG_USERS}" ]; then
|
2002-10-05 01:35:51 +02:00
|
|
|
_print_user_header=1
|
2001-11-26 21:37:38 +01:00
|
|
|
eval set -- ${PKG_USERS}
|
2002-06-20 22:15:46 +02:00
|
|
|
for userset; do
|
|
|
|
save_IFS="${IFS}"; IFS=":"
|
|
|
|
set -- ${userset}
|
|
|
|
user="$1"; group="$2"; userid="$3"
|
|
|
|
descr="${4:-${PKGBASE} ${user} user}"
|
|
|
|
home="${5:-@PKG_USER_HOME@}"
|
|
|
|
shell="${6:-@PKG_USER_SHELL@}"
|
|
|
|
IFS="${save_IFS}"
|
|
|
|
|
|
|
|
# Use `id' to be able to use NIS.
|
|
|
|
if ${ID} "${user}" >/dev/null 2>&1; then
|
2001-11-26 21:37:38 +01:00
|
|
|
${ECHO} "User '${user}' already exists."
|
2002-06-20 22:15:46 +02:00
|
|
|
elif [ "${_PKG_CREATE_USERGROUP}" = "NO" ]; then
|
2002-10-05 01:35:51 +02:00
|
|
|
if [ ${_print_user_header} -gt 0 ]; then
|
|
|
|
_print_user_header=0
|
|
|
|
msgadd ""
|
|
|
|
msgadd "The following users need to be created for ${PKGNAME}:"
|
|
|
|
msgadd ""
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
|
|
|
if [ -z "${userid}" ]; then
|
|
|
|
userid_str=
|
|
|
|
else
|
|
|
|
userid_str=" (${userid})"
|
|
|
|
fi
|
2002-10-05 01:35:51 +02:00
|
|
|
msgadd "#${user}${userid_str}: ${group}, ${home}, ${shell}"
|
2002-06-20 22:15:46 +02:00
|
|
|
_pkg_exit=1
|
|
|
|
else
|
2001-11-26 21:37:38 +01:00
|
|
|
userid_option=
|
2002-06-20 22:15:46 +02:00
|
|
|
if [ -n "${userid}" ]; then
|
2001-12-04 22:05:06 +01:00
|
|
|
userid_option="-u"
|
2001-11-26 21:37:38 +01:00
|
|
|
fi
|
|
|
|
${ECHO} "Creating user: ${user}"
|
|
|
|
${USERADD} -c "${descr}" \
|
2001-12-04 22:05:06 +01:00
|
|
|
${userid_option} ${userid} \
|
2001-11-26 21:37:38 +01:00
|
|
|
-g "${group}" \
|
|
|
|
-d "${home}" \
|
|
|
|
-s "${shell}" \
|
|
|
|
"${user}"
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
2001-11-26 21:37:38 +01:00
|
|
|
done
|
2001-11-19 17:18:44 +01:00
|
|
|
fi
|
2003-01-29 20:47:29 +01:00
|
|
|
|
|
|
|
# Create package directories at pre-install time.
|
|
|
|
#
|
2003-09-17 04:38:22 +02:00
|
|
|
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; \
|
|
|
|
}' \
|
|
|
|
`
|
2004-07-10 22:42:37 +02:00
|
|
|
if [ -d $sysconfdir -a ! -d ${PKG_SYSCONFDIR} ]; then
|
2003-09-17 04:38:22 +02:00
|
|
|
${MKDIR} -p `${DIRNAME} ${PKG_SYSCONFDIR}`
|
|
|
|
${LN} -sf $sysconfdir ${PKG_SYSCONFDIR}
|
|
|
|
fi
|
|
|
|
fi
|
2003-01-29 20:47:29 +01:00
|
|
|
if [ -n "${MAKE_DIRS}" -o -n "${OWN_DIRS}" -o \
|
|
|
|
-n "${MAKE_DIRS_PERMS}" -o -n "${OWN_DIRS_PERMS}" ]; then
|
2003-09-05 13:34:25 +02:00
|
|
|
eval set -- ${MAKE_DIRS} ${OWN_DIRS}
|
2003-01-29 20:47:29 +01:00
|
|
|
for dir; do
|
|
|
|
if [ -d "${dir}" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [ "${_PKG_CONFIG}" = "YES" ]; then
|
|
|
|
${MKDIR} "${dir}"
|
2003-09-02 08:59:37 +02:00
|
|
|
if [ "${PKG_INSTALLATION_TYPE}" = "pkgviews" ]; then
|
|
|
|
case "${dir}" in
|
|
|
|
${PKG_PREFIX}|${PKG_PREFIX}/*) ;;
|
|
|
|
*) ${ECHO} "${PKGBASE}" > "${dir}/.pkgsrc" ;;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
${ECHO} "${PKGBASE}" > "${dir}/.pkgsrc"
|
|
|
|
fi
|
2003-01-29 20:47:29 +01:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
eval set -- ${MAKE_DIRS_PERMS} ${OWN_DIRS_PERMS}
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
dir="$1"; owner="$2"; group="$3"; mode="$4"
|
|
|
|
shift; shift; shift; shift
|
|
|
|
if [ "${_PKG_CONFIG}" = "YES" ]; then
|
|
|
|
if [ ! -d "${dir}" ]; then
|
|
|
|
${MKDIR} "${dir}"
|
2003-09-02 08:59:37 +02:00
|
|
|
if [ "${PKG_INSTALLATION_TYPE}" = "pkgviews" ]; then
|
|
|
|
case "${dir}" in
|
|
|
|
${PKG_PREFIX}|${PKG_PREFIX}/*) ;;
|
|
|
|
*) ${ECHO} "${PKGBASE}" > "${dir}/.pkgsrc" ;;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
${ECHO} "${PKGBASE}" > "${dir}/.pkgsrc"
|
|
|
|
fi
|
2003-06-25 10:26:51 +02:00
|
|
|
${CHOWN} -R "${owner}" "${dir}"
|
|
|
|
${CHGRP} -R "${group}" "${dir}"
|
|
|
|
${CHMOD} -R "${mode}" "${dir}"
|
2003-01-29 20:47:29 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2002-10-05 01:35:51 +02:00
|
|
|
if ! msgempty; then
|
|
|
|
${ECHO} "==========================================================================="
|
|
|
|
msgprint
|
|
|
|
${ECHO} ""
|
|
|
|
${ECHO} "==========================================================================="
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
|
|
|
if [ ${_pkg_exit} -gt 0 ]; then
|
|
|
|
exit ${_pkg_exit}
|
|
|
|
fi
|
2001-11-19 17:18:44 +01:00
|
|
|
;;
|
|
|
|
|
|
|
|
POST-INSTALL)
|
2002-10-05 01:35:51 +02:00
|
|
|
#
|
2003-01-29 20:47:29 +01:00
|
|
|
# Note any missing package directories.
|
2002-10-05 01:35:51 +02:00
|
|
|
#
|
2003-01-29 20:47:29 +01:00
|
|
|
msginit
|
2002-06-20 22:15:46 +02:00
|
|
|
if [ -n "${MAKE_DIRS}" -o -n "${OWN_DIRS}" -o \
|
|
|
|
-n "${MAKE_DIRS_PERMS}" -o -n "${OWN_DIRS_PERMS}" ]; then
|
2002-10-05 01:35:51 +02:00
|
|
|
_print_dir_header=1
|
2003-09-05 13:34:25 +02:00
|
|
|
eval set -- ${MAKE_DIRS} ${OWN_DIRS}
|
2002-06-20 22:15:46 +02:00
|
|
|
for dir; do
|
2002-06-27 22:46:31 +02:00
|
|
|
if [ -d "${dir}" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
2002-06-20 22:15:46 +02:00
|
|
|
if [ "${_PKG_CONFIG}" = "NO" ]; then
|
2002-10-05 01:35:51 +02:00
|
|
|
if [ ${_print_dir_header} -gt 0 ]; then
|
|
|
|
_print_dir_header=0
|
|
|
|
msgadd ""
|
|
|
|
msgadd "The following directories should be created for ${PKGNAME}:"
|
|
|
|
msgadd ""
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
2002-10-05 01:35:51 +02:00
|
|
|
msgadd "#${dir}"
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
eval set -- ${MAKE_DIRS_PERMS} ${OWN_DIRS_PERMS}
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
dir="$1"; owner="$2"; group="$3"; mode="$4"
|
|
|
|
shift; shift; shift; shift
|
|
|
|
if [ "${_PKG_CONFIG}" = "NO" ]; then
|
2002-10-05 01:35:51 +02:00
|
|
|
if [ ${_print_dir_header} -gt 0 ]; then
|
|
|
|
_print_dir_header=0
|
|
|
|
msgadd ""
|
|
|
|
msgadd "The following directories should be created for ${PKGNAME}:"
|
|
|
|
msgadd ""
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
2002-10-05 01:35:51 +02:00
|
|
|
msgadd "#${dir} (o=${owner}, g=${group}, m=${mode})"
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${_PKG_CONFIG}" = "YES" ]; then
|
|
|
|
if [ -n "${CONF_FILES}" -o \
|
|
|
|
-n "${CONF_FILES_PERMS}" -o \
|
|
|
|
-n "${SUPPORT_FILES}" -o \
|
2002-09-19 12:20:50 +02:00
|
|
|
-n "${SUPPORT_FILES_PERMS}" ] || \
|
|
|
|
[ "${_PKG_RCD_SCRIPTS}" = "YES" -a \
|
2002-06-20 22:15:46 +02:00
|
|
|
-n "${RCD_SCRIPTS}" ]; then
|
|
|
|
${CAT} << EOF
|
2003-12-21 02:21:52 +01:00
|
|
|
|
|
|
|
===> Installing configuration/support files for ${PKGNAME}
|
2002-06-20 22:15:46 +02:00
|
|
|
|
|
|
|
EOF
|
|
|
|
fi
|
2001-11-19 17:18:44 +01:00
|
|
|
fi
|
2002-10-05 01:35:51 +02:00
|
|
|
_print_file_header=1
|
2001-11-26 15:48:53 +01:00
|
|
|
eval set -- ${CONF_FILES}
|
2002-06-20 22:15:46 +02:00
|
|
|
while [ $# -gt 0 ]; do
|
2001-11-19 17:18:44 +01:00
|
|
|
samplefile="$1"; file="$2"
|
|
|
|
shift; shift
|
|
|
|
|
2002-06-20 22:15:46 +02:00
|
|
|
if [ "${_PKG_CONFIG}" = "NO" ]; then
|
2002-10-05 01:35:51 +02:00
|
|
|
if [ ${_print_file_header} -gt 0 ]; then
|
|
|
|
_print_file_header=0
|
|
|
|
msgadd ""
|
|
|
|
msgadd "The following files should be created for ${PKGNAME}:"
|
|
|
|
msgadd ""
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
2002-10-05 01:35:51 +02:00
|
|
|
msgadd "#${file} (m=@CONF_FILES_MODE@)"
|
2004-07-10 22:42:37 +02:00
|
|
|
elif [ -f "${file}" ]; then
|
2003-09-17 04:38:22 +02:00
|
|
|
if [ ! "${file}" -ef "${samplefile}" ]; then
|
2003-12-21 02:21:52 +01:00
|
|
|
${ECHO} " ${file} already exists, example file is"
|
|
|
|
${ECHO} " ${samplefile}"
|
2003-09-17 04:38:22 +02:00
|
|
|
fi
|
2001-11-19 17:18:44 +01:00
|
|
|
else
|
2004-07-10 22:42:37 +02:00
|
|
|
if [ -f "${samplefile}" ]; then
|
2003-12-21 02:21:52 +01:00
|
|
|
${ECHO} " ${file}"
|
2001-11-26 21:37:38 +01:00
|
|
|
${CP} "${samplefile}" "${file}"
|
|
|
|
${CHMOD} @CONF_FILES_MODE@ "${file}"
|
|
|
|
fi
|
2001-11-19 17:18:44 +01:00
|
|
|
fi
|
|
|
|
done
|
2001-11-26 15:48:53 +01:00
|
|
|
eval set -- ${SUPPORT_FILES}
|
2002-06-20 22:15:46 +02:00
|
|
|
while [ $# -gt 0 ]; do
|
2001-11-20 00:33:52 +01:00
|
|
|
samplefile="$1"; file="$2"
|
|
|
|
shift; shift
|
2001-11-19 17:18:44 +01:00
|
|
|
|
2002-06-20 22:15:46 +02:00
|
|
|
if [ "${_PKG_CONFIG}" = "NO" ]; then
|
2002-10-05 01:35:51 +02:00
|
|
|
if [ ${_print_file_header} -gt 0 ]; then
|
|
|
|
_print_file_header=0
|
|
|
|
msgadd ""
|
|
|
|
msgadd "The following files should be created for ${PKGNAME}:"
|
|
|
|
msgadd ""
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
2002-10-05 01:35:51 +02:00
|
|
|
msgadd "#${file} (m=@SUPPORT_FILES_MODE@)"
|
2004-07-10 22:42:37 +02:00
|
|
|
elif [ -f "${file}" ]; then
|
2003-09-17 04:38:22 +02:00
|
|
|
if [ ! "${file}" -ef "${samplefile}" ]; then
|
2003-12-21 02:21:52 +01:00
|
|
|
${ECHO} " ${file} already exists, example file is"
|
|
|
|
${ECHO} " ${samplefile}"
|
2003-09-17 04:38:22 +02:00
|
|
|
fi
|
2001-11-19 17:18:44 +01:00
|
|
|
else
|
2004-07-10 22:42:37 +02:00
|
|
|
if [ -f "${samplefile}" ]; then
|
2004-01-08 15:19:29 +01:00
|
|
|
${ECHO} " ${file}"
|
2001-11-26 21:37:38 +01:00
|
|
|
${CP} "${samplefile}" "${file}"
|
|
|
|
${CHMOD} @SUPPORT_FILES_MODE@ "${file}"
|
|
|
|
fi
|
2001-11-19 17:18:44 +01:00
|
|
|
fi
|
|
|
|
done
|
2001-11-26 15:48:53 +01:00
|
|
|
eval set -- ${CONF_FILES_PERMS} ${SUPPORT_FILES_PERMS}
|
2002-06-20 22:15:46 +02:00
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
samplefile="$1"; file="$2"
|
|
|
|
owner="$3"; group="$4"; mode="$5"
|
2001-11-20 00:33:52 +01:00
|
|
|
shift; shift; shift; shift; shift
|
2001-11-19 17:18:44 +01:00
|
|
|
|
2002-06-20 22:15:46 +02:00
|
|
|
if [ "${_PKG_CONFIG}" = "NO" ]; then
|
2002-10-05 01:35:51 +02:00
|
|
|
if [ ${_print_file_header} -gt 0 ]; then
|
|
|
|
_print_file_header=0
|
|
|
|
msgadd ""
|
|
|
|
msgadd "The following files should be created for ${PKGNAME}:"
|
|
|
|
msgadd ""
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
2002-10-05 01:35:51 +02:00
|
|
|
msgadd "#${file} (o=${owner}, g=${group}, m=${mode})"
|
2004-07-10 22:42:37 +02:00
|
|
|
elif [ -f ${file} ]; then
|
2003-09-17 04:38:22 +02:00
|
|
|
if [ ! "${file}" -ef "${samplefile}" ]; then
|
2003-12-21 02:21:52 +01:00
|
|
|
${ECHO} " ${file} already exists, example file is"
|
|
|
|
${ECHO} " ${samplefile}"
|
2003-09-17 04:38:22 +02:00
|
|
|
fi
|
2001-11-19 17:18:44 +01:00
|
|
|
else
|
2004-07-10 22:42:37 +02:00
|
|
|
if [ -f "${samplefile}" ]; then
|
2003-12-21 02:21:52 +01:00
|
|
|
${ECHO} " ${file}"
|
2001-11-26 21:37:38 +01:00
|
|
|
${CP} "${samplefile}" "${file}"
|
|
|
|
${CHOWN} "${owner}" "${file}"
|
|
|
|
${CHGRP} "${group}" "${file}"
|
|
|
|
${CHMOD} ${mode} "${file}"
|
|
|
|
fi
|
2001-11-19 17:18:44 +01:00
|
|
|
fi
|
|
|
|
done
|
2001-11-26 15:48:53 +01:00
|
|
|
eval set -- ${RCD_SCRIPTS}
|
2002-06-20 22:15:46 +02:00
|
|
|
for script; do
|
2004-10-12 00:04:19 +02:00
|
|
|
samplefile="${PKG_PREFIX}/${RCD_SCRIPTS_EXAMPLEDIR}/${script}"
|
2001-11-26 15:48:53 +01:00
|
|
|
file="${RCD_SCRIPTS_DIR}/${script}"
|
2001-11-19 17:18:44 +01:00
|
|
|
|
2002-09-19 12:20:50 +02:00
|
|
|
if [ "${_PKG_CONFIG}" = "NO" -o \
|
|
|
|
"${_PKG_RCD_SCRIPTS}" = "NO" ]; then
|
2002-10-05 01:35:51 +02:00
|
|
|
if [ ${_print_file_header} -gt 0 ]; then
|
|
|
|
_print_file_header=0
|
|
|
|
msgadd ""
|
|
|
|
msgadd "The following files should be created for ${PKGNAME}:"
|
|
|
|
msgadd ""
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
2002-10-05 01:35:51 +02:00
|
|
|
msgadd "#${file} (m=@RCD_SCRIPTS_MODE@)"
|
2004-07-10 22:42:37 +02:00
|
|
|
elif [ -f "${file}" ]; then
|
2003-09-17 04:38:22 +02:00
|
|
|
if [ ! "${file}" -ef "${samplefile}" ]; then
|
2003-12-21 02:21:52 +01:00
|
|
|
${ECHO} " ${file} already exists, example file is"
|
|
|
|
${ECHO} " ${samplefile}"
|
2003-09-17 04:38:22 +02:00
|
|
|
fi
|
2001-11-19 17:18:44 +01:00
|
|
|
else
|
2004-07-10 22:42:37 +02:00
|
|
|
if [ -f "${samplefile}" ]; then
|
2003-12-21 02:21:52 +01:00
|
|
|
${ECHO} " ${file}"
|
2001-11-26 21:37:38 +01:00
|
|
|
${CP} "${samplefile}" "${file}"
|
|
|
|
${CHMOD} @RCD_SCRIPTS_MODE@ "${file}"
|
|
|
|
fi
|
2001-11-19 17:18:44 +01:00
|
|
|
fi
|
|
|
|
done
|
2002-10-05 01:46:26 +02:00
|
|
|
_print_special_header=1
|
|
|
|
eval set -- ${SPECIAL_PERMS}
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
file="$1"; owner="$2"; group="$3"; mode="$4"
|
|
|
|
shift; shift; shift; shift
|
|
|
|
|
|
|
|
if [ ${_print_special_header} -gt 0 ]; then
|
|
|
|
_print_special_header=0
|
|
|
|
msgadd ""
|
|
|
|
msgadd "The following files and directories have special permissions:"
|
|
|
|
msgadd ""
|
|
|
|
fi
|
|
|
|
msgadd "#${file} (o=${owner}, g=${group}, m=${mode})"
|
|
|
|
${CHOWN} "${owner}" "${file}"
|
|
|
|
${CHGRP} "${group}" "${file}"
|
|
|
|
${CHMOD} ${mode} "${file}"
|
|
|
|
done
|
2002-10-05 01:35:51 +02:00
|
|
|
if ! msgempty; then
|
|
|
|
${ECHO} "==========================================================================="
|
|
|
|
msgprint
|
|
|
|
${ECHO} ""
|
|
|
|
${ECHO} "==========================================================================="
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
|
|
|
if [ "${_PKG_CONFIG}" = "YES" ]; then
|
|
|
|
if [ -n "${CONF_FILES}" -o -n "${CONF_FILES_PERMS}" ]; then
|
|
|
|
${CAT} << EOF
|
2001-11-19 17:18:44 +01:00
|
|
|
|
|
|
|
===========================================================================
|
2002-06-20 22:15:46 +02:00
|
|
|
You may wish to customize the following files for ${PKGNAME}:
|
2001-11-19 17:18:44 +01:00
|
|
|
|
|
|
|
EOF
|
2002-06-20 22:15:46 +02:00
|
|
|
eval set -- ${CONF_FILES}
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
samplefile="$1"; file="$2"
|
|
|
|
shift; shift
|
2001-11-19 17:18:44 +01:00
|
|
|
|
2002-06-20 22:15:46 +02:00
|
|
|
${ECHO} " ${file}"
|
|
|
|
done
|
|
|
|
eval set -- ${CONF_FILES_PERMS}
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
samplefile="$1"; file="$2"
|
|
|
|
owner="$3"; group="$4"; mode="$5"
|
|
|
|
shift; shift; shift; shift; shift
|
2001-11-19 17:18:44 +01:00
|
|
|
|
2002-06-20 22:15:46 +02:00
|
|
|
${ECHO} " ${file}"
|
|
|
|
done
|
|
|
|
${CAT} << EOF
|
2001-11-19 17:18:44 +01:00
|
|
|
===========================================================================
|
|
|
|
EOF
|
2002-06-20 22:15:46 +02:00
|
|
|
fi
|
2001-11-19 17:18:44 +01:00
|
|
|
fi
|
2003-09-02 08:59:37 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
VIEW-INSTALL)
|
2002-11-17 09:58:49 +01:00
|
|
|
if [ -n "${PKG_SHELL}" -a "${PKG_REGISTER_SHELLS}" = "YES" ]; then
|
|
|
|
${ECHO} "===> Updating /etc/shells"
|
|
|
|
${TOUCH} /etc/shells
|
|
|
|
${CP} /etc/shells /etc/shells.pkgsrc."$$"
|
2003-09-19 01:02:33 +02:00
|
|
|
(${GREP} -v "^${PKG_SHELL}" /etc/shells.pkgsrc."$$" || ${TRUE}; ${ECHO} ${PKG_SHELL}) > /etc/shells
|
2002-11-17 09:58:49 +01:00
|
|
|
${RM} /etc/shells.pkgsrc."$$"
|
|
|
|
fi
|
2003-11-21 11:32:25 +01:00
|
|
|
#
|
|
|
|
# If ${PKG_SYSCONFBASE} points outside of ${PREFIX}, then add the
|
|
|
|
# package config files to the proper view.
|
|
|
|
#
|
2003-09-12 07:15:03 +02:00
|
|
|
if [ "${_PKG_CONFIG}" = "YES" -a -n "${PKG_SYSCONFDEPOTBASE}" ]; then
|
2003-09-02 08:59:37 +02:00
|
|
|
if [ -n "${CONF_FILES}" -o \
|
|
|
|
-n "${CONF_FILES_PERMS}" -o \
|
|
|
|
-n "${SUPPORT_FILES}" -o \
|
2003-11-21 11:32:25 +01:00
|
|
|
-n "${SUPPORT_FILES_PERMS}" ]; then
|
2003-09-13 12:06:36 +02:00
|
|
|
${SETENV} PLIST_IGNORE_FILES="${CONF_IGNORE_FILES}" \
|
|
|
|
${LINKFARM} -t ${PKG_SYSCONFVIEWBASE} -d ${PKG_SYSCONFDEPOTBASE} ${PKGNAME}
|
2003-09-02 08:59:37 +02:00
|
|
|
fi
|
|
|
|
fi
|
2001-11-19 17:18:44 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# end of install
|