diff options
author | khorben <khorben@pkgsrc.org> | 2021-05-30 23:41:05 +0000 |
---|---|---|
committer | khorben <khorben@pkgsrc.org> | 2021-05-30 23:41:05 +0000 |
commit | a23037528d3587738b5237f047a92284b1b3c49e (patch) | |
tree | 566140424c85144e11dab1e58d0b2c29f24b5f8d /mk | |
parent | 6bbcce1c8f10290754442ef145afa0928194fad4 (diff) | |
download | pkgsrc-a23037528d3587738b5237f047a92284b1b3c49e.tar.gz |
Introduce a new SYSCONFBASE variable (defaults to /etc)
This is part 1 to support additional platforms with the RC scripts provided in
pkgsrc, in privileged as well as in unprivileged mode, including on NetBSD
(with part 2 in pkgtools/rc.subr).
This variable is meant to point to the configuration directory of the base
system (as opposed to pkgsrc's own prefix) when it should be used by pkgsrc in
special cases (e.g. installing RC scripts), or to point to the existing
PKG_SYSCONFBASE directory otherwise (e.g. for any unprivileged bootstrap).
This teaches pkgsrc where the RC scripts should be installed, and more
importantly, where the local copy of rc.subr can be expected. Part 3 will
progressively update each and every RC script to substitute this path as
expected.
No functional changes are intended in privileged mode without a bootstrap. The
only variable affected by this change directly is RCD_SCRIPTS_DIR, which
currently remains with the same default of /etc/rc.d, and can be overridden as
before.
When bootstrapping, SYSCONFBASE also remains with the existing default when no
prefix is set or is "/usr/pkg" or "/usr"; it is set to $prefix/etc otherwise. It
can be specified specifically with --sysconfbase if necessary.
Existing installations or bootstraps are not affected, as this change needs
setting SYSCONFBASE in the corresponding $sysconfdir/mk.conf to have an impact.
Tested in privileged and unprivileged modes on NetBSD/amd64, and unprivileged
mode on Darwin/amd64; submitted for review on tech-pkg@.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/defaults/mk.conf | 12 | ||||
-rw-r--r-- | mk/pkginstall/bsd.pkginstall.mk | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/mk/defaults/mk.conf b/mk/defaults/mk.conf index c8b246b6e46..b7df6532331 100644 --- a/mk/defaults/mk.conf +++ b/mk/defaults/mk.conf @@ -1,4 +1,4 @@ -# $NetBSD: mk.conf,v 1.317 2021/01/15 19:47:33 schmonz Exp $ +# $NetBSD: mk.conf,v 1.318 2021/05/30 23:41:05 khorben Exp $ # # This file provides default values for variables that may be overridden @@ -489,6 +489,12 @@ PKG_RESUME_TRANSFERS?= NO # Possible: yes or no. # Default: no. +SYSCONFBASE?= /etc +# This is the config directory under which system configuration files are +# expected. +# Possible: any path you like +# Default: /etc + PKG_SYSCONFBASE?= ${PREFIX}/etc # This is the main config directory under which all package configuration # files should be found. @@ -500,12 +506,12 @@ PKG_SYSCONFBASE?= ${PREFIX}/etc # Possible: any of: rc.d, smf # Default: Platform-dependent, otherwise rc.d -RCD_SCRIPTS_DIR?= /etc/rc.d +RCD_SCRIPTS_DIR?= ${SYSCONFBASE}/rc.d # This is the system rc.d script directory in which all rc.d scripts # expected to be executed at boot-time should be found. Package views # users may want to set this to "${PKG_SYSCONFBASEDIR}/rc.d". # Possible: any path you like -# Default: /etc/rc.d +# Default: ${SYSCONFBASE}/rc.d PACKAGES?= ${PKGSRCDIR}/packages # Stores generated packages diff --git a/mk/pkginstall/bsd.pkginstall.mk b/mk/pkginstall/bsd.pkginstall.mk index a6df693effc..3558f92c749 100644 --- a/mk/pkginstall/bsd.pkginstall.mk +++ b/mk/pkginstall/bsd.pkginstall.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkginstall.mk,v 1.74 2020/05/09 16:48:57 rillig Exp $ +# $NetBSD: bsd.pkginstall.mk,v 1.75 2021/05/30 23:41:05 khorben Exp $ # # This Makefile fragment is included by bsd.pkg.mk and implements the # common INSTALL/DEINSTALL scripts framework. To use the pkginstall @@ -146,6 +146,7 @@ INSTALL_SRC?= ${_INSTALL_TEMPLATES} # FILES_SUBST+= PREFIX=${PREFIX:Q} FILES_SUBST+= LOCALBASE=${LOCALBASE:Q} +FILES_SUBST+= SYSCONFBASE=${SYSCONFBASE:Q} FILES_SUBST+= X11BASE=${X11BASE:Q} FILES_SUBST+= VARBASE=${VARBASE:Q} FILES_SUBST+= PKG_SYSCONFBASE=${PKG_SYSCONFBASE:Q} |