tech-pkg archive

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

Unprivileged rc.d-boot on Darwin



Hi,

I use pkgtools/rc.d-boot on Darwin with unprivileged pkgsrc. Do you agree the following patch which fixes /etc/rc.subr in rc.d-boot script and install org.pkgsrc.rc.d-boot in the user launchd directory?

Index: INSTALL
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/rc.d-boot/INSTALL,v
retrieving revision 1.6
diff -u -r1.6 INSTALL
--- INSTALL	28 Dec 2018 20:24:02 -0000	1.6
+++ INSTALL	2 Dec 2022 07:56:28 -0000
@@ -8,7 +8,8 @@
 POST-INSTALL)
 	case "${RCDBOOT_STYLE}" in
 	darwin-launchd)
-		launchctl load -w /Library/LaunchDaemons/org.pkgsrc.rc.d-boot.plist
+		DARWIN_LAUNCHD_PATH=@DARWIN_LAUNCHD_PATH@
+		launchctl load -w ${DARWIN_LAUNCHD_PATH}/org.pkgsrc.rc.d-boot.plist
 		;;
 	freebsd-native)
 		;;
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/rc.d-boot/Makefile,v
retrieving revision 1.12
diff -u -r1.12 Makefile
--- Makefile	16 Jan 2020 16:54:36 -0000	1.12
+++ Makefile	2 Dec 2022 07:56:28 -0000
@@ -1,7 +1,7 @@
 # $NetBSD: Makefile,v 1.12 2020/01/16 16:54:36 schmonz Exp $
 #

-PKGNAME=		rc.d-boot-20200116
+PKGNAME=		rc.d-boot-20221202
 CATEGORIES=		pkgtools

 MAINTAINER=		schmonz%NetBSD.org@localhost
@@ -24,25 +24,32 @@
 NO_CHECKSUM=		yes
 NO_BUILD=		yes

+SLASH_TO_MOLLIFY_PKGLINT=	/
+
+.if empty(UNPRIVILEGED:M[Yy][Ee][Ss])
+DARWIN_LAUNCHD_PATH=	${SLASH_TO_MOLLIFY_PKGLINT}Library/LaunchDaemons
+.else
+DARWIN_LAUNCHD_PATH=	${HOME}/Library/LaunchAgents
+.endif
+
 SUBST_CLASSES=		paths
 SUBST_STAGE.paths=	pre-configure
 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+=		DARWIN_LAUNCHD_PATH=${DARWIN_LAUNCHD_PATH}

 EGDIR=			share/examples/${PKGBASE}

-SLASH_TO_MOLLIFY_PKGLINT=	/
-
 .if ${OPSYS} == "Darwin" && exists(/Library/LaunchDaemons)
 RCDBOOT_STYLE=		darwin-launchd
 CONF_FILES+=		${PREFIX}/${EGDIR}/org.pkgsrc.rc.d-boot.plist \
-			${SLASH_TO_MOLLIFY_PKGLINT}Library/LaunchDaemons/org.pkgsrc.rc.d-boot.plist
+			${DARWIN_LAUNCHD_PATH}/org.pkgsrc.rc.d-boot.plist
 .elif ${OPSYS} == "FreeBSD" && exists(/etc/rc.d)
 RCDBOOT_STYLE=		freebsd-native
.elif ${OPSYS} == "Linux" && exists(/run/systemd/system) && exists(/bin/systemctl)
Index: files/rc.d-boot
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/rc.d-boot/files/rc.d-boot,v
retrieving revision 1.3
diff -u -r1.3 rc.d-boot
--- files/rc.d-boot	26 Dec 2018 00:43:55 -0000	1.3
+++ files/rc.d-boot	2 Dec 2022 07:56:28 -0000
@@ -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