pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/rc.d-boot



Module Name:    pkgsrc
Committed By:   triaxx
Date:           Sat Dec 17 21:36:11 UTC 2022

Modified Files:
        pkgsrc/pkgtools/rc.d-boot: DEINSTALL INSTALL Makefile
        pkgsrc/pkgtools/rc.d-boot/files: rc.d-boot

Log Message:
rc.d-boot: Fix for unprivileged users on Darwin

pkgsrc changes:
---------------
  * Replace hardcoded /etc with ${PKG_SYSCONFDIR} to find rc.d scripts installed
    by unprivileged users.
  * For unprivileged bootstrap, the INSTALL script copies
    org.pkgsrc.rc.d-boot.plist to $HOME directory of the user who installs the
    package. This avoids making assumptions on the unprivileged user during the
    build process.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 pkgsrc/pkgtools/rc.d-boot/DEINSTALL
cvs rdiff -u -r1.6 -r1.7 pkgsrc/pkgtools/rc.d-boot/INSTALL
cvs rdiff -u -r1.12 -r1.13 pkgsrc/pkgtools/rc.d-boot/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/pkgtools/rc.d-boot/files/rc.d-boot

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.d-boot/DEINSTALL
diff -u pkgsrc/pkgtools/rc.d-boot/DEINSTALL:1.4 pkgsrc/pkgtools/rc.d-boot/DEINSTALL:1.5
--- pkgsrc/pkgtools/rc.d-boot/DEINSTALL:1.4     Fri Dec 28 20:24:02 2018
+++ pkgsrc/pkgtools/rc.d-boot/DEINSTALL Sat Dec 17 21:36:11 2022
@@ -1,13 +1,18 @@
-# $NetBSD: DEINSTALL,v 1.4 2018/12/28 20:24:02 schmonz Exp $
+# $NetBSD: DEINSTALL,v 1.5 2022/12/17 21:36:11 triaxx Exp $
 
 RCDBOOT_STYLE=@RCDBOOT_STYLE@
 RCD_SCRIPTS_DIR=@RCD_SCRIPTS_DIR@
+UNPRIVILEGED=@UNPRIVILEGED@
+EGDIR=@EGDIR@
 
 case "${STAGE}" in
 
 DEINSTALL)
        case "${RCDBOOT_STYLE}" in
        darwin-launchd)
+               if [ "x${UNPRIVILEGED}" = "xyes" ] ; then
+                       ${RM} -f $HOME/Library/LaunchAgents/org.pkgsrc.rc.d-boot.plist
+               fi
                ;;
        freebsd-native)
                ;;

Index: pkgsrc/pkgtools/rc.d-boot/INSTALL
diff -u pkgsrc/pkgtools/rc.d-boot/INSTALL:1.6 pkgsrc/pkgtools/rc.d-boot/INSTALL:1.7
--- pkgsrc/pkgtools/rc.d-boot/INSTALL:1.6       Fri Dec 28 20:24:02 2018
+++ pkgsrc/pkgtools/rc.d-boot/INSTALL   Sat Dec 17 21:36:11 2022
@@ -1,14 +1,22 @@
-# $NetBSD: INSTALL,v 1.6 2018/12/28 20:24:02 schmonz Exp $
+# $NetBSD: INSTALL,v 1.7 2022/12/17 21:36:11 triaxx Exp $
 
 RCDBOOT_STYLE=@RCDBOOT_STYLE@
 RCD_SCRIPTS_DIR=@RCD_SCRIPTS_DIR@
+UNPRIVILEGED=@UNPRIVILEGED@
+EGDIR=@EGDIR@
 
 case "${STAGE}" in
 
 POST-INSTALL)
        case "${RCDBOOT_STYLE}" in
        darwin-launchd)
-               launchctl load -w /Library/LaunchDaemons/org.pkgsrc.rc.d-boot.plist
+               if [ "x${UNPRIVILEGED}" = "xyes" ] ; then
+                       ${CP} ${EGDIR}/org.pkgsrc.rc.d-boot.plist \
+                             $HOME/Library/LaunchAgents/org.pkgsrc.rc.d-boot.plist
+                       launchctl load -w $HOME/Library/LaunchAgents/org.pkgsrc.rc.d-boot.plist
+               else
+                       launchctl load -w /Library/LaunchDaemons/org.pkgsrc.rc.d-boot.plist
+               fi
                ;;
        freebsd-native)
                ;;

Index: pkgsrc/pkgtools/rc.d-boot/Makefile
diff -u pkgsrc/pkgtools/rc.d-boot/Makefile:1.12 pkgsrc/pkgtools/rc.d-boot/Makefile:1.13
--- pkgsrc/pkgtools/rc.d-boot/Makefile:1.12     Thu Jan 16 16:54:36 2020
+++ pkgsrc/pkgtools/rc.d-boot/Makefile  Sat Dec 17 21:36:11 2022
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.12 2020/01/16 16:54:36 schmonz Exp $
+# $NetBSD: Makefile,v 1.13 2022/12/17 21:36:11 triaxx Exp $
 #
 
-PKGNAME=               rc.d-boot-20200116
+PKGNAME=               rc.d-boot-20221202
 CATEGORIES=            pkgtools
 
 MAINTAINER=            schmonz%NetBSD.org@localhost
@@ -30,10 +30,12 @@ SUBST_FILES.paths=  rc.d-boot
 SUBST_FILES.paths+=    org.pkgsrc.rc.d-boot.plist \
                        pkgsrc-rc.d-boot \
                        pkgsrc-rc.d-boot.service
-SUBST_VARS.paths=      GREP PKGNAME PREFIX RCD_SCRIPTS_DIR RCORDER VARBASE
+SUBST_VARS.paths=      GREP PKG_SYSCONFDIR PKGNAME PREFIX RCD_SCRIPTS_DIR RCORDER VARBASE
 
 FILES_SUBST+=          RCDBOOT_STYLE=${RCDBOOT_STYLE:Q}
 FILES_SUBST+=          RCD_SCRIPTS_DIR=${RCD_SCRIPTS_DIR:Q}
+FILES_SUBST+=          UNPRIVILEGED=${UNPRIVILEGED:Q}
+FILES_SUBST+=          EGDIR=${PREFIX:Q}/${EGDIR:Q}
 
 EGDIR=                 share/examples/${PKGBASE}
 
@@ -41,8 +43,10 @@ SLASH_TO_MOLLIFY_PKGLINT=    /
 
 .if ${OPSYS} == "Darwin" && exists(/Library/LaunchDaemons)
 RCDBOOT_STYLE=         darwin-launchd
+.  if ${UNPRIVILEGED:U:tl} == "no"
 CONF_FILES+=           ${PREFIX}/${EGDIR}/org.pkgsrc.rc.d-boot.plist \
                        ${SLASH_TO_MOLLIFY_PKGLINT}Library/LaunchDaemons/org.pkgsrc.rc.d-boot.plist
+.  endif
 .elif ${OPSYS} == "FreeBSD" && exists(/etc/rc.d)
 RCDBOOT_STYLE=         freebsd-native
 .elif ${OPSYS} == "Linux" && exists(/run/systemd/system) && exists(/bin/systemctl)

Index: pkgsrc/pkgtools/rc.d-boot/files/rc.d-boot
diff -u pkgsrc/pkgtools/rc.d-boot/files/rc.d-boot:1.3 pkgsrc/pkgtools/rc.d-boot/files/rc.d-boot:1.4
--- pkgsrc/pkgtools/rc.d-boot/files/rc.d-boot:1.3       Wed Dec 26 00:43:55 2018
+++ pkgsrc/pkgtools/rc.d-boot/files/rc.d-boot   Sat Dec 17 21:36:11 2022
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-. /etc/rc.subr
+. @PKG_SYSCONFDIR@/rc.subr
 
 run_all_rcd_scripts() {
        action="$1"; shift



Home | Main Index | Thread Index | Old Index