diff options
author | jlam <jlam@pkgsrc.org> | 2006-04-26 05:58:44 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2006-04-26 05:58:44 +0000 |
commit | b01f35bb3398ff1d3332b4b4c1ecdc7a76c473c8 (patch) | |
tree | 481098f813f02fc85921fce4b04505133083dda3 /mk | |
parent | 98f4a974a5386d318c8c607164f38ea8042cf7a8 (diff) | |
download | pkgsrc-b01f35bb3398ff1d3332b4b4c1ecdc7a76c473c8.tar.gz |
Allow a package to specify the ownership and permission on
${PKG_SYSCONFDIR} if PKG_SYSCONFSUBDIR is defined and non-empty. A
package may now set PKG_SYSCONFDIR_PERMS to an "owner group mode"
triplet, which defaults to "${ROOT_USER} ${ROOT_GROUP} 755".
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.mk | 3 | ||||
-rw-r--r-- | mk/install/bsd.pkginstall.mk | 18 |
2 files changed, 17 insertions, 4 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index df741ed06d5..7df9150b26e 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.1819 2006/04/24 20:19:03 dillo Exp $ +# $NetBSD: bsd.pkg.mk,v 1.1820 2006/04/26 05:58:44 jlam Exp $ # # This file is in the public domain. # @@ -655,6 +655,7 @@ PKG_SYSCONFDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}} PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}} PKG_SYSCONFDEPOTBASE= # empty .endif +PKG_SYSCONFDIR_PERMS?= ${ROOT_USER} ${ROOT_GROUP} 755 ALL_ENV+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q} BUILD_DEFS+= PKG_SYSCONFBASEDIR PKG_SYSCONFDIR diff --git a/mk/install/bsd.pkginstall.mk b/mk/install/bsd.pkginstall.mk index 8fe7f52ccd3..80a08b0fdb5 100644 --- a/mk/install/bsd.pkginstall.mk +++ b/mk/install/bsd.pkginstall.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkginstall.mk,v 1.49 2006/04/25 22:32:44 jlam Exp $ +# $NetBSD: bsd.pkginstall.mk,v 1.50 2006/04/26 05:58:47 jlam Exp $ # # This Makefile fragment is included by bsd.pkg.mk and implements the # common INSTALL/DEINSTALL scripts framework. To use the pkginstall @@ -489,11 +489,23 @@ ${_INSTALL_DIRS_DATAFILE}: ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${.TARGET} ${.TARGET}.tmp ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET}.tmp - ${_PKG_SILENT}${_PKG_DEBUG} \ + ${_PKG_SILENT}${_PKG_DEBUG}${_FUNC_STRIP_PREFIX}; \ exec 1>>${.TARGET}.tmp; \ case ${PKG_SYSCONFSUBDIR:M*:Q}${CONF_FILES:M*:Q}${CONF_FILES_PERMS:M*:Q}"" in \ "") ;; \ - *) ${ECHO} "# DIR: ${PKG_SYSCONFDIR:S/${PREFIX}\///} m" ;; \ + *) case ${PKG_SYSCONFSUBDIR:M*:Q}"" in \ + "") ${ECHO} "# DIR: ${PKG_SYSCONFDIR:S/${PREFIX}\///} m" ;; \ + *) set -- dummy ${PKG_SYSCONFDIR} ${PKG_SYSCONFDIR_PERMS}; shift; \ + while ${TEST} $$# -gt 0; do \ + dir="$$1"; owner="$$2"; \ + group="$$3"; mode="$$4"; \ + shift; shift; shift; shift; \ + dir=`strip_prefix "$$dir"`; \ + ${ECHO} "# DIR: $$dir m $$mode $$owner $$group"; \ + done; \ + ;; \ + esac; \ + ;; \ esac ${_PKG_SILENT}${_PKG_DEBUG} \ exec 1>>${.TARGET}.tmp; \ |