git: 9e6fcaf3eaa2 - main - security/trivy: include templates

From: Matthias Fechner <mfechner_at_FreeBSD.org>
Date: Sat, 09 Mar 2024 08:13:48 UTC
The branch main has been updated by mfechner:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9e6fcaf3eaa2e2f5a8036bcdfde6bd18810d72dd

commit 9e6fcaf3eaa2e2f5a8036bcdfde6bd18810d72dd
Author:     Matthias Fechner <mfechner@FreeBSD.org>
AuthorDate: 2024-03-09 08:12:31 +0000
Commit:     Matthias Fechner <mfechner@FreeBSD.org>
CommitDate: 2024-03-09 08:13:37 +0000

    security/trivy: include templates
    
    These templates can be used to integrate trivy into gitlab pipelines.
    But it seems that gitlab does support the full parsing not in the
    community edition of gitlab.
---
 security/trivy/Makefile | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/security/trivy/Makefile b/security/trivy/Makefile
index 44282f9226e1..862dba088fd4 100644
--- a/security/trivy/Makefile
+++ b/security/trivy/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	trivy
 DISTVERSION=	0.49.1
+PORTREVISION=	1
 DISTVERSIONPREFIX=	v
 CATEGORIES=	security
 
@@ -21,6 +22,14 @@ GO_BUILDFLAGS= -ldflags=" \
 
 PLIST_FILES=	bin/${PORTNAME}
 
+post-install:
+	@${MKDIR} ${STAGEDIR}${DATADIR}
+	${INSTALL_DATA} ${WRKSRC}/contrib/*.tpl ${STAGEDIR}${DATADIR}/
+	${FIND} -s ${STAGEDIR}${DATADIR} -not -type d | ${SORT} | \
+		${SED} -e 's#^${STAGEDIR}${PREFIX}/##' | \
+		${SED} -E -e '/sample$$/ s#^#@sample #; \
+		s#${DATADIR_REL}/bin#@(,,555) ${DATADIR_REL}/bin#; ' >> ${TMPPLIST}
+	cat ${TMPPLIST}
 	
 
 .include <bsd.port.mk>