2001-11-19 17:18:44 +01:00
|
|
|
#!@SH@
|
|
|
|
#
|
2006-07-20 00:26:26 +02:00
|
|
|
# $NetBSD: header,v 1.2 2006/07/19 22:26:26 jlam Exp $
|
2001-11-19 17:18:44 +01:00
|
|
|
|
2006-03-20 00:58:14 +01:00
|
|
|
SELF="$0"
|
|
|
|
PKGNAME="$1"
|
|
|
|
STAGE="$2"
|
|
|
|
shift 2
|
2001-11-19 17:18:44 +01:00
|
|
|
|
|
|
|
AWK="@AWK@"
|
|
|
|
BASENAME="@BASENAME@"
|
|
|
|
CAT="@CAT@"
|
|
|
|
CHGRP="@CHGRP@"
|
|
|
|
CHMOD="@CHMOD@"
|
|
|
|
CHOWN="@CHOWN@"
|
|
|
|
CMP="@CMP@"
|
|
|
|
CP="@CP@"
|
|
|
|
DIRNAME="@DIRNAME@"
|
|
|
|
ECHO="@ECHO@"
|
2004-04-27 20:31:08 +02:00
|
|
|
ECHO_N="@ECHO_N@"
|
2001-11-19 17:18:44 +01:00
|
|
|
EGREP="@EGREP@"
|
2002-10-05 01:35:51 +02:00
|
|
|
EXPR="@EXPR@"
|
2001-11-19 17:18:44 +01:00
|
|
|
FALSE="@FALSE@"
|
2002-10-08 13:32:34 +02:00
|
|
|
FIND="@FIND@"
|
2002-01-10 13:05:26 +01:00
|
|
|
GREP="@GREP@"
|
|
|
|
GTAR="@GTAR@"
|
|
|
|
HEAD="@HEAD@"
|
2001-11-19 17:18:44 +01:00
|
|
|
ID="@ID@"
|
2003-09-02 08:59:37 +02:00
|
|
|
LINKFARM="@LINKFARM@"
|
2001-11-19 17:18:44 +01:00
|
|
|
LN="@LN@"
|
2003-12-20 10:45:55 +01:00
|
|
|
LS="@LS@"
|
2001-11-19 17:18:44 +01:00
|
|
|
MKDIR="@MKDIR@"
|
|
|
|
MV="@MV@"
|
2002-01-10 13:05:26 +01:00
|
|
|
PERL5="@PERL5@"
|
2003-09-17 04:38:22 +02:00
|
|
|
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@"
|
2001-11-19 17:18:44 +01:00
|
|
|
RM="@RM@"
|
|
|
|
RMDIR="@RMDIR@"
|
|
|
|
SED="@SED@"
|
2003-09-02 08:59:37 +02:00
|
|
|
SETENV="@SETENV@"
|
2002-01-10 13:05:26 +01:00
|
|
|
SH="@SH@"
|
2001-11-19 17:18:44 +01:00
|
|
|
SORT="@SORT@"
|
2002-01-10 13:05:26 +01:00
|
|
|
SU="@SU@"
|
2003-08-30 20:42:36 +02:00
|
|
|
TEST="@TEST@"
|
2001-11-19 17:18:44 +01:00
|
|
|
TOUCH="@TOUCH@"
|
|
|
|
TR="@TR@"
|
|
|
|
TRUE="@TRUE@"
|
2002-10-08 13:32:34 +02:00
|
|
|
XARGS="@XARGS@"
|
2001-11-19 17:18:44 +01:00
|
|
|
|
2006-07-20 00:26:26 +02:00
|
|
|
CURDIR=`${PWD_CMD}`
|
|
|
|
: ${PKG_METADATA_DIR=${CURDIR}}
|
2001-11-26 21:37:38 +01:00
|
|
|
PKGBASE="@PKGBASE@"
|
2003-09-12 07:15:03 +02:00
|
|
|
|
|
|
|
LOCALBASE="@LOCALBASE@"
|
|
|
|
X11BASE="@X11BASE@"
|
2003-09-17 04:38:22 +02:00
|
|
|
DEPOTBASE="@DEPOTBASE@"
|
2003-09-02 08:59:37 +02:00
|
|
|
PREFIX="@PREFIX@"
|
2003-09-12 07:15:03 +02:00
|
|
|
case ${PKG_PREFIX} in
|
|
|
|
${LOCALBASE}/*) VIEW="${PKG_PREFIX#${LOCALBASE}/}" ;;
|
|
|
|
*) VIEW="" ;;
|
|
|
|
esac
|
2001-11-26 21:37:38 +01:00
|
|
|
|
2003-09-12 07:15:03 +02:00
|
|
|
PKG_SYSCONFBASE="@PKG_SYSCONFBASE@"
|
2003-09-02 08:59:37 +02:00
|
|
|
PKG_SYSCONFDEPOTBASE="@PKG_SYSCONFDEPOTBASE@"
|
2003-09-05 13:34:25 +02:00
|
|
|
PKG_SYSCONFBASEDIR="@PKG_SYSCONFBASEDIR@"
|
2002-06-27 22:42:15 +02:00
|
|
|
PKG_SYSCONFDIR="@PKG_SYSCONFDIR@"
|
2003-09-17 04:38:22 +02:00
|
|
|
CONF_DEPENDS="@CONF_DEPENDS@"
|
2002-06-27 22:42:15 +02:00
|
|
|
|
2003-09-12 07:15:03 +02:00
|
|
|
case ${VIEW} in
|
|
|
|
"") PKG_SYSCONFVIEWBASE="${PKG_SYSCONFBASE}" ;;
|
|
|
|
*) PKG_SYSCONFVIEWBASE="${PKG_SYSCONFBASE}/${VIEW}" ;;
|
|
|
|
esac
|
|
|
|
|
2003-09-13 12:06:36 +02:00
|
|
|
CONF_IGNORE_FILES="*[~#] *.OLD *.orig *,v .pkgsrc */.pkgsrc"
|
|
|
|
|
2003-09-02 08:59:37 +02:00
|
|
|
PKG_INSTALLATION_TYPE="@PKG_INSTALLATION_TYPE@"
|
2001-11-25 19:54:57 +01:00
|
|
|
|
2002-06-24 15:14:41 +02:00
|
|
|
case "${PKG_CONFIG:-@PKG_CONFIG@}" in
|
2002-06-20 22:15:46 +02:00
|
|
|
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
|
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
|
2005-07-29 20:32:17 +02:00
|
|
|
;;
|
|
|
|
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
|
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
|
2005-07-29 20:32:17 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|