git: f31a65e8b225 - main - net-mgmt/ipfixcol2: mark this port as suitable only for few architectures, improve port

From: Vladimir Druzenko <vvd_at_FreeBSD.org>
Date: Fri, 16 Aug 2024 17:27:51 UTC
The branch main has been updated by vvd:

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

commit f31a65e8b225b1e5665aaa7801fd6a31d2437157
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2024-08-16 17:23:19 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2024-08-16 17:23:19 +0000

    net-mgmt/ipfixcol2: mark this port as suitable only for few architectures, improve port
    
    Port require SSE2 and also 64bit time_t. It work on amd64 and possible
    on aarch64 and armv7 (not tested).
    
    Pet portclippy, align lines in Makefile, add substitution for %%USER%%
    in start script.
    
    PR:             280850
    Approved by:    Marek Zarychta <zarychtam@plan-b.pwste.edu.pl> (maintainer)
---
 net-mgmt/ipfixcol2/Makefile           | 40 ++++++++++++++++++++---------------
 net-mgmt/ipfixcol2/files/ipfixcol2.in |  2 +-
 2 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/net-mgmt/ipfixcol2/Makefile b/net-mgmt/ipfixcol2/Makefile
index f2bb7613e465..34b823dd40bb 100644
--- a/net-mgmt/ipfixcol2/Makefile
+++ b/net-mgmt/ipfixcol2/Makefile
@@ -1,39 +1,45 @@
-PORTNAME=		ipfixcol2
+PORTNAME=	ipfixcol2
 DISTVERSIONPREFIX=	v
 DISTVERSION=	2.6.0
-CATEGORIES=		net-mgmt
+CATEGORIES=	net-mgmt
 
 MAINTAINER=	zarychtam@plan-b.pwste.edu.pl
 COMMENT=	NetFlow v5/v9 and IPFIX flow (RFC 7011) data collector
 WWW=		https://github.com/CESNET/ipfixcol2
 
-LICENSE=		GPLv2
+LICENSE=	GPLv2
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-LIB_DEPENDS= 	librdkafka.so:net/librdkafka \
-			 libepoll-shim.so:devel/libepoll-shim \
-			 libfds.so:net-mgmt/libfds
+ONLY_FOR_ARCHS=		aarch64 amd64 armv7
+ONLY_FOR_ARCHS_REASON=	Require SSE2 and static_assert(sizeof(uint64_t) == sizeof(time_t), "Assumed that time_t is uint64_t, but it's not")
 
-BUILD_DEPENDS=	rst2man:textproc/py-docutils
-USES=			cmake localbase:ldflags pkgconfig
+BUILD_DEPENDS=	rst2man:textproc/py-docutils@${PY_FLAVOR}
+LIB_DEPENDS=	librdkafka.so:net/librdkafka \
+		libepoll-shim.so:devel/libepoll-shim \
+		libfds.so:net-mgmt/libfds
 
+USES=		cmake localbase:ldflags pkgconfig
 USE_GITHUB=	yes
 GH_ACCOUNT=	CESNET
-USE_RC_SUBR=${PORTNAME}
-USERS=	${PORTNAME}
-GROUPS=	${PORTNAME}
-PORTEXAMPLES=	*
+USE_RC_SUBR=	${PORTNAME}
+
+CXXFLAGS+=	-D_GNU_SOURCE
+LDFLAGS+=	-rdynamic
 
-LDFLAGS+=	 -rdynamic
-CXXFLAGS+=	 -D_GNU_SOURCE
+SUB_LIST=	USER=${USERS:[0]}
+USERS=		${PORTNAME}
+GROUPS=		${PORTNAME}
+PORTEXAMPLES=	*
 
-OPTIONS_DEFINE= EXAMPLES
+OPTIONS_DEFINE=	EXAMPLES
 
 post-install:
 	${MKDIR} ${STAGEDIR}${ETCDIR} ${STAGEDIR}/var/run/${PORTNAME}
-	${INSTALL_DATA} ${WRKSRC}/doc/data/configs/udp2json.xml ${STAGEDIR}${ETCDIR}/startup.xml.sample
+	${INSTALL_DATA} ${WRKSRC}/doc/data/configs/udp2json.xml \
+		${STAGEDIR}${ETCDIR}/startup.xml.sample
 
 post-install-EXAMPLES-on:
-	cd ${WRKSRC}/doc/data && ${COPYTREE_SHARE} "configs" ${STAGEDIR}${EXAMPLESDIR}
+	(cd ${WRKSRC}/doc/data && ${COPYTREE_SHARE} "configs" \
+		${STAGEDIR}${EXAMPLESDIR})
 
 .include <bsd.port.mk>
diff --git a/net-mgmt/ipfixcol2/files/ipfixcol2.in b/net-mgmt/ipfixcol2/files/ipfixcol2.in
index 56e21238f8e6..8e50be3fa610 100644
--- a/net-mgmt/ipfixcol2/files/ipfixcol2.in
+++ b/net-mgmt/ipfixcol2/files/ipfixcol2.in
@@ -21,7 +21,7 @@ load_rc_config "$name"
 : ${ipfixcol2_enable:=NO}
 : ${ipfixcol2_conf:=%%PREFIX%%/etc/$name.conf}
 : ${ipfixcol2_flags:=""}
-: ${ipfixcol2_user:=ipfixcol2}
+: ${ipfixcol2_user:=%%USER%%}
 
 command=%%PREFIX%%/bin/ipfixcol2
 command_args="-d -P /var/run/$name/$name.pid ${ipfixcol2_flags}"