2007-07-18 20:01:02 +02:00
|
|
|
# $NetBSD: install,v 1.2 2007/07/18 18:01:03 jlam Exp $
|
2001-11-19 17:18:44 +01:00
|
|
|
|
|
|
|
case ${STAGE} in
|
|
|
|
PRE-INSTALL)
|
2006-03-20 00:58:14 +01:00
|
|
|
#
|
|
|
|
# Unpack the helper scriptlets.
|
|
|
|
#
|
2006-05-21 02:14:51 +02:00
|
|
|
${SH} ${SELF} ${PKGNAME} UNPACK
|
2005-01-28 08:37:55 +01:00
|
|
|
#
|
|
|
|
# Require that necessary users and groups exist or else fail the
|
|
|
|
# installation of the package.
|
|
|
|
#
|
Define new variables for package Makefile use:
REQD_FILES, REQD_FILES_PERMS, REQD_FILES_MODE
REQD_DIRS, REQD_DIRS_PERMS
These are the same as the CONF_* variables, except the files and
directories listed in REQD_* are always copied over, created or removed
(taking into account if there are user modifications from the originals,
etc.) regardless of the value of PKG_CONFIG.
The implementation involved pushing the knowledge of PKG_CONFIG,
PKG_RCD_SCRIPTS, PKG_CREATE_USERGROUP, and PKG_REGISTER_SHELLS into
the individual helper scripts. The helper scripts are now always
invoked by the +INSTALL and +DEINSTALL scripts. The +DIRS and +FILES
script have been enhanced to understand a new "f" flag that means
"force" to ignore the value of PKG_CONFIG and PKG_RCD_SCRIPTS.
Lastly, the +FILES script has been taught a new "r" flag just for rc.d
scripts and the +RCD_SCRIPTS script is now unnecessary.
2005-08-20 00:24:09 +02:00
|
|
|
${TEST} ! -x ./+USERGROUP ||
|
|
|
|
{ ./+USERGROUP ADD ${PKG_METADATA_DIR}
|
|
|
|
if ./+USERGROUP CHECK-ADD ${PKG_METADATA_DIR}; then
|
|
|
|
:
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi; }
|
2005-01-28 08:37:55 +01:00
|
|
|
#
|
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 \
|
Define new variables for package Makefile use:
REQD_FILES, REQD_FILES_PERMS, REQD_FILES_MODE
REQD_DIRS, REQD_DIRS_PERMS
These are the same as the CONF_* variables, except the files and
directories listed in REQD_* are always copied over, created or removed
(taking into account if there are user modifications from the originals,
etc.) regardless of the value of PKG_CONFIG.
The implementation involved pushing the knowledge of PKG_CONFIG,
PKG_RCD_SCRIPTS, PKG_CREATE_USERGROUP, and PKG_REGISTER_SHELLS into
the individual helper scripts. The helper scripts are now always
invoked by the +INSTALL and +DEINSTALL scripts. The +DIRS and +FILES
script have been enhanced to understand a new "f" flag that means
"force" to ignore the value of PKG_CONFIG and PKG_RCD_SCRIPTS.
Lastly, the +FILES script has been taught a new "r" flag just for rc.d
scripts and the +RCD_SCRIPTS script is now unnecessary.
2005-08-20 00:24:09 +02:00
|
|
|
"${_PKG_CONFIG}" = "yes" -a -n "${CONF_DEPENDS}" ]; then
|
2003-09-17 04:38:22 +02:00
|
|
|
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
|
Define new variables for package Makefile use:
REQD_FILES, REQD_FILES_PERMS, REQD_FILES_MODE
REQD_DIRS, REQD_DIRS_PERMS
These are the same as the CONF_* variables, except the files and
directories listed in REQD_* are always copied over, created or removed
(taking into account if there are user modifications from the originals,
etc.) regardless of the value of PKG_CONFIG.
The implementation involved pushing the knowledge of PKG_CONFIG,
PKG_RCD_SCRIPTS, PKG_CREATE_USERGROUP, and PKG_REGISTER_SHELLS into
the individual helper scripts. The helper scripts are now always
invoked by the +INSTALL and +DEINSTALL scripts. The +DIRS and +FILES
script have been enhanced to understand a new "f" flag that means
"force" to ignore the value of PKG_CONFIG and PKG_RCD_SCRIPTS.
Lastly, the +FILES script has been taught a new "r" flag just for rc.d
scripts and the +RCD_SCRIPTS script is now unnecessary.
2005-08-20 00:24:09 +02:00
|
|
|
${TEST} ! -x ./+DIRS ||
|
|
|
|
./+DIRS ADD ${PKG_METADATA_DIR}
|
2006-04-25 21:54:39 +02:00
|
|
|
${TEST} ! -x ./+DIRS ||
|
|
|
|
./+DIRS PERMS ${PKG_METADATA_DIR}
|
2001-11-19 17:18:44 +01:00
|
|
|
;;
|
|
|
|
|
|
|
|
POST-INSTALL)
|
2002-10-05 01:35:51 +02:00
|
|
|
#
|
2007-07-18 20:01:02 +02:00
|
|
|
# Rebuild the system run-time library search path database.
|
|
|
|
#
|
|
|
|
${TEST} ! -x ./+SHLIBS ||
|
|
|
|
./+SHLIBS ADD ${PKG_METADATA_DIR}
|
|
|
|
#
|
2005-02-02 11:33:01 +01:00
|
|
|
# Copy configuration/support files into place.
|
2002-10-05 01:35:51 +02:00
|
|
|
#
|
Define new variables for package Makefile use:
REQD_FILES, REQD_FILES_PERMS, REQD_FILES_MODE
REQD_DIRS, REQD_DIRS_PERMS
These are the same as the CONF_* variables, except the files and
directories listed in REQD_* are always copied over, created or removed
(taking into account if there are user modifications from the originals,
etc.) regardless of the value of PKG_CONFIG.
The implementation involved pushing the knowledge of PKG_CONFIG,
PKG_RCD_SCRIPTS, PKG_CREATE_USERGROUP, and PKG_REGISTER_SHELLS into
the individual helper scripts. The helper scripts are now always
invoked by the +INSTALL and +DEINSTALL scripts. The +DIRS and +FILES
script have been enhanced to understand a new "f" flag that means
"force" to ignore the value of PKG_CONFIG and PKG_RCD_SCRIPTS.
Lastly, the +FILES script has been taught a new "r" flag just for rc.d
scripts and the +RCD_SCRIPTS script is now unnecessary.
2005-08-20 00:24:09 +02:00
|
|
|
${TEST} ! -x ./+FILES ||
|
|
|
|
./+FILES ADD ${PKG_METADATA_DIR}
|
2006-04-25 21:54:39 +02:00
|
|
|
${TEST} ! -x ./+FILES ||
|
|
|
|
./+FILES PERMS ${PKG_METADATA_DIR}
|
2005-02-02 11:33:01 +01:00
|
|
|
#
|
|
|
|
# Set special permissions on any files/directories that need them.
|
|
|
|
#
|
2005-07-27 18:18:54 +02:00
|
|
|
${TEST} ! -x ./+PERMS ||
|
2005-02-02 11:33:01 +01:00
|
|
|
./+PERMS ${PKG_METADATA_DIR}
|
2005-12-29 04:44:38 +01:00
|
|
|
#
|
|
|
|
# Update any fonts databases.
|
|
|
|
#
|
|
|
|
${TEST} ! -x ./+FONTS ||
|
|
|
|
./+FONTS ${PKG_METADATA_DIR}
|
2001-11-19 17:18:44 +01:00
|
|
|
|
2005-02-02 11:33:01 +01:00
|
|
|
# Check for any missing bits after we're finished installing.
|
|
|
|
#
|
2005-07-27 18:18:54 +02:00
|
|
|
${TEST} ! -x ./+DIRS ||
|
2005-02-02 11:33:01 +01:00
|
|
|
./+DIRS CHECK-ADD ${PKG_METADATA_DIR}
|
2006-04-25 21:54:39 +02:00
|
|
|
${TEST} ! -x ./+DIRS ||
|
|
|
|
./+DIRS CHECK-PERMS ${PKG_METADATA_DIR}
|
2005-07-27 18:18:54 +02:00
|
|
|
${TEST} ! -x ./+FILES ||
|
2005-02-02 11:33:01 +01:00
|
|
|
./+FILES CHECK-ADD ${PKG_METADATA_DIR}
|
2006-04-25 21:54:39 +02:00
|
|
|
${TEST} ! -x ./+FILES ||
|
|
|
|
./+FILES CHECK-PERMS ${PKG_METADATA_DIR}
|
2003-09-02 08:59:37 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
VIEW-INSTALL)
|
2003-11-21 11:32:25 +01:00
|
|
|
#
|
2005-07-29 20:32:17 +02:00
|
|
|
# Register shells in /etc/shells.
|
|
|
|
#
|
Define new variables for package Makefile use:
REQD_FILES, REQD_FILES_PERMS, REQD_FILES_MODE
REQD_DIRS, REQD_DIRS_PERMS
These are the same as the CONF_* variables, except the files and
directories listed in REQD_* are always copied over, created or removed
(taking into account if there are user modifications from the originals,
etc.) regardless of the value of PKG_CONFIG.
The implementation involved pushing the knowledge of PKG_CONFIG,
PKG_RCD_SCRIPTS, PKG_CREATE_USERGROUP, and PKG_REGISTER_SHELLS into
the individual helper scripts. The helper scripts are now always
invoked by the +INSTALL and +DEINSTALL scripts. The +DIRS and +FILES
script have been enhanced to understand a new "f" flag that means
"force" to ignore the value of PKG_CONFIG and PKG_RCD_SCRIPTS.
Lastly, the +FILES script has been taught a new "r" flag just for rc.d
scripts and the +RCD_SCRIPTS script is now unnecessary.
2005-08-20 00:24:09 +02:00
|
|
|
${TEST} ! -x ./+SHELL ||
|
|
|
|
./+SHELL ADD ${PKG_METADATA_DIR}
|
2005-07-29 20:32:17 +02:00
|
|
|
${TEST} ! -x ./+SHELL ||
|
|
|
|
./+SHELL CHECK-ADD ${PKG_METADATA_DIR}
|
2006-03-09 01:20:27 +01:00
|
|
|
#
|
|
|
|
# Register info files.
|
|
|
|
#
|
|
|
|
${TEST} ! -x ./+INFO_FILES ||
|
|
|
|
./+INFO_FILES ADD ${PKG_METADATA_DIR}
|
2005-07-29 20:32:17 +02:00
|
|
|
|
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.
|
|
|
|
#
|
Define new variables for package Makefile use:
REQD_FILES, REQD_FILES_PERMS, REQD_FILES_MODE
REQD_DIRS, REQD_DIRS_PERMS
These are the same as the CONF_* variables, except the files and
directories listed in REQD_* are always copied over, created or removed
(taking into account if there are user modifications from the originals,
etc.) regardless of the value of PKG_CONFIG.
The implementation involved pushing the knowledge of PKG_CONFIG,
PKG_RCD_SCRIPTS, PKG_CREATE_USERGROUP, and PKG_REGISTER_SHELLS into
the individual helper scripts. The helper scripts are now always
invoked by the +INSTALL and +DEINSTALL scripts. The +DIRS and +FILES
script have been enhanced to understand a new "f" flag that means
"force" to ignore the value of PKG_CONFIG and PKG_RCD_SCRIPTS.
Lastly, the +FILES script has been taught a new "r" flag just for rc.d
scripts and the +RCD_SCRIPTS script is now unnecessary.
2005-08-20 00:24:09 +02:00
|
|
|
if [ "${_PKG_CONFIG}" = "yes" -a -n "${PKG_SYSCONFDEPOTBASE}" ]; then
|
2005-02-02 11:33:01 +01: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
|
2001-11-19 17:18:44 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|