2006-03-11 00:36:08 +01:00
|
|
|
# $NetBSD: bsd.pkginstall.mk,v 1.39 2006/03/10 23:36:08 jlam Exp $
|
2006-03-10 00:31:51 +01:00
|
|
|
#
|
|
|
|
# This Makefile fragment is included by bsd.pkg.mk and implements the
|
|
|
|
# common INSTALL/DEINSTALL scripts framework. To use the pkginstall
|
|
|
|
# framework, simply set the relevant variables to customize the install
|
|
|
|
# scripts to the package.
|
|
|
|
#
|
|
|
|
|
|
|
|
# _PKGINSTALL_VARS is a list of the variables that, if non-empty, indicate
|
|
|
|
# that the pkginstall framework should be used. These variables
|
|
|
|
# should be extracted from bsd.pkginstall.mk and are typically the
|
2006-03-11 00:33:57 +01:00
|
|
|
# variables named in the _INSTALL_<SCRIPT>_MEMBERS lists.
|
2006-03-10 00:31:51 +01:00
|
|
|
#
|
|
|
|
# USE_PKGINSTALL may be set to "yes" to force the pkginstall framework
|
|
|
|
# to be used.
|
|
|
|
#
|
|
|
|
_PKGINSTALL_VARS+= HEADER_EXTRA_TMPL
|
2006-03-11 00:33:57 +01:00
|
|
|
_PKGINSTALL_VARS+= DEINSTALL_EXTRA_TMPL
|
|
|
|
_PKGINSTALL_VARS+= INSTALL_EXTRA_TMPL
|
2006-03-10 00:31:51 +01:00
|
|
|
_PKGINSTALL_VARS+= DEINSTALL_SRC INSTALL_SRC
|
|
|
|
|
|
|
|
_PKGINSTALL_VARS+= PKG_GROUPS PKG_USERS
|
|
|
|
_PKGINSTALL_VARS+= SPECIAL_PERMS
|
|
|
|
_PKGINSTALL_VARS+= CONF_FILES CONF_FILES_PERMS \
|
|
|
|
REQD_FILES REQD_FILES_PERMS \
|
|
|
|
RCD_SCRIPTS
|
|
|
|
_PKGINSTALL_VARS+= INFO_FILES
|
|
|
|
_PKGINSTALL_VARS+= MAKE_DIRS MAKE_DIRS_PERMS \
|
|
|
|
REQD_DIRS REQD_DIRS_PERMS \
|
|
|
|
OWN_DIRS OWN_DIRS_PERMS
|
|
|
|
_PKGINSTALL_VARS+= PKG_SHELL
|
|
|
|
_PKGINSTALL_VARS+= FONTS_DIRS.ttf FONTS_DIRS.type1 FONTS_DIRS.x11
|
|
|
|
|
|
|
|
# CONF_DEPENDS notes a dependency where the config directory for the
|
|
|
|
# package matches the dependency's config directory. CONF_DEPENDS is
|
|
|
|
# only meaningful if PKG_INSTALLATION_TYPE is "pkgviews".
|
|
|
|
#
|
|
|
|
_PKGINSTALL_VARS+= CONF_DEPENDS
|
|
|
|
|
|
|
|
.if defined(USE_PKGINSTALL) && !empty(USE_PKGINSTALL:M[yY][eE][sS])
|
|
|
|
_USE_PKGINSTALL= yes
|
2005-08-23 14:01:52 +02:00
|
|
|
.else
|
2006-03-10 00:31:51 +01:00
|
|
|
_USE_PKGINSTALL= no
|
|
|
|
.endif
|
2001-11-19 17:18:44 +01:00
|
|
|
|
2006-03-10 00:31:51 +01:00
|
|
|
.if !empty(_USE_PKGINSTALL:M[nN][oO])
|
|
|
|
. for _var_ in ${_PKGINSTALL_VARS}
|
|
|
|
. if defined(${_var_}) && !empty(${_var_}:M*)
|
|
|
|
_USE_PKGINSTALL= yes
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.endif
|
2001-12-26 16:40:32 +01:00
|
|
|
|
2005-08-04 17:03:39 +02:00
|
|
|
# The Solaris /bin/sh does not know the ${foo#bar} shell substitution.
|
|
|
|
# This shell function serves a similar purpose, but is specialized on
|
2005-08-25 00:43:02 +02:00
|
|
|
# stripping ${PREFIX}/ from a pathname.
|
2005-08-04 17:03:39 +02:00
|
|
|
_FUNC_STRIP_PREFIX= \
|
|
|
|
strip_prefix() { \
|
2005-08-22 00:27:09 +02:00
|
|
|
${AWK} 'END { \
|
|
|
|
plen = length(prefix); \
|
2005-08-04 17:03:39 +02:00
|
|
|
if (substr(s, 1, plen) == prefix) { \
|
|
|
|
s = substr(s, 1 + plen, length(s) - plen); \
|
|
|
|
} \
|
|
|
|
print s; \
|
2005-08-22 10:07:38 +02:00
|
|
|
}' s="$$1" prefix=${PREFIX:Q}/ /dev/null; \
|
2005-08-04 17:03:39 +02:00
|
|
|
}
|
|
|
|
|
2001-11-19 17:18:44 +01:00
|
|
|
# These are the template scripts for the INSTALL/DEINSTALL scripts. Packages
|
|
|
|
# may do additional work in the INSTALL/DEINSTALL scripts by overriding the
|
|
|
|
# variables DEINSTALL_EXTRA_TMPL and INSTALL_EXTRA_TMPL to point to
|
|
|
|
# additional script fragments. These bits are included after the main
|
2006-03-11 00:33:57 +01:00
|
|
|
# install/deinstall script fragments.
|
2001-11-19 17:18:44 +01:00
|
|
|
#
|
|
|
|
_HEADER_TMPL?= ${.CURDIR}/../../mk/install/header
|
2003-07-30 12:31:20 +02:00
|
|
|
.if !defined(HEADER_EXTRA_TMPL) && exists(${.CURDIR}/HEADER)
|
|
|
|
HEADER_EXTRA_TMPL?= ${.CURDIR}/HEADER
|
|
|
|
.else
|
2003-07-30 12:27:05 +02:00
|
|
|
HEADER_EXTRA_TMPL?= # empty
|
2003-07-30 12:31:20 +02:00
|
|
|
.endif
|
2006-03-11 00:33:57 +01:00
|
|
|
_DEINSTALL_PRE_TMPL?= ${.CURDIR}/../../mk/install/deinstall-pre
|
2001-11-19 17:18:44 +01:00
|
|
|
DEINSTALL_EXTRA_TMPL?= # empty
|
2006-03-11 00:33:57 +01:00
|
|
|
_DEINSTALL_TMPL?= ${.CURDIR}/../../mk/install/deinstall
|
|
|
|
_INSTALL_UNPACK_TMPL?= # empty
|
|
|
|
_INSTALL_TMPL?= ${.CURDIR}/../../mk/install/install
|
2001-11-19 17:18:44 +01:00
|
|
|
INSTALL_EXTRA_TMPL?= # empty
|
2006-03-11 00:33:57 +01:00
|
|
|
_INSTALL_POST_TMPL?= ${.CURDIR}/../../mk/install/install-post
|
2001-11-19 17:18:44 +01:00
|
|
|
_FOOTER_TMPL?= ${.CURDIR}/../../mk/install/footer
|
|
|
|
|
|
|
|
# DEINSTALL_TEMPLATES and INSTALL_TEMPLATES are the default list of source
|
|
|
|
# files that are concatenated to form the DEINSTALL/INSTALL scripts.
|
|
|
|
#
|
|
|
|
DEINSTALL_TEMPLATES= ${_HEADER_TMPL}
|
2003-07-30 12:27:05 +02:00
|
|
|
DEINSTALL_TEMPLATES+= ${HEADER_EXTRA_TMPL}
|
2006-03-11 00:33:57 +01:00
|
|
|
DEINSTALL_TEMPLATES+= ${_DEINSTALL_PRE_TMPL}
|
2001-11-19 17:18:44 +01:00
|
|
|
DEINSTALL_TEMPLATES+= ${DEINSTALL_EXTRA_TMPL}
|
2006-03-11 00:33:57 +01:00
|
|
|
DEINSTALL_TEMPLATES+= ${_DEINSTALL_TMPL}
|
2001-11-19 17:18:44 +01:00
|
|
|
DEINSTALL_TEMPLATES+= ${_FOOTER_TMPL}
|
|
|
|
INSTALL_TEMPLATES= ${_HEADER_TMPL}
|
2003-07-30 12:27:05 +02:00
|
|
|
INSTALL_TEMPLATES+= ${HEADER_EXTRA_TMPL}
|
2006-03-11 00:33:57 +01:00
|
|
|
INSTALL_TEMPLATES+= ${_INSTALL_UNPACK_TMPL}
|
|
|
|
INSTALL_TEMPLATES+= ${_INSTALL_TMPL}
|
2001-11-19 17:18:44 +01:00
|
|
|
INSTALL_TEMPLATES+= ${INSTALL_EXTRA_TMPL}
|
2006-03-11 00:33:57 +01:00
|
|
|
INSTALL_TEMPLATES+= ${_INSTALL_POST_TMPL}
|
2001-11-19 17:18:44 +01:00
|
|
|
INSTALL_TEMPLATES+= ${_FOOTER_TMPL}
|
|
|
|
|
|
|
|
# These are the list of source files that are concatenated to form the
|
|
|
|
# INSTALL/DEINSTALL scripts.
|
|
|
|
#
|
|
|
|
DEINSTALL_SRC?= ${DEINSTALL_TEMPLATES}
|
|
|
|
INSTALL_SRC?= ${INSTALL_TEMPLATES}
|
|
|
|
|
2002-09-19 11:02:40 +02:00
|
|
|
# FILES_SUBST lists what to substitute in DEINSTALL/INSTALL scripts and in
|
|
|
|
# rc.d scripts.
|
|
|
|
#
|
2005-12-05 23:07:07 +01:00
|
|
|
FILES_SUBST+= PREFIX=${PREFIX:Q}
|
|
|
|
FILES_SUBST+= LOCALBASE=${LOCALBASE:Q}
|
|
|
|
FILES_SUBST+= X11BASE=${X11BASE:Q}
|
|
|
|
FILES_SUBST+= DEPOTBASE=${DEPOTBASE:Q}
|
|
|
|
FILES_SUBST+= VARBASE=${VARBASE:Q}
|
|
|
|
FILES_SUBST+= PKG_SYSCONFBASE=${PKG_SYSCONFBASE:Q}
|
|
|
|
FILES_SUBST+= PKG_SYSCONFDEPOTBASE=${PKG_SYSCONFDEPOTBASE:Q}
|
|
|
|
FILES_SUBST+= PKG_SYSCONFBASEDIR=${PKG_SYSCONFBASEDIR:Q}
|
|
|
|
FILES_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q}
|
2003-09-17 04:38:22 +02:00
|
|
|
FILES_SUBST+= CONF_DEPENDS=${CONF_DEPENDS:C/:.*//:Q}
|
2005-12-05 23:07:07 +01:00
|
|
|
FILES_SUBST+= PKGBASE=${PKGBASE:Q}
|
|
|
|
FILES_SUBST+= PKG_INSTALLATION_TYPE=${PKG_INSTALLATION_TYPE:Q}
|
2001-11-19 17:18:44 +01:00
|
|
|
|
2001-11-26 21:37:38 +01:00
|
|
|
# PKG_USERS represents the users to create for the package. It is a
|
|
|
|
# space-separated list of elements of the form
|
2001-11-19 17:18:44 +01:00
|
|
|
#
|
2001-11-26 21:37:38 +01:00
|
|
|
# user:group[:[userid][:[descr][:[home][:shell]]]]
|
2001-11-19 17:18:44 +01:00
|
|
|
#
|
2001-11-26 21:37:38 +01:00
|
|
|
# Only the user and group are required; everything else is optional,
|
|
|
|
# but the colons must be in the right places when specifying optional
|
2005-08-23 13:48:47 +02:00
|
|
|
# bits. Note that if the description contains spaces, they must
|
|
|
|
# be escaped as usual, e.g.
|
2001-11-19 17:18:44 +01:00
|
|
|
#
|
2005-08-23 13:48:47 +02:00
|
|
|
# foo:foogrp::The\ Foomister
|
2001-11-19 17:18:44 +01:00
|
|
|
#
|
2001-11-26 21:37:38 +01:00
|
|
|
# PKG_GROUPS represents the groups to create for the package. It is a
|
|
|
|
# space-separated list of elements of the form
|
2001-11-19 17:18:44 +01:00
|
|
|
#
|
2001-11-26 21:37:38 +01:00
|
|
|
# group[:groupid]
|
|
|
|
#
|
|
|
|
# Only the group is required; the groupid is optional.
|
|
|
|
#
|
2005-01-28 08:37:55 +01:00
|
|
|
PKG_GROUPS?= # empty
|
2001-11-26 21:37:38 +01:00
|
|
|
PKG_USERS?= # empty
|
|
|
|
_PKG_USER_HOME?= /nonexistent
|
|
|
|
_PKG_USER_SHELL?= ${NOLOGIN}
|
2005-12-05 23:07:07 +01:00
|
|
|
FILES_SUBST+= PKG_USER_HOME=${_PKG_USER_HOME:Q}
|
|
|
|
FILES_SUBST+= PKG_USER_SHELL=${_PKG_USER_SHELL:Q}
|
2001-11-19 17:18:44 +01:00
|
|
|
|
2005-08-24 14:34:42 +02:00
|
|
|
# Interix is very special in that users are groups cannot have the
|
2004-10-06 22:51:47 +02:00
|
|
|
# same name. Interix.mk tries to work around this by overriding
|
2004-04-27 14:06:11 +02:00
|
|
|
# some specific package defaults. If we get here and there's still a
|
|
|
|
# conflict, add a breakage indicator to make sure the package won't
|
|
|
|
# compile without changing something.
|
|
|
|
#
|
|
|
|
.if !empty(OPSYS:MInterix)
|
2005-02-10 00:56:10 +01:00
|
|
|
. for user in ${PKG_USERS:C/\\\\//g:C/:.*//}
|
|
|
|
. if !empty(PKG_GROUPS:M${user})
|
|
|
|
PKG_FAIL_REASON+= "User and group '${user}' cannot have the same name on Interix"
|
2004-04-27 16:00:16 +02:00
|
|
|
. endif
|
|
|
|
. endfor
|
2004-04-27 14:06:11 +02:00
|
|
|
.endif
|
|
|
|
|
2004-12-27 07:41:50 +01:00
|
|
|
.if !empty(PKG_USERS) || !empty(PKG_GROUPS)
|
|
|
|
DEPENDS+= ${_USER_DEPENDS}
|
2001-11-19 17:18:44 +01:00
|
|
|
.endif
|
|
|
|
|
2006-03-11 00:33:57 +01:00
|
|
|
_INSTALL_USERGROUP_FILE= ${WRKDIR}/.install-usergroup
|
2005-09-27 00:12:35 +02:00
|
|
|
.if exists(../../mk/install/usergroupfuncs.${OPSYS})
|
2006-03-11 00:33:57 +01:00
|
|
|
_INSTALL_USERGROUPFUNCS_FILE?= ../../mk/install/usergroupfuncs.${OPSYS}
|
2005-09-27 00:12:35 +02:00
|
|
|
.else
|
2006-03-11 00:33:57 +01:00
|
|
|
_INSTALL_USERGROUPFUNCS_FILE?= ../../mk/install/usergroupfuncs
|
2005-09-27 00:12:35 +02:00
|
|
|
.endif
|
2006-03-11 00:33:57 +01:00
|
|
|
_INSTALL_UNPACK_TMPL+= ${_INSTALL_USERGROUP_FILE}
|
2006-03-11 00:36:08 +01:00
|
|
|
_INSTALL_USERGROUP_MEMBERS= ${PKG_USERS} ${PKG_GROUPS}
|
2005-01-28 08:37:55 +01:00
|
|
|
|
2006-03-11 00:33:57 +01:00
|
|
|
${_INSTALL_USERGROUP_FILE}: \
|
2005-09-27 00:12:35 +02:00
|
|
|
../../mk/install/usergroup \
|
|
|
|
${INSTALL_USERGROUPFUNCS_FILE}
|
2005-08-23 11:19:06 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
|
|
|
${RM} -f ${.TARGET} ${.TARGET}.tmp; \
|
|
|
|
exec 1>>${.TARGET}.tmp; \
|
2005-01-28 08:37:55 +01:00
|
|
|
${ECHO} "# start of install-usergroup"; \
|
|
|
|
${ECHO} "#"; \
|
|
|
|
${ECHO} "# Generate a +USERGROUP script that reference counts users"; \
|
|
|
|
${ECHO} "# and groups that are required for the proper functioning"; \
|
|
|
|
${ECHO} "# of the package."; \
|
|
|
|
${ECHO} "#"; \
|
|
|
|
${ECHO} "case \$${STAGE} in"; \
|
2005-02-04 00:29:08 +01:00
|
|
|
${ECHO} "PRE-INSTALL|UNPACK)"; \
|
2005-01-28 08:37:55 +01:00
|
|
|
${ECHO} " \$${CAT} > ./+USERGROUP << 'EOF_USERGROUP'"; \
|
2006-03-11 00:33:57 +01:00
|
|
|
${SED} -e "/^# platform-specific adduser\/addgroup functions/r${_INSTALL_USERGROUPFUNCS_FILE}" ../../mk/install/usergroup | \
|
2005-09-27 00:12:35 +02:00
|
|
|
${SED} ${FILES_SUBST_SED}; \
|
2005-01-28 08:37:55 +01:00
|
|
|
${ECHO} ""; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${PKG_GROUPS}; shift; \
|
2005-08-05 09:06:47 +02:00
|
|
|
while ${TEST} $$# -gt 0; do \
|
2005-08-19 19:20:33 +02:00
|
|
|
i="$$1"; shift; \
|
2005-01-28 08:37:55 +01:00
|
|
|
${ECHO} "# GROUP: $$i"; \
|
|
|
|
done; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${PKG_USERS}; shift; \
|
2005-08-05 09:06:47 +02:00
|
|
|
while ${TEST} $$# -gt 0; do \
|
2005-08-19 19:20:33 +02:00
|
|
|
i="$$1"; shift; \
|
2005-01-28 08:37:55 +01:00
|
|
|
${ECHO} "# USER: $$i"; \
|
|
|
|
done; \
|
|
|
|
${ECHO} "EOF_USERGROUP"; \
|
|
|
|
${ECHO} " \$${CHMOD} +x ./+USERGROUP"; \
|
|
|
|
${ECHO} " ;;"; \
|
|
|
|
${ECHO} "esac"; \
|
|
|
|
${ECHO} ""; \
|
|
|
|
${ECHO} "# end of install-usergroup"; \
|
2005-08-23 11:19:06 +02:00
|
|
|
exec 1>/dev/null; \
|
2005-01-28 08:37:55 +01:00
|
|
|
${MV} -f ${.TARGET}.tmp ${.TARGET}
|
2006-03-10 00:31:51 +01:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
2006-03-11 00:33:57 +01:00
|
|
|
set -- dummy ${_INSTALL_USERGROUP_MEMBERS}; shift; \
|
2006-03-10 00:31:51 +01:00
|
|
|
if ${TEST} $$# -eq 0; then \
|
|
|
|
${RM} -f ${.TARGET}; \
|
|
|
|
${TOUCH} ${TOUCH_ARGS} ${.TARGET}; \
|
|
|
|
fi
|
2005-01-28 08:37:55 +01:00
|
|
|
|
2002-10-05 01:46:26 +02:00
|
|
|
# SPECIAL_PERMS are lists that look like:
|
|
|
|
# file user group mode
|
|
|
|
# At post-install time, file (it may be a directory) is changed to be
|
2005-07-29 23:41:04 +02:00
|
|
|
# owned by user:group with mode permissions. If a file pathname
|
|
|
|
# is relative, then it is taken to be relative to ${PREFIX}.
|
2002-10-05 01:46:26 +02:00
|
|
|
#
|
|
|
|
# SPECIAL_PERMS should be used primarily to change permissions of files or
|
|
|
|
# directories listed in the PLIST. This may be used to make certain files
|
|
|
|
# set-uid or to change the ownership or a directory.
|
|
|
|
#
|
2002-10-20 20:01:47 +02:00
|
|
|
# SETUID_ROOT_PERMS is a convenience definition to note an executable is
|
|
|
|
# meant to be setuid-root, and should be used as follows:
|
|
|
|
#
|
|
|
|
# SPECIAL_PERMS+= /path/to/suidroot ${SETUID_ROOT_PERMS}
|
|
|
|
#
|
2002-10-05 01:46:26 +02:00
|
|
|
SPECIAL_PERMS?= # empty
|
2002-10-20 20:01:47 +02:00
|
|
|
SETUID_ROOT_PERMS?= ${ROOT_USER} ${ROOT_GROUP} 4711
|
2005-02-02 11:33:01 +01:00
|
|
|
|
2006-03-11 00:33:57 +01:00
|
|
|
_INSTALL_PERMS_FILE= ${WRKDIR}/.install-perms
|
|
|
|
_INSTALL_UNPACK_TMPL+= ${_INSTALL_PERMS_FILE}
|
2006-03-11 00:36:08 +01:00
|
|
|
_INSTALL_PERMS_MEMBERS= ${SPECIAL_PERMS}
|
2005-02-02 11:33:01 +01:00
|
|
|
|
2006-03-11 00:33:57 +01:00
|
|
|
${_INSTALL_PERMS_FILE}: ../../mk/install/perms
|
2005-08-19 19:20:33 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${.TARGET} ${.TARGET}.tmp
|
2005-08-23 11:29:06 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
|
|
|
${_FUNC_STRIP_PREFIX}; \
|
|
|
|
exec 1>>${.TARGET}.tmp; \
|
2005-02-02 11:33:01 +01:00
|
|
|
${ECHO} "# start of install-perms"; \
|
|
|
|
${ECHO} "#"; \
|
|
|
|
${ECHO} "# Generate a +PERMS script that sets the special"; \
|
|
|
|
${ECHO} "# permissions on files and directories used by the"; \
|
|
|
|
${ECHO} "# package."; \
|
|
|
|
${ECHO} "#"; \
|
|
|
|
${ECHO} "case \$${STAGE} in"; \
|
2005-02-04 00:29:08 +01:00
|
|
|
${ECHO} "PRE-INSTALL|UNPACK)"; \
|
2005-02-02 11:33:01 +01:00
|
|
|
${ECHO} " \$${CAT} > ./+PERMS << 'EOF_PERMS'"; \
|
|
|
|
${SED} ${FILES_SUBST_SED} ../../mk/install/perms; \
|
|
|
|
${ECHO} ""; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${SPECIAL_PERMS}; shift; \
|
2005-02-02 11:33:01 +01:00
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
file="$$1"; owner="$$2"; group="$$3"; mode="$$4"; \
|
|
|
|
shift; shift; shift; shift; \
|
2005-08-04 17:03:39 +02:00
|
|
|
file=`strip_prefix "$$file"`; \
|
2005-02-02 11:33:01 +01:00
|
|
|
${ECHO} "# PERMS: $$file $$mode $$owner $$group"; \
|
|
|
|
done; \
|
|
|
|
${ECHO} "EOF_PERMS"; \
|
|
|
|
${ECHO} " \$${CHMOD} +x ./+PERMS"; \
|
|
|
|
${ECHO} " ;;"; \
|
|
|
|
${ECHO} "esac"; \
|
|
|
|
${ECHO} ""; \
|
|
|
|
${ECHO} "# end of install-perms"; \
|
2005-08-23 11:29:06 +02:00
|
|
|
exec 1>/dev/null; \
|
2005-02-02 11:33:01 +01:00
|
|
|
${MV} -f ${.TARGET}.tmp ${.TARGET}
|
2006-03-10 00:31:51 +01:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
2006-03-11 00:33:57 +01:00
|
|
|
set -- dummy ${_INSTALL_PERMS_MEMBERS}; shift; \
|
2006-03-10 00:31:51 +01:00
|
|
|
if ${TEST} $$# -eq 0; then \
|
|
|
|
${RM} -f ${.TARGET}; \
|
|
|
|
${TOUCH} ${TOUCH_ARGS} ${.TARGET}; \
|
|
|
|
fi
|
2002-10-05 01:46:26 +02:00
|
|
|
|
2001-11-19 17:18:44 +01:00
|
|
|
# CONF_FILES are pairs of example and true config files, used much like
|
|
|
|
# MLINKS in the base system. At post-install time, if the true config
|
|
|
|
# file doesn't exist, then the example one is copied into place. At
|
|
|
|
# deinstall time, the true one is removed if it doesn't differ from the
|
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
|
|
|
# example one. REQD_FILES is the same as CONF_FILES but the value
|
2005-08-20 04:22:02 +02:00
|
|
|
# of PKG_CONFIG is ignored; however, all files listed in REQD_FILES
|
|
|
|
# should be under ${PREFIX}.
|
2001-11-19 17:18:44 +01: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
|
|
|
# CONF_FILES_MODE and REQD_FILES_MODE are the file permissions for the
|
|
|
|
# files in CONF_FILES and REQD_FILES, respectively.
|
2001-11-19 17:18:44 +01:00
|
|
|
#
|
|
|
|
# CONF_FILES_PERMS are lists that look like:
|
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
|
|
|
#
|
2001-11-19 17:18:44 +01:00
|
|
|
# example_file config_file user group mode
|
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
|
|
|
#
|
2001-11-19 17:18:44 +01:00
|
|
|
# and works like CONF_FILES, except the config files are owned by
|
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
|
|
|
# user:group have mode permissions. REQD_FILES_PERMS is the same
|
2005-08-20 04:22:02 +02:00
|
|
|
# as CONF_FILES_PERMS but the value of PKG_CONFIG is ignored;
|
|
|
|
# however, all files listed in REQD_FILES_PERMS should be under
|
|
|
|
# ${PREFIX}.
|
2001-11-19 17:18:44 +01:00
|
|
|
#
|
2002-07-24 22:30:06 +02:00
|
|
|
# RCD_SCRIPTS works lists the basenames of the rc.d scripts. They are
|
2005-05-02 22:33:57 +02:00
|
|
|
# expected to be found in ${PREFIX}/share/examples/rc.d, and
|
2004-10-12 00:04:19 +02:00
|
|
|
# the scripts will be copied into ${RCD_SCRIPTS_DIR} with
|
|
|
|
# ${RCD_SCRIPTS_MODE} permissions.
|
2001-11-19 17:18:44 +01:00
|
|
|
#
|
2005-07-29 23:41:04 +02:00
|
|
|
# If any file pathnames are relative, then they are taken to be relative
|
|
|
|
# to ${PREFIX}.
|
|
|
|
#
|
2001-11-19 17:18:44 +01:00
|
|
|
CONF_FILES?= # empty
|
|
|
|
CONF_FILES_MODE?= 0644
|
|
|
|
CONF_FILES_PERMS?= # empty
|
|
|
|
RCD_SCRIPTS?= # empty
|
|
|
|
RCD_SCRIPTS_MODE?= 0755
|
2005-05-02 22:33:57 +02:00
|
|
|
RCD_SCRIPTS_EXAMPLEDIR= share/examples/rc.d
|
2002-09-20 02:45:00 +02:00
|
|
|
RCD_SCRIPTS_SHELL?= ${SH}
|
2005-12-05 23:07:07 +01:00
|
|
|
FILES_SUBST+= RCD_SCRIPTS_SHELL=${RCD_SCRIPTS_SHELL:Q}
|
2002-10-19 03:33:51 +02:00
|
|
|
MESSAGE_SUBST+= RCD_SCRIPTS_DIR=${RCD_SCRIPTS_DIR}
|
2004-10-11 23:49:00 +02:00
|
|
|
MESSAGE_SUBST+= RCD_SCRIPTS_EXAMPLEDIR=${RCD_SCRIPTS_EXAMPLEDIR}
|
2001-12-18 20:54:00 +01:00
|
|
|
|
2006-03-11 00:33:57 +01:00
|
|
|
_INSTALL_FILES_FILE= ${WRKDIR}/.install-files
|
|
|
|
_INSTALL_UNPACK_TMPL+= ${_INSTALL_FILES_FILE}
|
2006-03-11 00:36:08 +01:00
|
|
|
_INSTALL_FILES_MEMBERS= ${RCD_SCRIPTS} ${CONF_FILES} ${REQD_FILES} \
|
|
|
|
${CONF_FILES_PERMS} ${REQD_FILES_PERMS}
|
2005-02-02 11:33:01 +01:00
|
|
|
|
2006-03-11 00:33:57 +01:00
|
|
|
${_INSTALL_FILES_FILE}: ../../mk/install/files
|
2005-08-19 19:20:33 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${.TARGET} ${.TARGET}.tmp
|
2005-08-23 10:54:29 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
|
|
|
exec 1>>${.TARGET}.tmp; \
|
2005-02-02 11:33:01 +01:00
|
|
|
${ECHO} "# start of install-files"; \
|
|
|
|
${ECHO} "#"; \
|
|
|
|
${ECHO} "# Generate a +FILES script that reference counts config"; \
|
|
|
|
${ECHO} "# files that are required for the proper functioning"; \
|
|
|
|
${ECHO} "# of the package."; \
|
|
|
|
${ECHO} "#"; \
|
|
|
|
${ECHO} "case \$${STAGE} in"; \
|
2005-02-04 00:29:08 +01:00
|
|
|
${ECHO} "PRE-INSTALL|UNPACK)"; \
|
2005-02-02 11:33:01 +01:00
|
|
|
${ECHO} " \$${CAT} > ./+FILES << 'EOF_FILES'"; \
|
|
|
|
${SED} ${FILES_SUBST_SED} ../../mk/install/files; \
|
2005-08-23 10:54:29 +02:00
|
|
|
${ECHO} ""
|
2005-08-19 19:20:33 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${_FUNC_STRIP_PREFIX}; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${RCD_SCRIPTS}; shift; \
|
2005-08-23 10:54:29 +02:00
|
|
|
exec 1>>${.TARGET}.tmp; \
|
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
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
script="$$1"; shift; \
|
|
|
|
file="${RCD_SCRIPTS_DIR:S/^${PREFIX}\///}/$$script"; \
|
|
|
|
egfile="${RCD_SCRIPTS_EXAMPLEDIR}/$$script"; \
|
|
|
|
${ECHO} "# FILE: $$file cr $$egfile ${RCD_SCRIPTS_MODE}"; \
|
2005-08-23 10:54:29 +02:00
|
|
|
done
|
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_SILENT}${_PKG_DEBUG}${_FUNC_STRIP_PREFIX}; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${CONF_FILES}; shift; \
|
2005-08-23 10:54:29 +02:00
|
|
|
exec 1>>${.TARGET}.tmp; \
|
2005-02-02 11:33:01 +01:00
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
egfile="$$1"; file="$$2"; \
|
|
|
|
shift; shift; \
|
2005-08-04 17:03:39 +02:00
|
|
|
egfile=`strip_prefix "$$egfile"`; \
|
|
|
|
file=`strip_prefix "$$file"`; \
|
2005-02-02 11:33:01 +01:00
|
|
|
${ECHO} "# FILE: $$file c $$egfile ${CONF_FILES_MODE}"; \
|
2005-08-23 10:54:29 +02:00
|
|
|
done
|
2005-08-19 19:20:33 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${_FUNC_STRIP_PREFIX}; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${REQD_FILES}; shift; \
|
2005-08-23 10:54:29 +02:00
|
|
|
exec 1>>${.TARGET}.tmp; \
|
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
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
egfile="$$1"; file="$$2"; \
|
|
|
|
shift; shift; \
|
|
|
|
egfile=`strip_prefix "$$egfile"`; \
|
|
|
|
file=`strip_prefix "$$file"`; \
|
|
|
|
${ECHO} "# FILE: $$file cf $$egfile ${REQD_FILES_MODE}"; \
|
2005-08-23 10:54:29 +02:00
|
|
|
done
|
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_SILENT}${_PKG_DEBUG}${_FUNC_STRIP_PREFIX}; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${CONF_FILES_PERMS}; shift; \
|
2005-08-23 10:54:29 +02:00
|
|
|
exec 1>>${.TARGET}.tmp; \
|
2005-02-02 11:33:01 +01:00
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
egfile="$$1"; file="$$2"; \
|
|
|
|
owner="$$3"; group="$$4"; mode="$$5"; \
|
|
|
|
shift; shift; shift; shift; shift; \
|
2005-08-04 17:03:39 +02:00
|
|
|
egfile=`strip_prefix "$$egfile"`; \
|
|
|
|
file=`strip_prefix "$$file"`; \
|
2005-02-02 11:33:01 +01:00
|
|
|
${ECHO} "# FILE: $$file c $$egfile $$mode $$owner $$group"; \
|
2005-08-23 10:54:29 +02:00
|
|
|
done
|
2005-08-19 19:20:33 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${_FUNC_STRIP_PREFIX}; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${REQD_FILES_PERMS}; shift; \
|
2005-08-23 10:54:29 +02:00
|
|
|
exec 1>>${.TARGET}.tmp; \
|
2005-02-02 11:33:01 +01:00
|
|
|
while ${TEST} $$# -gt 0; do \
|
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
|
|
|
egfile="$$1"; file="$$2"; \
|
|
|
|
owner="$$3"; group="$$4"; mode="$$5"; \
|
|
|
|
shift; shift; shift; shift; shift; \
|
|
|
|
egfile=`strip_prefix "$$egfile"`; \
|
|
|
|
file=`strip_prefix "$$file"`; \
|
|
|
|
${ECHO} "# FILE: $$file cf $$egfile $$mode $$owner $$group"; \
|
2005-08-23 10:54:29 +02:00
|
|
|
done
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
|
|
|
exec 1>>${.TARGET}.tmp; \
|
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
|
|
|
${ECHO} "EOF_FILES"; \
|
|
|
|
${ECHO} " \$${CHMOD} +x ./+FILES"; \
|
2005-02-02 11:33:01 +01:00
|
|
|
${ECHO} " ;;"; \
|
|
|
|
${ECHO} "esac"; \
|
|
|
|
${ECHO} ""; \
|
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
|
|
|
${ECHO} "# end of install-files"; \
|
2005-02-02 11:33:01 +01:00
|
|
|
${MV} -f ${.TARGET}.tmp ${.TARGET}
|
2006-03-10 00:31:51 +01:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
2006-03-11 00:33:57 +01:00
|
|
|
set -- dummy ${_INSTALL_FILES_MEMBERS}; shift; \
|
2006-03-10 00:31:51 +01:00
|
|
|
if ${TEST} $$# -eq 0; then \
|
|
|
|
${RM} -f ${.TARGET}; \
|
|
|
|
${TOUCH} ${TOUCH_ARGS} ${.TARGET}; \
|
|
|
|
fi
|
2005-02-02 11:33:01 +01:00
|
|
|
|
2001-11-19 17:18:44 +01:00
|
|
|
# OWN_DIRS contains a list of directories for this package that should be
|
|
|
|
# created and should attempt to be destroyed by the INSTALL/DEINSTALL
|
|
|
|
# scripts. MAKE_DIRS is used the same way, but the package admin
|
|
|
|
# isn't prompted to remove the directory at post-deinstall time if it
|
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
|
|
|
# isn't empty. REQD_DIRS is like MAKE_DIRS but the value of PKG_CONFIG
|
2005-08-20 04:22:02 +02:00
|
|
|
# is ignored; however, all directories listed in REQD_DIRS should
|
|
|
|
# be under ${PREFIX}.
|
2001-11-19 17:18:44 +01:00
|
|
|
#
|
|
|
|
# OWN_DIRS_PERMS contains a list of "directory owner group mode" sublists
|
|
|
|
# representing directories for this package that should be
|
|
|
|
# created/destroyed by the INSTALL/DEINSTALL scripts. MAKE_DIRS_PERMS
|
|
|
|
# is used the same way but the package admin isn't prompted to remove
|
|
|
|
# the directory at post-deinstall time if it isn't empty.
|
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
|
|
|
# REQD_DIRS_PERMS is like MAKE_DIRS but the value of PKG_CONFIG is
|
2005-08-20 04:22:02 +02:00
|
|
|
# ignored; however, all directories listed in REQD_DIRS should be
|
|
|
|
# under ${PREFIX}.
|
2001-11-19 17:18:44 +01:00
|
|
|
#
|
2005-07-29 23:41:04 +02:00
|
|
|
# If any directory pathnames are relative, then they are taken to be
|
|
|
|
# relative to ${PREFIX}.
|
|
|
|
#
|
2001-11-19 17:18:44 +01:00
|
|
|
MAKE_DIRS?= # empty
|
|
|
|
MAKE_DIRS_PERMS?= # empty
|
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
|
|
|
REQD_DIRS?= # empty
|
|
|
|
REQD_DIRS_PERMS?= # empty
|
2001-11-19 17:18:44 +01:00
|
|
|
OWN_DIRS?= # empty
|
|
|
|
OWN_DIRS_PERMS?= # empty
|
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
|
|
|
|
2006-03-11 00:33:57 +01:00
|
|
|
_INSTALL_DIRS_FILE= ${WRKDIR}/.install-dirs
|
|
|
|
_INSTALL_UNPACK_TMPL+= ${_INSTALL_DIRS_FILE}
|
2006-03-11 00:36:08 +01:00
|
|
|
_INSTALL_DIRS_MEMBERS= ${PKG_SYSCONFSUBDIR} ${RCD_SCRIPTS} \
|
|
|
|
${CONF_FILES} ${CONF_FILES_PERMS} \
|
|
|
|
${MAKE_DIRS} ${MAKE_DIRS_PERMS} \
|
|
|
|
${REQD_DIRS} ${REDQ_DIRS_PERMS} \
|
|
|
|
${OWN_DIRS} ${OWN_DIRS_PERMS}
|
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
|
|
|
|
2006-03-11 00:33:57 +01:00
|
|
|
${_INSTALL_DIRS_FILE}: ../../mk/install/dirs
|
2005-08-19 19:20:33 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${.TARGET} ${.TARGET}.tmp
|
2005-08-23 11:51:35 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
|
|
|
exec 1>>${.TARGET}.tmp; \
|
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
|
|
|
${ECHO} "# start of install-dirs"; \
|
|
|
|
${ECHO} "#"; \
|
|
|
|
${ECHO} "# Generate a +DIRS script that reference counts directories"; \
|
|
|
|
${ECHO} "# that are required for the proper functioning of the"; \
|
|
|
|
${ECHO} "# package."; \
|
|
|
|
${ECHO} "#"; \
|
|
|
|
${ECHO} "case \$${STAGE} in"; \
|
2005-02-04 00:29:08 +01:00
|
|
|
${ECHO} "PRE-INSTALL|UNPACK)"; \
|
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
|
|
|
${ECHO} " \$${CAT} > ./+DIRS << 'EOF_DIRS'"; \
|
|
|
|
${SED} ${FILES_SUBST_SED} ../../mk/install/dirs; \
|
2005-08-23 11:51:35 +02:00
|
|
|
${ECHO} ""
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
|
|
|
exec 1>>${.TARGET}.tmp; \
|
2005-09-30 18:39:26 +02:00
|
|
|
case ${PKG_SYSCONFSUBDIR:M*:Q}${CONF_FILES:M*:Q}${CONF_FILES_PERMS:M*:Q}"" in \
|
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
|
|
|
"") ;; \
|
2005-07-29 23:41:04 +02:00
|
|
|
*) ${ECHO} "# DIR: ${PKG_SYSCONFDIR:S/${PREFIX}\///} m" ;; \
|
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
|
|
|
esac; \
|
2005-08-23 11:51:35 +02:00
|
|
|
case ${RCD_SCRIPTS:M*:Q}"" in \
|
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
|
|
|
"") ;; \
|
2005-07-29 23:41:04 +02:00
|
|
|
*) ${ECHO} "# DIR: ${RCD_SCRIPTS_DIR:S/${PREFIX}\///} m" ;; \
|
2005-08-23 11:51:35 +02:00
|
|
|
esac
|
2005-08-19 19:20:33 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${_FUNC_STRIP_PREFIX}; \
|
2005-08-23 11:51:35 +02:00
|
|
|
exec 1>>${.TARGET}.tmp; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${MAKE_DIRS}; shift; \
|
2005-08-19 19:20:33 +02:00
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
dir="$$1"; shift; \
|
2005-08-04 17:03:39 +02:00
|
|
|
dir=`strip_prefix "$$dir"`; \
|
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
|
|
|
${ECHO} "# DIR: $$dir m"; \
|
|
|
|
done; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${REQD_DIRS}; shift; \
|
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
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
dir="$$1"; shift; \
|
|
|
|
dir=`strip_prefix "$$dir"`; \
|
|
|
|
${ECHO} "# DIR: $$dir fm"; \
|
|
|
|
done; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${OWN_DIRS}; shift; \
|
2005-08-19 19:20:33 +02:00
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
dir="$$1"; shift; \
|
2005-08-04 17:03:39 +02:00
|
|
|
dir=`strip_prefix "$$dir"`; \
|
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
|
|
|
${ECHO} "# DIR: $$dir mo"; \
|
2005-08-23 11:51:35 +02:00
|
|
|
done
|
2005-08-19 19:20:33 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${_FUNC_STRIP_PREFIX}; \
|
2005-08-23 11:51:35 +02:00
|
|
|
exec 1>>${.TARGET}.tmp; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${MAKE_DIRS_PERMS}; shift; \
|
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
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
dir="$$1"; owner="$$2"; group="$$3"; mode="$$4"; \
|
|
|
|
shift; shift; shift; shift; \
|
2005-08-04 17:03:39 +02:00
|
|
|
dir=`strip_prefix "$$dir"`; \
|
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
|
|
|
${ECHO} "# DIR: $$dir m $$owner $$group $$mode"; \
|
|
|
|
done; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${REQD_DIRS_PERMS}; shift; \
|
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
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
dir="$$1"; owner="$$2"; group="$$3"; mode="$$4"; \
|
|
|
|
shift; shift; shift; shift; \
|
|
|
|
dir=`strip_prefix "$$dir"`; \
|
|
|
|
${ECHO} "# DIR: $$dir fm $$owner $$group $$mode"; \
|
|
|
|
done; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${OWN_DIRS_PERMS}; shift; \
|
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
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
dir="$$1"; owner="$$2"; group="$$3"; mode="$$4"; \
|
|
|
|
shift; shift; shift; shift; \
|
2005-08-04 17:03:39 +02:00
|
|
|
dir=`strip_prefix "$$dir"`; \
|
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
|
|
|
${ECHO} "# DIR: $$dir mo $$owner $$group $$mode"; \
|
2005-08-23 11:51:35 +02:00
|
|
|
done
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
|
|
|
exec 1>>${.TARGET}.tmp; \
|
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
|
|
|
${ECHO} "EOF_DIRS"; \
|
|
|
|
${ECHO} " \$${CHMOD} +x ./+DIRS"; \
|
|
|
|
${ECHO} " ;;"; \
|
|
|
|
${ECHO} "esac"; \
|
2005-01-28 08:39:13 +01:00
|
|
|
${ECHO} ""; \
|
|
|
|
${ECHO} "# end of install-dirs"; \
|
2005-08-23 11:51:35 +02:00
|
|
|
exec 1>/dev/null; \
|
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
|
|
|
${MV} -f ${.TARGET}.tmp ${.TARGET}
|
2006-03-10 00:31:51 +01:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
2006-03-11 00:33:57 +01:00
|
|
|
set -- dummy ${_INSTALL_DIRS_MEMBERS}; shift; \
|
2006-03-10 00:31:51 +01:00
|
|
|
if ${TEST} $$# -eq 0; then \
|
|
|
|
${RM} -f ${.TARGET}; \
|
|
|
|
${TOUCH} ${TOUCH_ARGS} ${.TARGET}; \
|
|
|
|
fi
|
2001-11-19 17:18:44 +01:00
|
|
|
|
2006-03-09 01:20:27 +01:00
|
|
|
# INFO_FILES contains names of info files that should be registered or
|
|
|
|
# removed from the info directory indices. The listed info files
|
|
|
|
# are assumed to be directly under ${INFO_DIR}.
|
|
|
|
#
|
|
|
|
INFO_FILES?= # empty
|
|
|
|
|
2006-03-11 00:33:57 +01:00
|
|
|
_INSTALL_INFO_FILES_FILE= ${WRKDIR}/.install-info-files
|
|
|
|
_INSTALL_UNPACK_TMPL+= ${_INSTALL_INFO_FILES_FILE}
|
2006-03-11 00:36:08 +01:00
|
|
|
_INSTALL_INFO_FILES_MEMBERS= ${INFO_FILES}
|
2006-03-09 01:20:27 +01:00
|
|
|
|
|
|
|
.if !empty(INFO_FILES:M*)
|
|
|
|
USE_TOOLS+= install-info:run
|
|
|
|
FILES_SUBST+= INSTALL_INFO=${INSTALL_INFO:Q}
|
|
|
|
.endif
|
|
|
|
|
2006-03-11 00:33:57 +01:00
|
|
|
${_INSTALL_INFO_FILES_FILE}: ../../mk/install/info-files
|
2006-03-09 01:20:27 +01:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${.TARGET} ${.TARGET}.tmp
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
|
|
|
${_FUNC_STRIP_PREFIX}; \
|
|
|
|
exec 1>>${.TARGET}.tmp; \
|
|
|
|
${ECHO} "# start of install-info-files"; \
|
|
|
|
${ECHO} "#"; \
|
|
|
|
${ECHO} "# Generate an +INFO_FILES script that handles info file registration."; \
|
|
|
|
${ECHO} "#"; \
|
|
|
|
${ECHO} "case \$${STAGE} in"; \
|
|
|
|
${ECHO} "PRE-INSTALL|UNPACK)"; \
|
|
|
|
${ECHO} " \$${CAT} > ./+INFO_FILES << 'EOF_INFO_FILES'"; \
|
|
|
|
${SED} ${FILES_SUBST_SED} ../../mk/install/info-files; \
|
|
|
|
${ECHO} ""; \
|
|
|
|
set -- dummy ${INFO_FILES}; shift; \
|
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
file="$$1"; shift; \
|
|
|
|
file=${INFO_DIR:Q}"/$$file"; \
|
|
|
|
${ECHO} "# INFO: $$file"; \
|
|
|
|
done; \
|
|
|
|
${ECHO} "EOF_INFO_FILES"; \
|
|
|
|
${ECHO} " \$${CHMOD} +x ./+INFO_FILES"; \
|
|
|
|
${ECHO} " ;;"; \
|
|
|
|
${ECHO} "esac"; \
|
|
|
|
${ECHO} ""; \
|
|
|
|
${ECHO} "# end of install-info-files"; \
|
|
|
|
exec 1>/dev/null; \
|
|
|
|
${MV} -f ${.TARGET}.tmp ${.TARGET}
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
2006-03-11 00:33:57 +01:00
|
|
|
set -- dummy ${_INSTALL_INFO_FILES_MEMBERS}; shift; \
|
2006-03-10 00:31:51 +01:00
|
|
|
if ${TEST} $$# -eq 0; then \
|
|
|
|
${RM} -f ${.TARGET}; \
|
|
|
|
${TOUCH} ${TOUCH_ARGS} ${.TARGET}; \
|
|
|
|
fi
|
2006-03-09 01:20:27 +01:00
|
|
|
|
2005-07-29 20:32:17 +02:00
|
|
|
# PKG_SHELL contains the pathname of the shell that should be added or
|
2005-07-29 23:41:04 +02:00
|
|
|
# removed from the shell database, /etc/shells. If a pathname
|
2005-07-29 20:32:17 +02:00
|
|
|
# is relative, then it is taken to be relative to ${PREFIX}.
|
|
|
|
#
|
|
|
|
PKG_SHELL?= # empty
|
|
|
|
|
2006-03-11 00:33:57 +01:00
|
|
|
_INSTALL_SHELL_FILE= ${WRKDIR}/.install-shell
|
|
|
|
_INSTALL_UNPACK_TMPL+= ${_INSTALL_SHELL_FILE}
|
2006-03-11 00:36:08 +01:00
|
|
|
_INSTALL_SHELL_MEMBERS= ${PKG_SHELL}
|
2005-07-29 20:32:17 +02:00
|
|
|
|
2006-03-11 00:33:57 +01:00
|
|
|
${_INSTALL_SHELL_FILE}: ../../mk/install/shell
|
2005-08-19 19:20:33 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${.TARGET} ${.TARGET}.tmp
|
2005-08-23 12:00:50 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
|
|
|
${_FUNC_STRIP_PREFIX}; \
|
|
|
|
exec 1>>${.TARGET}.tmp; \
|
2005-07-29 20:32:17 +02:00
|
|
|
${ECHO} "# start of install-shell"; \
|
|
|
|
${ECHO} "#"; \
|
|
|
|
${ECHO} "# Generate a +SHELL script that handles shell registration."; \
|
|
|
|
${ECHO} "#"; \
|
|
|
|
${ECHO} "case \$${STAGE} in"; \
|
|
|
|
${ECHO} "PRE-INSTALL|UNPACK)"; \
|
|
|
|
${ECHO} " \$${CAT} > ./+SHELL << 'EOF_SHELL'"; \
|
|
|
|
${SED} ${FILES_SUBST_SED} ../../mk/install/shell; \
|
|
|
|
${ECHO} ""; \
|
2005-08-23 13:48:47 +02:00
|
|
|
set -- dummy ${PKG_SHELL}; shift; \
|
2005-08-19 19:20:33 +02:00
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
shell="$$1"; shift; \
|
|
|
|
shell=`strip_prefix "$$shell"`; \
|
|
|
|
${ECHO} "# SHELL: $$shell"; \
|
2005-07-29 20:32:17 +02:00
|
|
|
done; \
|
|
|
|
${ECHO} "EOF_SHELL"; \
|
|
|
|
${ECHO} " \$${CHMOD} +x ./+SHELL"; \
|
|
|
|
${ECHO} " ;;"; \
|
|
|
|
${ECHO} "esac"; \
|
|
|
|
${ECHO} ""; \
|
|
|
|
${ECHO} "# end of install-shell"; \
|
2005-08-23 12:00:50 +02:00
|
|
|
exec 1>/dev/null; \
|
2005-07-29 20:32:17 +02:00
|
|
|
${MV} -f ${.TARGET}.tmp ${.TARGET}
|
2006-03-10 00:31:51 +01:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
2006-03-11 00:33:57 +01:00
|
|
|
set -- dummy ${_INSTALL_SHELLS_MEMBERS}; shift; \
|
2006-03-10 00:31:51 +01:00
|
|
|
if ${TEST} $$# -eq 0; then \
|
|
|
|
${RM} -f ${.TARGET}; \
|
|
|
|
${TOUCH} ${TOUCH_ARGS} ${.TARGET}; \
|
|
|
|
fi
|
2005-07-29 20:32:17 +02:00
|
|
|
|
2005-12-29 04:44:38 +01:00
|
|
|
# FONTS_DIRS.<type> are lists of directories in which the font databases
|
|
|
|
# are updated. If this is non-empty, then the appropriate tools is
|
|
|
|
# used to update the fonts database for the font type. The supported
|
|
|
|
# types are:
|
|
|
|
#
|
|
|
|
# ttf TrueType fonts
|
|
|
|
# type1 Type1 fonts
|
|
|
|
# x11 Generic X fonts, e.g. PCF, SNF, BDF, etc.
|
|
|
|
#
|
|
|
|
FONTS_DIRS.ttf?= # empty
|
|
|
|
FONTS_DIRS.type1?= # empty
|
|
|
|
FONTS_DIRS.x11?= # empty
|
|
|
|
|
2006-03-11 00:33:57 +01:00
|
|
|
_INSTALL_FONTS_FILE= ${WRKDIR}/.install-fonts
|
|
|
|
_INSTALL_UNPACK_TMPL+= ${_INSTALL_FONTS_FILE}
|
2006-03-11 00:36:08 +01:00
|
|
|
_INSTALL_FONTS_MEMBERS= ${FONTS_DIRS.ttf} ${FONTS_DIRS.type1} ${FONTS_DIRS.x11}
|
2005-12-29 04:44:38 +01:00
|
|
|
|
|
|
|
# Directories with TTF and Type1 fonts also need to run mkfontdir, so
|
|
|
|
# list them as "x11" font directories as well.
|
|
|
|
#
|
|
|
|
.if !empty(FONTS_DIRS.ttf:M*)
|
|
|
|
USE_TOOLS+= ttmkfdir:run
|
|
|
|
FILES_SUBST+= TTMKFDIR=${TOOLS_PATH.ttmkfdir:Q}
|
|
|
|
FONTS_DIRS.x11+= ${FONTS_DIRS.ttf}
|
|
|
|
.endif
|
|
|
|
.if !empty(FONTS_DIRS.type1:M*)
|
|
|
|
USE_TOOLS+= type1inst:run
|
|
|
|
FILES_SUBST+= TYPE1INST=${TOOLS_PATH.type1inst:Q}
|
|
|
|
FONTS_DIRS.x11+= ${FONTS_DIRS.type1}
|
|
|
|
.endif
|
|
|
|
.if !empty(FONTS_DIRS.x11:M*)
|
|
|
|
USE_TOOLS+= mkfontdir:run
|
|
|
|
FILES_SUBST+= MKFONTDIR=${TOOLS_PATH.mkfontdir:Q}
|
|
|
|
.endif
|
|
|
|
|
2006-03-11 00:33:57 +01:00
|
|
|
${_INSTALL_FONTS_FILE}: ../../mk/install/fonts
|
2005-12-29 04:44:38 +01:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${.TARGET} ${.TARGET}.tmp
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
|
|
|
${_FUNC_STRIP_PREFIX}; \
|
|
|
|
exec 1>>${.TARGET}.tmp; \
|
|
|
|
${ECHO} "# start of install-fonts"; \
|
|
|
|
${ECHO} "#"; \
|
|
|
|
${ECHO} "# Generate a +FONTS script that updates fonts databases."; \
|
|
|
|
${ECHO} "#"; \
|
|
|
|
${ECHO} "case \$${STAGE} in"; \
|
|
|
|
${ECHO} "PRE-INSTALL|UNPACK)"; \
|
|
|
|
${ECHO} " \$${CAT} > ./+FONTS << 'EOF_FONTS'"; \
|
|
|
|
${SED} ${FILES_SUBST_SED} ../../mk/install/fonts; \
|
|
|
|
${ECHO} ""; \
|
|
|
|
set -- dummy ${FONTS_DIRS.ttf}; shift; \
|
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
dir="$$1"; shift; \
|
|
|
|
dir=`strip_prefix "$$dir"`; \
|
|
|
|
${ECHO} "# FONTS: $$dir ttf"; \
|
|
|
|
done; \
|
|
|
|
set -- dummy ${FONTS_DIRS.type1}; shift; \
|
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
dir="$$1"; shift; \
|
|
|
|
dir=`strip_prefix "$$dir"`; \
|
|
|
|
${ECHO} "# FONTS: $$dir type1"; \
|
|
|
|
done; \
|
|
|
|
set -- dummy ${FONTS_DIRS.x11}; shift; \
|
|
|
|
while ${TEST} $$# -gt 0; do \
|
|
|
|
dir="$$1"; shift; \
|
|
|
|
dir=`strip_prefix "$$dir"`; \
|
|
|
|
${ECHO} "# FONTS: $$dir x11"; \
|
|
|
|
done; \
|
|
|
|
${ECHO} "EOF_FONTS"; \
|
|
|
|
${ECHO} " \$${CHMOD} +x ./+FONTS"; \
|
|
|
|
${ECHO} " ;;"; \
|
|
|
|
${ECHO} "esac"; \
|
|
|
|
${ECHO} ""; \
|
|
|
|
${ECHO} "# end of install-fonts"; \
|
|
|
|
exec 1>/dev/null; \
|
|
|
|
${MV} -f ${.TARGET}.tmp ${.TARGET}
|
2006-03-10 00:31:51 +01:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
2006-03-11 00:33:57 +01:00
|
|
|
set -- dummy ${_INSTALL_FONTS_MEMBERS}; shift; \
|
2006-03-10 00:31:51 +01:00
|
|
|
if ${TEST} $$# -eq 0; then \
|
|
|
|
${RM} -f ${.TARGET}; \
|
|
|
|
${TOUCH} ${TOUCH_ARGS} ${.TARGET}; \
|
|
|
|
fi
|
2005-12-29 04:44:38 +01:00
|
|
|
|
2002-06-22 04:48:35 +02:00
|
|
|
# PKG_CREATE_USERGROUP indicates whether the INSTALL script should
|
|
|
|
# automatically add any needed users/groups to the system using
|
|
|
|
# useradd/groupadd. It is either YES or NO and defaults to YES.
|
|
|
|
#
|
|
|
|
# PKG_CONFIG indicates whether the INSTALL/DEINSTALL scripts should do
|
|
|
|
# automatic config file and directory handling, or if it should
|
|
|
|
# merely inform the admin of the list of required files and
|
|
|
|
# directories needed to use the package. It is either YES or NO
|
|
|
|
# and defaults to YES.
|
|
|
|
#
|
2002-09-19 12:20:50 +02:00
|
|
|
# PKG_RCD_SCRIPTS indicates whether to automatically install rc.d scripts
|
|
|
|
# to ${RCD_SCRIPTS_DIR}. It is either YES or NO and defaults to
|
|
|
|
# NO. This variable only takes effect if ${PKG_CONFIG} == "YES".
|
|
|
|
#
|
2005-07-29 20:32:17 +02:00
|
|
|
# PKG_REGISTER_SHELLS indicates whether to automatically register shells
|
|
|
|
# in /etc/shells. It is either YES or NO and defaults to YES.
|
|
|
|
#
|
2005-12-29 15:10:01 +01:00
|
|
|
# PKG_UPDATE_FONTS_DB indicates whether to automatically update the fonts
|
|
|
|
# databases in directories where fonts have been installed or
|
|
|
|
# removed. It is either YES or NO and defaults to YES.
|
|
|
|
#
|
2002-06-22 04:48:35 +02:00
|
|
|
# These values merely set the defaults for INSTALL/DEINSTALL scripts, but
|
|
|
|
# they may be overridden by resetting them in the environment.
|
|
|
|
#
|
|
|
|
PKG_CREATE_USERGROUP?= YES
|
|
|
|
PKG_CONFIG?= YES
|
2002-09-19 12:20:50 +02:00
|
|
|
PKG_RCD_SCRIPTS?= NO
|
2005-07-29 20:32:17 +02:00
|
|
|
PKG_REGISTER_SHELLS?= YES
|
2005-12-29 15:10:01 +01:00
|
|
|
PKG_UPDATE_FONTS_DB?= YES
|
2005-12-05 23:07:07 +01:00
|
|
|
FILES_SUBST+= PKG_CREATE_USERGROUP=${PKG_CREATE_USERGROUP:Q}
|
|
|
|
FILES_SUBST+= PKG_CONFIG=${PKG_CONFIG:Q}
|
|
|
|
FILES_SUBST+= PKG_RCD_SCRIPTS=${PKG_RCD_SCRIPTS:Q}
|
|
|
|
FILES_SUBST+= PKG_REGISTER_SHELLS=${PKG_REGISTER_SHELLS:Q}
|
2005-12-29 15:10:01 +01:00
|
|
|
FILES_SUBST+= PKG_UPDATE_FONTS_DB=${PKG_UPDATE_FONTS_DB:Q}
|
2002-11-17 09:58:49 +01:00
|
|
|
|
2002-09-19 11:02:40 +02:00
|
|
|
# Substitute for various programs used in the DEINSTALL/INSTALL scripts and
|
|
|
|
# in the rc.d scripts.
|
|
|
|
#
|
2001-11-19 17:18:44 +01:00
|
|
|
FILES_SUBST+= AWK=${AWK:Q}
|
|
|
|
FILES_SUBST+= BASENAME=${BASENAME:Q}
|
|
|
|
FILES_SUBST+= CAT=${CAT:Q}
|
|
|
|
FILES_SUBST+= CHGRP=${CHGRP:Q}
|
|
|
|
FILES_SUBST+= CHMOD=${CHMOD:Q}
|
|
|
|
FILES_SUBST+= CHOWN=${CHOWN:Q}
|
|
|
|
FILES_SUBST+= CMP=${CMP:Q}
|
|
|
|
FILES_SUBST+= CP=${CP:Q}
|
|
|
|
FILES_SUBST+= DIRNAME=${DIRNAME:Q}
|
|
|
|
FILES_SUBST+= ECHO=${ECHO:Q}
|
2004-04-27 20:31:08 +02:00
|
|
|
FILES_SUBST+= ECHO_N=${ECHO_N:Q}
|
2001-11-19 17:18:44 +01:00
|
|
|
FILES_SUBST+= EGREP=${EGREP:Q}
|
2002-10-05 01:46:26 +02:00
|
|
|
FILES_SUBST+= EXPR=${EXPR:Q}
|
2001-11-19 17:18:44 +01:00
|
|
|
FILES_SUBST+= FALSE=${FALSE:Q}
|
2002-10-08 13:31:24 +02:00
|
|
|
FILES_SUBST+= FIND=${FIND:Q}
|
2001-12-13 07:32:55 +01:00
|
|
|
FILES_SUBST+= GREP=${GREP:Q}
|
2001-11-19 17:18:44 +01:00
|
|
|
FILES_SUBST+= GROUPADD=${GROUPADD:Q}
|
2001-12-11 00:02:17 +01:00
|
|
|
FILES_SUBST+= GTAR=${GTAR:Q}
|
|
|
|
FILES_SUBST+= HEAD=${HEAD:Q}
|
2001-11-19 17:18:44 +01:00
|
|
|
FILES_SUBST+= ID=${ID:Q}
|
2002-03-15 21:08:17 +01:00
|
|
|
FILES_SUBST+= INSTALL_INFO=${INSTALL_INFO:Q}
|
2003-09-02 08:59:37 +02:00
|
|
|
FILES_SUBST+= LINKFARM=${LINKFARM:Q}
|
2001-11-19 17:18:44 +01:00
|
|
|
FILES_SUBST+= LN=${LN:Q}
|
2003-12-20 10:45:55 +01:00
|
|
|
FILES_SUBST+= LS=${LS:Q}
|
2001-11-19 17:18:44 +01:00
|
|
|
FILES_SUBST+= MKDIR=${MKDIR:Q}
|
|
|
|
FILES_SUBST+= MV=${MV:Q}
|
2001-12-09 10:22:29 +01:00
|
|
|
FILES_SUBST+= PERL5=${PERL5:Q}
|
2003-09-17 04:38:22 +02:00
|
|
|
FILES_SUBST+= PKG_ADMIN=${PKG_ADMIN_CMD:Q}
|
|
|
|
FILES_SUBST+= PKG_INFO=${PKG_INFO_CMD:Q}
|
2005-10-28 22:09:38 +02:00
|
|
|
FILES_SUBST+= PW=${PW:Q}
|
2005-01-27 00:15:03 +01:00
|
|
|
FILES_SUBST+= PWD_CMD=${PWD_CMD:Q}
|
2001-11-19 17:18:44 +01:00
|
|
|
FILES_SUBST+= RM=${RM:Q}
|
|
|
|
FILES_SUBST+= RMDIR=${RMDIR:Q}
|
|
|
|
FILES_SUBST+= SED=${SED:Q}
|
2002-01-22 18:46:52 +01:00
|
|
|
FILES_SUBST+= SETENV=${SETENV:Q}
|
2001-11-19 17:18:44 +01:00
|
|
|
FILES_SUBST+= SH=${SH:Q}
|
|
|
|
FILES_SUBST+= SORT=${SORT:Q}
|
2001-11-23 15:37:24 +01:00
|
|
|
FILES_SUBST+= SU=${SU:Q}
|
2003-08-30 20:42:36 +02:00
|
|
|
FILES_SUBST+= TEST=${TEST:Q}
|
2001-11-19 17:18:44 +01:00
|
|
|
FILES_SUBST+= TOUCH=${TOUCH:Q}
|
|
|
|
FILES_SUBST+= TR=${TR:Q}
|
|
|
|
FILES_SUBST+= TRUE=${TRUE:Q}
|
|
|
|
FILES_SUBST+= USERADD=${USERADD:Q}
|
2002-10-08 13:31:24 +02:00
|
|
|
FILES_SUBST+= XARGS=${XARGS:Q}
|
2001-11-19 17:18:44 +01:00
|
|
|
|
|
|
|
FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
|
|
|
|
|
2005-02-05 02:17:59 +01:00
|
|
|
PKG_REFCOUNT_DBDIR?= ${PKG_DBDIR}.refcount
|
|
|
|
|
2002-09-26 23:04:11 +02:00
|
|
|
INSTALL_SCRIPTS_ENV= PKG_PREFIX=${PREFIX}
|
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
|
|
|
INSTALL_SCRIPTS_ENV+= PKG_METADATA_DIR=${_PKG_DBDIR}/${PKGNAME}
|
2005-02-05 02:17:59 +01:00
|
|
|
INSTALL_SCRIPTS_ENV+= PKG_REFCOUNT_DBDIR=${PKG_REFCOUNT_DBDIR}
|
2002-09-26 23:04:11 +02:00
|
|
|
|
2003-09-06 13:41:31 +02:00
|
|
|
.PHONY: pre-install-script post-install-script
|
|
|
|
|
2006-03-10 00:31:51 +01:00
|
|
|
# This section is the only part that hooks into the INSTALL/DEINSTALL
|
|
|
|
# script logic in bsd.pkg.mk
|
|
|
|
#
|
|
|
|
.if !empty(_USE_PKGINSTALL:M[yY][eE][sS])
|
2006-03-10 23:23:02 +01:00
|
|
|
. if !empty(DEINSTALL_SRC)
|
2006-03-10 00:31:51 +01:00
|
|
|
DEINSTALL_FILE= ${PKG_DB_TMPDIR}/+DEINSTALL
|
2006-03-10 23:23:02 +01:00
|
|
|
. endif
|
|
|
|
. if !empty(INSTALL_SRC)
|
2006-03-10 00:31:51 +01:00
|
|
|
INSTALL_FILE= ${PKG_DB_TMPDIR}/+INSTALL
|
2006-03-10 23:23:02 +01:00
|
|
|
. endif
|
2006-03-10 00:31:51 +01:00
|
|
|
|
2001-12-02 04:11:35 +01:00
|
|
|
pre-install-script: generate-install-scripts
|
2005-01-23 21:45:22 +01:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}cd ${PKG_DB_TMPDIR} && \
|
|
|
|
${SETENV} ${INSTALL_SCRIPTS_ENV} \
|
2002-09-26 23:04:11 +02:00
|
|
|
${_PKG_DEBUG_SCRIPT} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL
|
2001-11-19 17:18:44 +01:00
|
|
|
|
2003-09-06 13:43:55 +02:00
|
|
|
post-install-script:
|
2005-01-23 21:45:22 +01:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}cd ${PKG_DB_TMPDIR} && \
|
|
|
|
${SETENV} ${INSTALL_SCRIPTS_ENV} \
|
2002-09-26 23:04:11 +02:00
|
|
|
${_PKG_DEBUG_SCRIPT} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
|
2006-03-10 00:31:51 +01:00
|
|
|
.endif
|
2001-12-02 04:11:35 +01:00
|
|
|
|
2003-09-06 13:41:31 +02:00
|
|
|
.PHONY: generate-install-scripts
|
2002-10-20 11:10:42 +02:00
|
|
|
post-build: generate-install-scripts
|
|
|
|
generate-install-scripts: # do nothing
|
|
|
|
|
|
|
|
.if !empty(DEINSTALL_SRC)
|
|
|
|
generate-install-scripts: ${DEINSTALL_FILE}
|
|
|
|
${DEINSTALL_FILE}: ${DEINSTALL_SRC}
|
2005-01-23 21:45:22 +01:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
|
2002-10-20 11:10:42 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} | \
|
|
|
|
${SED} ${FILES_SUBST_SED} > ${.TARGET}
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !empty(INSTALL_SRC)
|
|
|
|
generate-install-scripts: ${INSTALL_FILE}
|
|
|
|
${INSTALL_FILE}: ${INSTALL_SRC}
|
2005-01-23 21:45:22 +01:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
|
2002-10-20 11:10:42 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} | \
|
|
|
|
${SED} ${FILES_SUBST_SED} > ${.TARGET}
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
|
|
|
|
.endif
|
2001-11-19 17:18:44 +01:00
|
|
|
|
2002-09-19 11:02:40 +02:00
|
|
|
# rc.d scripts are automatically generated and installed into the rc.d
|
|
|
|
# scripts example directory at the post-install step. The following
|
|
|
|
# variables are relevent to this process:
|
|
|
|
#
|
|
|
|
# RCD_SCRIPTS lists the basenames of the rc.d scripts
|
|
|
|
#
|
|
|
|
# RCD_SCRIPT_SRC.<script> the source file for <script>; this will
|
|
|
|
# be run through FILES_SUBST to generate
|
2004-10-12 00:04:19 +02:00
|
|
|
# the rc.d script (defaults to
|
|
|
|
# ${FILESDIR}/<script>.sh)
|
2002-09-19 11:02:40 +02:00
|
|
|
#
|
|
|
|
# If the source rc.d script is not present, then the automatic handling
|
|
|
|
# doesn't occur.
|
|
|
|
|
2003-09-06 13:41:31 +02:00
|
|
|
.PHONY: generate-rcd-scripts
|
2002-10-20 06:11:39 +02:00
|
|
|
post-build: generate-rcd-scripts
|
2002-09-19 11:02:40 +02:00
|
|
|
generate-rcd-scripts: # do nothing
|
2003-09-06 13:41:31 +02:00
|
|
|
|
|
|
|
.PHONY: install-rcd-scripts
|
2003-09-06 13:43:55 +02:00
|
|
|
post-install: install-rcd-scripts
|
2002-09-19 11:02:40 +02:00
|
|
|
install-rcd-scripts: # do nothing
|
|
|
|
|
|
|
|
.for _script_ in ${RCD_SCRIPTS}
|
|
|
|
RCD_SCRIPT_SRC.${_script_}?= ${FILESDIR}/${_script_}.sh
|
2003-07-31 12:36:03 +02:00
|
|
|
RCD_SCRIPT_WRK.${_script_}?= ${WRKDIR}/${_script_}
|
2002-09-19 11:02:40 +02:00
|
|
|
|
2002-10-20 06:11:39 +02:00
|
|
|
. if !empty(RCD_SCRIPT_SRC.${_script_})
|
|
|
|
. if exists(${RCD_SCRIPT_SRC.${_script_}})
|
2003-07-31 12:36:03 +02:00
|
|
|
generate-rcd-scripts: ${RCD_SCRIPT_WRK.${_script_}}
|
|
|
|
${RCD_SCRIPT_WRK.${_script_}}: ${RCD_SCRIPT_SRC.${_script_}}
|
2004-10-12 00:04:19 +02:00
|
|
|
@${ECHO_MSG} "${_PKGSRC_IN}> Creating ${.TARGET}"
|
2002-10-20 06:11:39 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} | \
|
|
|
|
${SED} ${FILES_SUBST_SED} > ${.TARGET}
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
|
2002-09-19 11:02:40 +02:00
|
|
|
|
|
|
|
install-rcd-scripts: install-rcd-${_script_}
|
2003-07-31 12:36:03 +02:00
|
|
|
install-rcd-${_script_}: ${RCD_SCRIPT_WRK.${_script_}}
|
2002-09-19 11:02:40 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
2003-07-31 12:36:03 +02:00
|
|
|
if [ -f ${RCD_SCRIPT_WRK.${_script_}} ]; then \
|
2005-07-29 23:41:04 +02:00
|
|
|
${MKDIR} ${PREFIX}/${RCD_SCRIPTS_EXAMPLEDIR}; \
|
2003-07-31 12:36:03 +02:00
|
|
|
${INSTALL_SCRIPT} ${RCD_SCRIPT_WRK.${_script_}} \
|
2004-10-12 00:04:19 +02:00
|
|
|
${PREFIX}/${RCD_SCRIPTS_EXAMPLEDIR}/${_script_}; \
|
2002-09-19 11:02:40 +02:00
|
|
|
fi
|
2002-10-20 06:11:39 +02:00
|
|
|
. endif
|
|
|
|
. endif
|
2002-09-19 11:02:40 +02:00
|
|
|
.endfor
|