pkgsrc-WIP-changes archive

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

plan9port: plan9/bin/auxstats needs sgid bit.



Module Name:	pkgsrc-wip
Committed By:	Paolo Vincenzo Olivo <vms%retrobsd.ddns.net@localhost>
Pushed By:	vms
Date:		Fri Nov 25 09:47:20 2022 +0100
Changeset:	c2fa89b9e26968c705f7ab11651433b5fe0d8e1b

Modified Files:
	plan9port/Makefile

Log Message:
plan9port:  plan9/bin/auxstats needs sgid bit.

auxstats needs read access to /dev/kmem on non-Linux systems.
BSDs provide a kmem group for this, so we'll use that.
On SunOS this is not required, as /dev/kmem can be read be the standard
user.
See https://9fans.github.io/plan9port/man/man1/stats.html

Makefile slightly reworked to be more readable and easy to follow.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=c2fa89b9e26968c705f7ab11651433b5fe0d8e1b

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

diffstat:
 plan9port/Makefile | 40 ++++++++++++++++++++++++++--------------
 1 file changed, 26 insertions(+), 14 deletions(-)

diffs:
diff --git a/plan9port/Makefile b/plan9port/Makefile
index c1a6502ce3..f3743c9876 100644
--- a/plan9port/Makefile
+++ b/plan9port/Makefile
@@ -54,11 +54,6 @@ REPLACE_FILES.rc+=	src/cmd/upas/misc/remotemail
 REPLACE_FILES.rc+=	src/cmd/venti/srv/conf.rc
 REPLACE_FILES.rc+=	src/cmd/venti/srv/tester
 
-EGDIR=		${PREFIX}/share/examples/profile.d
-CONF_FILES+=	${EGDIR}/plan9.sh \
-		${PKG_SYSCONFDIR}/profile.d/plan9.sh
-DOCDIR=		${PREFIX}/share/doc/plan9
-
 SUBST_CLASSES+=		cc
 SUBST_STAGE.cc=		pre-configure
 SUBST_FILES.cc+=	INSTALL
@@ -67,17 +62,30 @@ SUBST_VARS.cc=		CC
 SUBST_MESSAGE.cc=	Defining preferred compiler.
 
 SUBST_CLASSES+=		prefix
-SUBST_STAGE.prefix=	pre-build
+SUBST_STAGE.prefix=	pre-configure
 SUBST_FILES.prefix+=	src/cmd/devdraw/mkwsysrules.sh
 SUBST_FILES.prefix+=	plan9.sh acme.sh
 SUBST_VARS.prefix=	PREFIX
 SUBST_MESSAGE.prefix=	Replacing PREFIX placeholders.
 
-PLAN9_BUILD=		${DESTDIR}${PREFIX}/plan9
-INSTALL_ENV+=		PLAN9_TARGET=${PREFIX}/plan9
+PLAN9_TARGET=	${PREFIX}/plan9
+
+EGDIR=		${PREFIX}/share/examples/profile.d
+CONF_FILES+=	${EGDIR}/plan9.sh \
+		${PKG_SYSCONFDIR}/profile.d/plan9.sh
+DOCDIR=		${PREFIX}/share/doc/plan9
 
 MAKE_DIRS+=		${PKG_SYSCONFDIR}/profile.d
 
+PLAN9_BUILD=		${DESTDIR}${PLAN_TARGET}
+INSTALL_ENV+=		PLAN9_TARGET=${PLAN_TARGET}
+
+.include "../../mk/bsd.prefs.mk"
+.if exists(/dev/kmem) && !empty${OPSYS:M*BSD}
+SETUID_ROOT_PERMS?=	${REAL_ROOT_USER} kmem 2755
+SPECIAL_PERMS+=		${PLAN9_TARGET}/bin/auxstats ${SETUID_ROOT_PERMS}
+.endif
+
 INSTALLATION_DIRS+=	bin plan9 ${EGDIR}
 INSTALLATION_DIRS+=	share/doc/plan9
 INSTALLATION_DIRS+=	share/applications
@@ -85,22 +93,24 @@ INSTALLATION_DIRS+=	share/pixmaps
 
 .include "options.mk"
 
+post-extract:
+.for s in acme.sh plan9.sh
+	${RUN}${CP} ${FILESDIR}/${s} ${WRKSRC}
+.endfor
+
 do-configure:
 	${RUN}${ECHO} "CC9='${CC}'" >> ${WRKSRC}/LOCAL.config
 	${RUN}${ECHO} "CC9FLAGS='${CFLAGS}'" >> ${WRKSRC}/LOCAL.config
 	${RUN}${ECHO} "LDFLAGS='${LDFLAGS}'" >> ${WRKSRC}/LOCAL.config
 	${RUN}${ECHO} "FONTSRV=fontsrv"	>> ${WRKSRC}/LOCAL.config
-.if !empty(PKG_OPTIONS:Mx11)
+.if ${OPSYS} == "Darwin"
+	${RUN}${ECHO} "WSYSTYPE='mac'" >> ${WRKSRC}/LOCAL.config
+.elif !empty(PKG_OPTIONS:Mx11)
 	${RUN}${ECHO} "WSYSTYPE='x11'" >> ${WRKSRC}/LOCAL.config
 .else
 	${RUN}${ECHO} "WSYSTYPE='nowsys'" >> ${WRKSRC}/LOCAL.config
 .endif
 
-post-configure:
-.for s in acme.sh plan9.sh
-	${RUN}${CP} ${FILESDIR}/${s} ${WRKSRC}
-.endfor
-
 do-build:
 	${RUN}cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${SH} ./INSTALL -b
 
@@ -115,6 +125,7 @@ do-install:
 # Rename hard-coded paths and builds mans.
 	${RUN}cd ${PLAN9_BUILD} &&			\
 	  ${SETENV} ${MAKE_ENV} ${INSTALL_ENV} ${SH} ./INSTALL -c
+# Install docs and sample profile script.
 .for f in CHANGES LICENSE README.md
 	${RUN}cd ${PLAN9_BUILD} &&			\
 	  ${PAX} -rw -pm ${f} ${DESTDIR}${DOCDIR}
@@ -144,6 +155,7 @@ do-install:
 	${RUN}${CHMOD} -x ${PLAN9_BUILD}/man/fonts
 
 post-install:
+# Run acme as a standalone application.
 	${INSTALL_SCRIPT} ${WRKSRC}/acme.sh		\
 	  ${DESTDIR}${PREFIX}/bin/acme
 	${INSTALL_DATA} ${FILESDIR}/acme.desktop	\


Home | Main Index | Thread Index | Old Index