diff options
author | jlam <jlam@pkgsrc.org> | 2003-09-05 11:34:25 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2003-09-05 11:34:25 +0000 |
commit | 19fd2859c5aa1414fac54458a83d8fea60985c02 (patch) | |
tree | 44709d065bffeb4880702cf53263d326c5eb8ddf /mk | |
parent | 7a88ff7cda72835e9cf1153a74ff25aaef2adb54 (diff) | |
download | pkgsrc-19fd2859c5aa1414fac54458a83d8fea60985c02.tar.gz |
Package Makefiles should refer to PKG_SYSCONFBASEDIR instead of
PKG_SYSCONFBASE when they want PKG_SYSCONFDIR stripped of
PKG_SYSCONFSUBDIR. This makes PKG_SYSCONFBASE=/etc work with pkgviews by
installing all config files into /etc/packages/<pkg> instead of
occasionally putting some directly into /etc.
Also only create PKG_SYSCONFDIR if we're actually going to copy config
files.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.install.mk | 10 | ||||
-rw-r--r-- | mk/bsd.pkg.mk | 13 | ||||
-rw-r--r-- | mk/install/deinstall | 6 | ||||
-rw-r--r-- | mk/install/header | 4 | ||||
-rw-r--r-- | mk/install/install | 30 |
5 files changed, 33 insertions, 30 deletions
diff --git a/mk/bsd.pkg.install.mk b/mk/bsd.pkg.install.mk index 6414c938dc4..65e9968fbcc 100644 --- a/mk/bsd.pkg.install.mk +++ b/mk/bsd.pkg.install.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.install.mk,v 1.46 2003/09/02 06:59:41 jlam Exp $ +# $NetBSD: bsd.pkg.install.mk,v 1.47 2003/09/05 11:34:25 jlam Exp $ # # This Makefile fragment is included by package Makefiles to use the common # INSTALL/DEINSTALL scripts. To use this Makefile fragment, simply: @@ -62,9 +62,9 @@ INSTALL_SRC?= ${INSTALL_TEMPLATES} FILES_SUBST+= PREFIX=${PREFIX} FILES_SUBST+= LOCALBASE=${LOCALBASE} FILES_SUBST+= X11BASE=${X11BASE} -FILES_SUBST+= PKG_SYSCONFBASE=${_PKG_SYSCONFBASE} FILES_SUBST+= PKG_SYSCONFDEPOTBASE=${PKG_SYSCONFDEPOTBASE} FILES_SUBST+= PKG_SYSCONFVIEWBASE=${PKG_SYSCONFVIEWBASE} +FILES_SUBST+= PKG_SYSCONFBASEDIR=${PKG_SYSCONFBASEDIR} FILES_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR} FILES_SUBST+= PKGBASE=${PKGBASE} FILES_SUBST+= PKG_INSTALLATION_TYPE=${PKG_INSTALLATION_TYPE} @@ -172,8 +172,7 @@ MESSAGE_SUBST+= RCD_SCRIPTS_DIR=${RCD_SCRIPTS_DIR} # 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 -# isn't empty. For convenience, ${PKG_SYSCONFDIR} is automatically -# added to MAKE_DIRS. +# isn't empty. # # OWN_DIRS_PERMS contains a list of "directory owner group mode" sublists # representing directories for this package that should be @@ -183,10 +182,9 @@ MESSAGE_SUBST+= RCD_SCRIPTS_DIR=${RCD_SCRIPTS_DIR} # MAKE_DIRS?= # empty MAKE_DIRS_PERMS?= # empty -_MAKE_DIRS= ${PKG_SYSCONFDIR} ${MAKE_DIRS} OWN_DIRS?= # empty OWN_DIRS_PERMS?= # empty -FILES_SUBST+= MAKE_DIRS=${_MAKE_DIRS:Q} +FILES_SUBST+= MAKE_DIRS=${MAKE_DIRS:Q} FILES_SUBST+= MAKE_DIRS_PERMS=${MAKE_DIRS_PERMS:Q} FILES_SUBST+= OWN_DIRS=${OWN_DIRS:Q} FILES_SUBST+= OWN_DIRS_PERMS=${OWN_DIRS_PERMS:Q} diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index b58ece4e17b..765aa2478d7 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.1259 2003/09/05 09:44:34 jlam Exp $ +# $NetBSD: bsd.pkg.mk,v 1.1260 2003/09/05 11:34:26 jlam Exp $ # # This file is in the public domain. # @@ -1244,6 +1244,7 @@ PKG_SYSCONFVAR?= ${PKGBASE} PKG_SYSCONFBASE?= ${PREFIX}/etc .if defined(PKG_SYSCONFDIR.${PKG_SYSCONFVAR}) PKG_SYSCONFDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}} +PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}} PKG_SYSCONFDEPOTBASE= # empty PKG_SYSCONFVIEWBASE= # empty .else @@ -1251,22 +1252,22 @@ PKG_SYSCONFSUBDIR?= # empty . if ${PKG_INSTALLATION_TYPE} == "overwrite" PKG_SYSCONFDEPOTBASE= # empty PKG_SYSCONFVIEWBASE= # empty -_PKG_SYSCONFBASE= ${PKG_SYSCONFBASE} +PKG_SYSCONFBASEDIR= ${PKG_SYSCONFBASE} . else PKG_SYSCONFVIEWBASE= ${PKG_SYSCONFBASE} . if !empty(PKG_SYSCONFBASE:M${PREFIX}) || \ !empty(PKG_SYSCONFBASE:M${PREFIX}/*) PKG_SYSCONFDEPOTBASE= # empty -_PKG_SYSCONFBASE= ${PKG_SYSCONFBASE} +PKG_SYSCONFBASEDIR= ${PKG_SYSCONFBASE} . else PKG_SYSCONFDEPOTBASE= ${PKG_SYSCONFBASE}/${DEPOT_SUBDIR} -_PKG_SYSCONFBASE= ${PKG_SYSCONFDEPOTBASE}/${PKGNAME} +PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDEPOTBASE}/${PKGNAME} . endif . endif . if empty(PKG_SYSCONFSUBDIR) -PKG_SYSCONFDIR= ${_PKG_SYSCONFBASE} +PKG_SYSCONFDIR= ${PKG_SYSCONFBASEDIR} . else -PKG_SYSCONFDIR= ${_PKG_SYSCONFBASE}/${PKG_SYSCONFSUBDIR} +PKG_SYSCONFDIR= ${PKG_SYSCONFBASEDIR}/${PKG_SYSCONFSUBDIR} . endif .endif diff --git a/mk/install/deinstall b/mk/install/deinstall index 470c5ffc811..90d2ee3afda 100644 --- a/mk/install/deinstall +++ b/mk/install/deinstall @@ -1,6 +1,6 @@ # start of deinstall # -# $NetBSD: deinstall,v 1.18 2003/09/02 07:00:06 jlam Exp $ +# $NetBSD: deinstall,v 1.19 2003/09/05 11:34:27 jlam Exp $ eval set -- ${PKG_USERS} for userset; do @@ -45,7 +45,7 @@ while [ $# -gt 0 ]; do VIEW_FILES="${VIEW_FILES} \"${file}\"" done -eval set -- ${RCD_SCRIPTS_DIR} ${MAKE_DIRS} +eval set -- ${PKG_SYSCONFDIR} ${RCD_SCRIPTS_DIR} ${MAKE_DIRS} for dir; do ALL_MAKE_DIRS="${ALL_MAKE_DIRS} \"${dir}\"" done @@ -171,7 +171,7 @@ POST-DEINSTALL) # Don't bother the admin about the following dirs # if they still exist. # - ${PKG_SYSCONFBASE}|${RCD_SCRIPTS_DIR}) + ${PKG_SYSCONFBASEDIR}|${RCD_SCRIPTS_DIR}) ;; *) if [ -d "${dir}" ]; then diff --git a/mk/install/header b/mk/install/header index a6bc0ee4692..cdf22c6c06c 100644 --- a/mk/install/header +++ b/mk/install/header @@ -2,7 +2,7 @@ # # start of header # -# $NetBSD: header,v 1.19 2003/09/02 07:00:07 jlam Exp $ +# $NetBSD: header,v 1.20 2003/09/05 11:34:27 jlam Exp $ PKGNAME=$1 STAGE=$2 @@ -66,9 +66,9 @@ MAKE_DIRS_PERMS="@MAKE_DIRS_PERMS@" OWN_DIRS="@OWN_DIRS@" OWN_DIRS_PERMS="@OWN_DIRS_PERMS@" -PKG_SYSCONFBASE="@PKG_SYSCONFBASE@" PKG_SYSCONFDEPOTBASE="@PKG_SYSCONFDEPOTBASE@" PKG_SYSCONFVIEWBASE="@PKG_SYSCONFVIEWBASE@" +PKG_SYSCONFBASEDIR="@PKG_SYSCONFBASEDIR@" PKG_SYSCONFDIR="@PKG_SYSCONFDIR@" PKG_REGISTER_SHELLS="@PKG_REGISTER_SHELLS@" diff --git a/mk/install/install b/mk/install/install index d3a3505a9b0..4bfe4a38ffe 100644 --- a/mk/install/install +++ b/mk/install/install @@ -1,6 +1,20 @@ # start of install # -# $NetBSD: install,v 1.21 2003/09/02 07:00:07 jlam Exp $ +# $NetBSD: install,v 1.22 2003/09/05 11:34:27 jlam Exp $ + +if [ -z "${CONF_FILES}" -a -z "${CONF_FILES_PERMS}" -a \ + -z "${SUPPORT_FILES}" -a -z "${SUPPORT_FILES_PERMS}" -o \ + "${_PKG_CONFIG}" = "NO" ]; then + : +else + MAKE_DIRS="${MAKE_DIRS} \"${PKG_SYSCONFDIR}\"" +fi + +if [ -z "${RCD_SCRIPTS}" -o "${_PKG_RCD_SCRIPTS}" = "NO" ]; then + : +else + MAKE_DIRS="${MAKE_DIRS} \"${RCD_SCRIPTS_DIR}\"" +fi case ${STAGE} in PRE-INSTALL) @@ -96,12 +110,7 @@ PRE-INSTALL) # if [ -n "${MAKE_DIRS}" -o -n "${OWN_DIRS}" -o \ -n "${MAKE_DIRS_PERMS}" -o -n "${OWN_DIRS_PERMS}" ]; then - if [ -z "${RCD_SCRIPTS}" -o "${_PKG_RCD_SCRIPTS}" = "NO" ]; then - _RCD_SCRIPTS_DIR= - else - _RCD_SCRIPTS_DIR="${RCD_SCRIPTS_DIR}" - fi - eval set -- ${_RCD_SCRIPTS_DIR} ${MAKE_DIRS} ${OWN_DIRS} + eval set -- ${MAKE_DIRS} ${OWN_DIRS} for dir; do if [ -d "${dir}" ]; then continue @@ -159,12 +168,7 @@ POST-INSTALL) if [ -n "${MAKE_DIRS}" -o -n "${OWN_DIRS}" -o \ -n "${MAKE_DIRS_PERMS}" -o -n "${OWN_DIRS_PERMS}" ]; then _print_dir_header=1 - if [ -z "${RCD_SCRIPTS}" -o "${_PKG_RCD_SCRIPTS}" = "NO" ]; then - _RCD_SCRIPTS_DIR= - else - _RCD_SCRIPTS_DIR="${RCD_SCRIPTS_DIR}" - fi - eval set -- ${_RCD_SCRIPTS_DIR} ${MAKE_DIRS} ${OWN_DIRS} + eval set -- ${MAKE_DIRS} ${OWN_DIRS} for dir; do if [ -d "${dir}" ]; then continue |