pkgsrc/mk/install/header

109 lines
2 KiB
Text
Raw Normal View History

#!@SH@
#
# start of header
#
# $NetBSD: header,v 1.32 2005/02/02 10:33:01 jlam Exp $
PKGNAME=$1
STAGE=$2
AWK="@AWK@"
BASENAME="@BASENAME@"
CAT="@CAT@"
CHGRP="@CHGRP@"
CHMOD="@CHMOD@"
CHOWN="@CHOWN@"
CMP="@CMP@"
CP="@CP@"
DIRNAME="@DIRNAME@"
ECHO="@ECHO@"
ECHO_N="@ECHO_N@"
EGREP="@EGREP@"
EXPR="@EXPR@"
FALSE="@FALSE@"
2002-10-08 13:32:34 +02:00
FIND="@FIND@"
GREP="@GREP@"
GTAR="@GTAR@"
HEAD="@HEAD@"
ID="@ID@"
LINKFARM="@LINKFARM@"
LN="@LN@"
LS="@LS@"
MKDIR="@MKDIR@"
MV="@MV@"
PERL5="@PERL5@"
PKG_ADMIN="@PKG_ADMIN@"
PKG_INFO="@PKG_INFO@"
Use reference counts to properly account for the creation and removal of directories needed for the proper functioning of each package. The +INSTALL script unpacks a +DIRS script that adds and removes directories. The +DIRS script entirely encapsulates the directory creation and removal, and completely replaces the code in the mk/install/install and mk/install/deinstall templates that handled {MAKE,OWN}_DIRS and {MAKE,OWN}_DIRS_PERMS. The +DIRS script is meant to be executed from within the package meta-data directory, e.g. /var/db/pkg/<pkgname>. It's usage is: ./+DIRS ADD|REMOVE|CHECK-ADD|CHECK-REMOVE The ADD and REMOVE actions cause the necessary directories to be added or removed from the system. The CHECK-ADD and CHECK-REMOVE actions print out informative messages prompting the user to either create or remove some necessary directories. The behaviour of "ADD" is such that if the directory already exists on the system and is not already ref-counted, then that directory is marked as "pre-existing". On "REMOVE", pre-existing directories are left untouched on the filesystem. At any time, the root user can sanity-check the directories needed by packages by invoking all of the +DIRS scripts with the "CHECK-ADD" action. If there are missing directories, then invoking all of the +DIRS scripts with the "ADD" action will ensure that any missing directories are created. The reference counts database is stored in ${PKG_DBDIR}/.refcount. The reference counts related to directories managed by the +DIRS script are stored in ${PKG_DBDIR}/.refcount/dirs. If the directory reference counts database is removed, then invoking all of the +DIRS scripts with the "ADD" action will reconstruct the database; however, directories may be marked as being pre-existing, so they won't be removed at package de-installation (although a message will be displayed informing the user that those directories can be removed).
2005-01-28 07:30:58 +01:00
PWD_CMD="@PWD_CMD@"
RM="@RM@"
RMDIR="@RMDIR@"
SED="@SED@"
SETENV="@SETENV@"
SH="@SH@"
SORT="@SORT@"
SU="@SU@"
TEST="@TEST@"
TOUCH="@TOUCH@"
TR="@TR@"
TRUE="@TRUE@"
2002-10-08 13:32:34 +02:00
XARGS="@XARGS@"
Use reference counts to properly account for the creation and removal of directories needed for the proper functioning of each package. The +INSTALL script unpacks a +DIRS script that adds and removes directories. The +DIRS script entirely encapsulates the directory creation and removal, and completely replaces the code in the mk/install/install and mk/install/deinstall templates that handled {MAKE,OWN}_DIRS and {MAKE,OWN}_DIRS_PERMS. The +DIRS script is meant to be executed from within the package meta-data directory, e.g. /var/db/pkg/<pkgname>. It's usage is: ./+DIRS ADD|REMOVE|CHECK-ADD|CHECK-REMOVE The ADD and REMOVE actions cause the necessary directories to be added or removed from the system. The CHECK-ADD and CHECK-REMOVE actions print out informative messages prompting the user to either create or remove some necessary directories. The behaviour of "ADD" is such that if the directory already exists on the system and is not already ref-counted, then that directory is marked as "pre-existing". On "REMOVE", pre-existing directories are left untouched on the filesystem. At any time, the root user can sanity-check the directories needed by packages by invoking all of the +DIRS scripts with the "CHECK-ADD" action. If there are missing directories, then invoking all of the +DIRS scripts with the "ADD" action will ensure that any missing directories are created. The reference counts database is stored in ${PKG_DBDIR}/.refcount. The reference counts related to directories managed by the +DIRS script are stored in ${PKG_DBDIR}/.refcount/dirs. If the directory reference counts database is removed, then invoking all of the +DIRS scripts with the "ADD" action will reconstruct the database; however, directories may be marked as being pre-existing, so they won't be removed at package de-installation (although a message will be displayed informing the user that those directories can be removed).
2005-01-28 07:30:58 +01:00
: ${PKG_METADATA_DIR=`${PWD_CMD}`}
PKGBASE="@PKGBASE@"
LOCALBASE="@LOCALBASE@"
X11BASE="@X11BASE@"
DEPOTBASE="@DEPOTBASE@"
PREFIX="@PREFIX@"
case ${PKG_PREFIX} in
${LOCALBASE}/*) VIEW="${PKG_PREFIX#${LOCALBASE}/}" ;;
*) VIEW="" ;;
esac
PKG_SYSCONFBASE="@PKG_SYSCONFBASE@"
PKG_SYSCONFDEPOTBASE="@PKG_SYSCONFDEPOTBASE@"
PKG_SYSCONFBASEDIR="@PKG_SYSCONFBASEDIR@"
PKG_SYSCONFDIR="@PKG_SYSCONFDIR@"
CONF_DEPENDS="@CONF_DEPENDS@"
case ${VIEW} in
"") PKG_SYSCONFVIEWBASE="${PKG_SYSCONFBASE}" ;;
*) PKG_SYSCONFVIEWBASE="${PKG_SYSCONFBASE}/${VIEW}" ;;
esac
PKG_REGISTER_SHELLS="@PKG_REGISTER_SHELLS@"
PKG_SHELL="@PKG_SHELL@"
CONF_IGNORE_FILES="*[~#] *.OLD *.orig *,v .pkgsrc */.pkgsrc"
PKG_INSTALLATION_TYPE="@PKG_INSTALLATION_TYPE@"
case "${PKG_CREATE_USERGROUP:-@PKG_CREATE_USERGROUP@}" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
_PKG_CREATE_USERGROUP=YES
;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
_PKG_CREATE_USERGROUP=NO
;;
esac
case "${PKG_CONFIG:-@PKG_CONFIG@}" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
_PKG_CONFIG=YES
;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
_PKG_CONFIG=NO
;;
esac
case "${PKG_RCD_SCRIPTS:-@PKG_RCD_SCRIPTS@}" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
_PKG_RCD_SCRIPTS=YES
;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
_PKG_RCD_SCRIPTS=NO
;;
esac
# end of header