git: 53331c0d8209 - 2024Q1 - security/trivy: include templates

From: Matthias Fechner <mfechner_at_FreeBSD.org>
Date: Tue, 26 Mar 2024 07:57:13 UTC
The branch 2024Q1 has been updated by mfechner:

URL: https://cgit.FreeBSD.org/ports/commit/?id=53331c0d82099be48e3ecf18e46555881d2fe1b1

commit 53331c0d82099be48e3ecf18e46555881d2fe1b1
Author:     Matthias Fechner <mfechner@FreeBSD.org>
AuthorDate: 2024-03-09 08:12:31 +0000
Commit:     Matthias Fechner <mfechner@FreeBSD.org>
CommitDate: 2024-03-26 07:56:35 +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.
    
    (cherry picked from commit 9e6fcaf3eaa2e2f5a8036bcdfde6bd18810d72dd)
---
 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>