pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/pkgtools/rc.subr



Module Name:    pkgsrc
Committed By:   khorben
Date:           Sun May 30 23:46:26 UTC 2021

Modified Files:
        pkgsrc/pkgtools/rc.subr: Makefile PLIST
        pkgsrc/pkgtools/rc.subr/files: rc.conf.example rc.subr

Log Message:
rc.subr: update to version 20210517

This is part 2 to support additional platforms with the RC scripts provided in
pkgsrc, in privileged as well as in unprivileged mode, including on NetBSD.

These changes:
- install rc.subr to PKG_SYSCONFDIR if SYSCONFBASE is not /etc
- let RC scripts source rc.subr in PKG_SYSCONFDIR
- effectively allow unprivileged setups to run RC scripts easily
- in addition, give a chance for more platforms to run RC scripts

Tested in privileged and unprivileged modes on NetBSD/amd64, and unprivileged
mode on Darwin/amd64; submitted for review on tech-pkg@.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 pkgsrc/pkgtools/rc.subr/Makefile
cvs rdiff -u -r1.4 -r1.5 pkgsrc/pkgtools/rc.subr/PLIST
cvs rdiff -u -r1.2 -r1.3 pkgsrc/pkgtools/rc.subr/files/rc.conf.example
cvs rdiff -u -r1.16 -r1.17 pkgsrc/pkgtools/rc.subr/files/rc.subr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/rc.subr/Makefile
diff -u pkgsrc/pkgtools/rc.subr/Makefile:1.34 pkgsrc/pkgtools/rc.subr/Makefile:1.35
--- pkgsrc/pkgtools/rc.subr/Makefile:1.34       Sun Mar 22 13:21:05 2020
+++ pkgsrc/pkgtools/rc.subr/Makefile    Sun May 30 23:46:26 2021
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.34 2020/03/22 13:21:05 tnn Exp $
+# $NetBSD: Makefile,v 1.35 2021/05/30 23:46:26 khorben Exp $
 #
 
-PKGNAME=               rc.subr-20181226
+PKGNAME=               rc.subr-20210517
 CATEGORIES=            pkgtools
 
 MAINTAINER=            sbd%NetBSD.org@localhost
@@ -10,27 +10,34 @@ COMMENT=            Portable NetBSD rc.subr implem
 LICENSE=               original-bsd
 
 ONLY_FOR_PLATFORM=     Darwin-*-* FreeBSD-[0-4].*-* Interix-*-* IRIX*-*-*
-ONLY_FOR_PLATFORM+=    Linux-*-* OpenBSD-*-* QNX-*-* SunOS-*-*
+ONLY_FOR_PLATFORM+=    Linux-*-* NetBSD-*-* OpenBSD-*-* QNX-*-* SunOS-*-*
 
 NO_BUILD=              yes
 NO_CONFIGURE=          yes
-NOT_FOR_UNPRIVILEGED=  yes
 
 CHECK_FILES_SUPPORTED= no
+BUILD_DEFS+=           SYSCONFBASE
 BUILD_DEFS+=           RCD_SCRIPTS_DIR
 
+
+SUBST_CLASSES+=                subr
+SUBST_STAGE.subr=      post-extract
+SUBST_FILES.subr=      rc.subr
+SUBST_VARS.subr=       SYSCONFBASE
+
+PLIST_SUBST+=          SYSCONFBASE=${SYSCONFBASE:S/^\///}
 PLIST_SUBST+=          RCD_SCRIPTS_DIR=${RCD_SCRIPTS_DIR:S/^\///}
 
-CONF_FILES+=           etc/rc.conf.example etc/rc.conf
+CONF_FILES+=           ${SYSCONFBASE:S/^\///}/rc.conf.example ${SYSCONFBASE:S/^\///}/rc.conf
 
-INSTALLATION_DIRS=     etc ${RCD_SCRIPTS_DIR:S/^\///}
+INSTALLATION_DIRS=     ${SYSCONFBASE:S/^\///} ${RCD_SCRIPTS_DIR:S/^\///}
 
 do-extract:
        ${CP} -R ${FILESDIR} ${WRKSRC}
 
 do-install:
-       ${INSTALL_DATA} ${WRKSRC}/rc.conf.example ${DESTDIR}${PREFIX}etc/rc.conf.example
-       ${INSTALL_DATA} ${WRKSRC}/rc.subr ${DESTDIR}${PREFIX}etc/rc.subr
+       ${INSTALL_DATA} ${WRKSRC}/rc.conf.example ${DESTDIR}${PREFIX}${SYSCONFBASE}/rc.conf.example
+       ${INSTALL_DATA} ${WRKSRC}/rc.subr ${DESTDIR}${PREFIX}${SYSCONFBASE}/rc.subr
        ${INSTALL_SCRIPT} ${WRKSRC}/rc.d/DAEMON ${DESTDIR}${PREFIX}${RCD_SCRIPTS_DIR}
        ${INSTALL_SCRIPT} ${WRKSRC}/rc.d/LOGIN ${DESTDIR}${PREFIX}${RCD_SCRIPTS_DIR}
        ${INSTALL_SCRIPT} ${WRKSRC}/rc.d/NETWORKING ${DESTDIR}${PREFIX}${RCD_SCRIPTS_DIR}

Index: pkgsrc/pkgtools/rc.subr/PLIST
diff -u pkgsrc/pkgtools/rc.subr/PLIST:1.4 pkgsrc/pkgtools/rc.subr/PLIST:1.5
--- pkgsrc/pkgtools/rc.subr/PLIST:1.4   Wed Jun  4 13:34:46 2008
+++ pkgsrc/pkgtools/rc.subr/PLIST       Sun May 30 23:46:26 2021
@@ -1,6 +1,6 @@
-@comment $NetBSD: PLIST,v 1.4 2008/06/04 13:34:46 sketch Exp $
-etc/rc.conf.example
-etc/rc.subr
+@comment $NetBSD: PLIST,v 1.5 2021/05/30 23:46:26 khorben Exp $
+${SYSCONFBASE}/rc.conf.example
+${SYSCONFBASE}/rc.subr
 ${RCD_SCRIPTS_DIR}/DAEMON
 ${RCD_SCRIPTS_DIR}/LOGIN
 ${RCD_SCRIPTS_DIR}/NETWORKING

Index: pkgsrc/pkgtools/rc.subr/files/rc.conf.example
diff -u pkgsrc/pkgtools/rc.subr/files/rc.conf.example:1.2 pkgsrc/pkgtools/rc.subr/files/rc.conf.example:1.3
--- pkgsrc/pkgtools/rc.subr/files/rc.conf.example:1.2   Mon Jun 23 07:02:16 2003
+++ pkgsrc/pkgtools/rc.subr/files/rc.conf.example       Sun May 30 23:46:26 2021
@@ -1,6 +1,4 @@
-#      $NetBSD: rc.conf.example,v 1.2 2003/06/23 07:02:16 grant Exp $
-#
-# see rc.conf(5) for more information.
+#      $NetBSD: rc.conf.example,v 1.3 2021/05/30 23:46:26 khorben Exp $
 #
 # Use program=YES to enable program, NO to disable it. program_flags are
 # passed to the program on the command line.

Index: pkgsrc/pkgtools/rc.subr/files/rc.subr
diff -u pkgsrc/pkgtools/rc.subr/files/rc.subr:1.16 pkgsrc/pkgtools/rc.subr/files/rc.subr:1.17
--- pkgsrc/pkgtools/rc.subr/files/rc.subr:1.16  Fri Oct 11 11:56:06 2019
+++ pkgsrc/pkgtools/rc.subr/files/rc.subr       Sun May 30 23:46:26 2021
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.16 2019/10/11 11:56:06 triaxx Exp $
+# $NetBSD: rc.subr,v 1.17 2021/05/30 23:46:26 khorben Exp $
 #
 # Copyright (c) 1997-2002 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -34,6 +34,7 @@
 #      global variables
 #      ----------------
 
+sysconfbase=@SYSCONFBASE@
 _RCCMD_chown="/usr/sbin/chown"
 _RCCMD_chroot="/usr/sbin/chroot"
 _RCCMD_ci="/usr/bin/ci"
@@ -857,14 +858,14 @@ load_rc_config()
        if ${_rc_conf_loaded:-false}; then
                :
        else
-               . /etc/rc.conf
+               . ${sysconfbase}/rc.conf
                _rc_conf_loaded=true
        fi
-       if [ "$_osname" = "OpenBSD" ] && [ -f /etc/rc.conf.local ]; then
-               . /etc/rc.conf.local
+       if [ "$_osname" = "OpenBSD" ] && [ -f ${sysconfbase}/rc.conf.local ]; then
+               . ${sysconfbase}/rc.conf.local
        fi
-       if [ -f /etc/rc.conf.d/"$_command" ]; then
-               . /etc/rc.conf.d/"$_command"
+       if [ -f ${sysconfbase}/rc.conf.d/"$_command" ]; then
+               . ${sysconfbase}/rc.conf.d/"$_command"
        fi
 }
 



Home | Main Index | Thread Index | Old Index