pkgsrc-WIP-changes archive

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

opendoas: Handle pam configuration file.



Module Name:	pkgsrc-wip
Committed By:	Sunil Nimmagadda <sunil%nimmagadda.net@localhost>
Pushed By:	skn
Date:		Sun Nov 15 23:03:40 2020 +0530
Changeset:	706bda320c4c856263a63af6c76e5d741f06e5dc

Modified Files:
	opendoas/Makefile
	opendoas/PLIST
	opendoas/distinfo
Added Files:
	opendoas/PLIST.Darwin
	opendoas/PLIST.Linux
	opendoas/patches/patch-GNUmakefile

Log Message:
opendoas: Handle pam configuration file.

- Use EGDIR and CONF_FILES to copy pam config on Linux and Darwin.
- Switch back to patching GNUmakefile instead of SUBST_SED.
- Use INSTALLATION_DIRS to create necessary directories.

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

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

diffstat:
 opendoas/Makefile                  | 23 ++++++++++++-----------
 opendoas/PLIST                     |  1 +
 opendoas/PLIST.Darwin              |  2 ++
 opendoas/PLIST.Linux               |  2 ++
 opendoas/distinfo                  |  1 +
 opendoas/patches/patch-GNUmakefile | 25 +++++++++++++++++++++++++
 6 files changed, 43 insertions(+), 11 deletions(-)

diffs:
diff --git a/opendoas/Makefile b/opendoas/Makefile
index e1dbac014a..7d51491e1b 100644
--- a/opendoas/Makefile
+++ b/opendoas/Makefile
@@ -20,28 +20,29 @@ SUBST_STAGE.paths=	pre-configure
 SUBST_FILES.paths=	doas.1 doas.conf.5
 SUBST_SED.paths=	-e "s,/etc,${PKG_SYSCONFDIR},"
 
-# Let SPECIAL_PERMS handle permissions/setuid of the binary while
-# allowing to build as an unprivileged user.
-SUBST_CLASSES+=		install
-SUBST_MESSAGE.install=	Let SPECIAL_PERMS handle permissions.
-SUBST_STAGE.install=	pre-install
-SUBST_FILES.install=	GNUmakefile
-SUBST_SED.install=	-e "/chown/d"
-SUBST_SED.install+=	-e "/chmod/d"
+EGDIR=	share/examples/${PKGBASE}
 
 HAS_CONFIGURE=		yes
 CONFIGURE_ARGS+=	--prefix=${PREFIX}
 CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
 CONFIGURE_ARGS+=	--mandir=${PREFIX}/${PKGMANDIR}
+CONFIGURE_ARGS+=	--datadir=${PREFIX}/${EGDIR}
 
 USE_TOOLS=	gmake yacc
 MAKE_FILE=	GNUmakefile
 
-BUILDLINK_TRANSFORM+=   rm:-Werror
-
-SPECIAL_PERMS+=	bin/doas ${SETUID_ROOT_PERMS}
+BUILDLINK_TRANSFORM+=	rm:-Werror
 
+SPECIAL_PERMS+=		bin/doas ${SETUID_ROOT_PERMS}
 NOT_FOR_UNPRIVILEGED=	yes
 
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "Linux" || ${OPSYS} == "Darwin"
+CONF_FILES=	${EGDIR}/doas ${PKG_SYSCONFDIR}/pam.d/doas
+.endif
+
+INSTALLATION_DIRS=	bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man5 ${EGDIR}
+
 .include "../../mk/pam.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/opendoas/PLIST b/opendoas/PLIST
index 7ba8572cbe..3bac39df45 100644
--- a/opendoas/PLIST
+++ b/opendoas/PLIST
@@ -2,3 +2,4 @@
 bin/doas
 man/man1/doas.1
 man/man5/doas.conf.5
+@pkgdir share/examples/opendoas
diff --git a/opendoas/PLIST.Darwin b/opendoas/PLIST.Darwin
new file mode 100644
index 0000000000..97795cb115
--- /dev/null
+++ b/opendoas/PLIST.Darwin
@@ -0,0 +1,2 @@
+@comment $NetBSD$
+share/examples/opendoas/doas
diff --git a/opendoas/PLIST.Linux b/opendoas/PLIST.Linux
new file mode 100644
index 0000000000..97795cb115
--- /dev/null
+++ b/opendoas/PLIST.Linux
@@ -0,0 +1,2 @@
+@comment $NetBSD$
+share/examples/opendoas/doas
diff --git a/opendoas/distinfo b/opendoas/distinfo
index 75d6b66244..d8a72612ec 100644
--- a/opendoas/distinfo
+++ b/opendoas/distinfo
@@ -4,3 +4,4 @@ SHA1 (opendoas-6.6.1-17629b9ce63dba6aa4146d483cd61448cddb1fa5.tar.gz) = 153f4816
 RMD160 (opendoas-6.6.1-17629b9ce63dba6aa4146d483cd61448cddb1fa5.tar.gz) = ee0cf9076220f748599678b49011f35fa390e7e6
 SHA512 (opendoas-6.6.1-17629b9ce63dba6aa4146d483cd61448cddb1fa5.tar.gz) = 2092a5aa3cfaa3af259a7f49e90c2337bfcccb5adc6a2710c56a81d8505ea83de0311edcf01b8bdf2ca6af5b188244a9d0c7a0034d06bfe7d28850b57396c357
 Size (opendoas-6.6.1-17629b9ce63dba6aa4146d483cd61448cddb1fa5.tar.gz) = 32344 bytes
+SHA1 (patch-GNUmakefile) = eadcd4d96f419059d4a26516705001ba70b2e8e0
diff --git a/opendoas/patches/patch-GNUmakefile b/opendoas/patches/patch-GNUmakefile
new file mode 100644
index 0000000000..8ef779dc64
--- /dev/null
+++ b/opendoas/patches/patch-GNUmakefile
@@ -0,0 +1,25 @@
+$NetBSD$
+
+- Allow build as an unpriviliged user.
+- Install configuration files in EGDIR.
+
+--- GNUmakefile.orig	2020-11-12 21:29:10.000000000 +0000
++++ GNUmakefile
+@@ -18,15 +18,9 @@ ${PROG}: ${OBJS}
+ 	${CC} ${CFLAGS} $^ -o $@ ${LDFLAGS}
+ 
+ install: ${PROG} ${PAM_DOAS} ${MAN}
+-	mkdir -p -m 0755 ${DESTDIR}${BINDIR}
+-	[ -n "${PAM_DOAS}" ] && mkdir -p -m 0755 ${DESTDIR}${PAMDIR} || true
+-	mkdir -p -m 0755 ${DESTDIR}${MANDIR}/man1
+-	mkdir -p -m 0755 ${DESTDIR}${MANDIR}/man5
+ 	cp -f ${PROG} ${DESTDIR}${BINDIR}
+-	chown ${BINOWN}:${BINGRP} ${DESTDIR}${BINDIR}/${PROG}
+-	chmod ${BINMODE} ${DESTDIR}${BINDIR}/${PROG}
+-	[ -n "${PAM_DOAS}" ] && cp ${PAM_DOAS} ${DESTDIR}${PAMDIR}/doas || true
+-	[ -n "${PAM_DOAS}" ] && chmod 0644 ${DESTDIR}${PAMDIR}/doas || true
++	[ -n "${PAM_DOAS}" ] && cp ${PAM_DOAS} ${DESTDIR}${SHAREDIR}/doas || true
++	[ -n "${PAM_DOAS}" ] && chmod 0644 ${DESTDIR}${SHAREDIR}/doas || true
+ 	cp -f doas.1 ${DESTDIR}${MANDIR}/man1
+ 	cp -f doas.conf.5 ${DESTDIR}${MANDIR}/man5
+ 


Home | Main Index | Thread Index | Old Index