pkgsrc-WIP-changes archive

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

opendoas: Fix package on Linux.



Module Name:	pkgsrc-wip
Committed By:	Sunil Nimmagadda <sunil%nimmagadda.net@localhost>
Pushed By:	skn
Date:		Mon Dec 14 22:30:10 2020 +0530
Changeset:	4c192a8982a77588bf2ae80a00bf3205f2972488

Modified Files:
	opendoas/Makefile
	opendoas/PLIST

Log Message:
opendoas: Fix package on Linux.

Include pam.buildlink3.mk iif pam headers are available, otherwise,
configure package as '--without-pam'.

Copy config file (REQD_FILES) only if pam is enabled.

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

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

diffstat:
 opendoas/Makefile | 16 ++++++++++++++++
 opendoas/PLIST    |  3 ++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diffs:
diff --git a/opendoas/Makefile b/opendoas/Makefile
index 6faa3e57d5..f50c4a652c 100644
--- a/opendoas/Makefile
+++ b/opendoas/Makefile
@@ -22,11 +22,16 @@ SUBST_SED.paths=	-e "s,/etc,${PKG_SYSCONFDIR},"
 
 EGDIR=	share/examples/${PKGBASE}
 
+.include "../../mk/bsd.prefs.mk"
+
 HAS_CONFIGURE=		yes
 CONFIGURE_ARGS+=	--prefix=${PREFIX}
 CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
 CONFIGURE_ARGS+=	--mandir=${PREFIX}/${PKGMANDIR}
 CONFIGURE_ARGS+=	--datadir=${PREFIX}/${EGDIR}
+.if ${OPSYS} == "Linux" && !exists(/usr/include/security/pam_appl.h)
+CONFIGURE_ARGS+=	--without-pam
+.endif
 
 USE_TOOLS=	gmake yacc
 MAKE_FILE=	GNUmakefile
@@ -38,5 +43,16 @@ NOT_FOR_UNPRIVILEGED=	yes
 
 INSTALLATION_DIRS=	bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man5 ${EGDIR}
 
+PLIST_VARS+=	linux-pam
+
+.if ${OPSYS} == "Linux" && exists(/usr/include/security/pam_appl.h)
+PLIST.linux-pam=	yes
+REQD_FILES=		${EGDIR}/doas /etc/pam.d/doas
 .include "../../mk/pam.buildlink3.mk"
+.endif
+
+.if ${OPSYS} != "Linux"
+.include "../../mk/pam.buildlink3.mk"
+.endif
+
 .include "../../mk/bsd.pkg.mk"
diff --git a/opendoas/PLIST b/opendoas/PLIST
index 3bac39df45..70e18ac55b 100644
--- a/opendoas/PLIST
+++ b/opendoas/PLIST
@@ -2,4 +2,5 @@
 bin/doas
 man/man1/doas.1
 man/man5/doas.conf.5
-@pkgdir share/examples/opendoas
+${PLIST.linux-pam}@pkgdir share/examples/opendoas
+${PLIST.linux-pam}share/examples/opendoas/doas


Home | Main Index | Thread Index | Old Index