Created
May 3, 2023 00:00
-
-
Save ngie-eign/a7be390d21989e343bc4979cfe6f6c07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From c72968d88e96418b68851bb1d620258098102ad3 Mon Sep 17 00:00:00 2001 | |
From: Enji Cooper <ngie@FreeBSD.org> | |
Date: Tue, 2 May 2023 16:55:04 -0700 | |
Subject: [PATCH] net-mgmt/net-snmp: fix several issues | |
- Don't override LDFLAGS in configure: this can result in USES+=ssl | |
provided LDFLAGS not being honored. | |
- Enable/disable IPv6 support fully with the IPV6 option. | |
- Pass -I via CPPFLAGS: this unbreaks pcre inclusion in base. | |
- Pass --with(out?)-pcre, as requested by the PCRE option. | |
- Add missing LIB_DEPENDS for ports-mgmt/pkg and devel/pcre, depending | |
on the appropriate option. Found by `make stage-qa`. | |
- Move USES up to silence complaint from `portlint`. | |
Sponsored-by: Dell, Inc | |
--- | |
net-mgmt/net-snmp/Makefile | 37 +++++++++++++++++++++---------------- | |
1 file changed, 21 insertions(+), 16 deletions(-) | |
diff --git a/net-mgmt/net-snmp/Makefile b/net-mgmt/net-snmp/Makefile | |
index 7c8700af94ee..c2eff3687346 100644 | |
--- a/net-mgmt/net-snmp/Makefile | |
+++ b/net-mgmt/net-snmp/Makefile | |
@@ -18,9 +18,11 @@ LICENSE_FILE= ${WRKSRC}/COPYING | |
NOT_FOR_ARCHS= mips mips64 | |
NOT_FOR_ARCHS_REASON= SSP is currently broken on MIPS | |
+USES= cpe libtool perl5 ssl | |
+ | |
OPTIONS_DEFINE= IPV6 MFD_REWRITES PERL PERL_EMBEDDED PYTHON DUMMY TKMIB \ | |
MYSQL AX_SOCKONLY UNPRIVILEGED SMUX DOCS JAIL AX_DISABLE_TRAP \ | |
- TLS NEWSYSLOG NOLIBPKG SCTP | |
+ TLS NEWSYSLOG NOLIBPKG SCTP PCRE | |
OPTIONS_DEFAULT=PERL PERL_EMBEDDED DUMMY SMUX NEWSYSLOG | |
OPTIONS_SUB= yes | |
@@ -44,12 +46,11 @@ PORTSCOUT= skipv:5.7.2.1 | |
GNU_CONFIGURE= yes | |
USE_RC_SUBR= snmpd snmptrapd | |
USE_LDCONFIG= yes | |
-USES= cpe libtool perl5 ssl | |
CPE_PRODUCT= net-snmp | |
USE_PERL5= build run | |
USE_CSTD= c99 | |
-CFLAGS+= -I${LOCALBASE}/include -I${PKG_PREFIX}/include | |
+CPPFLAGS+= -I${LOCALBASE}/include | |
LDFLAGS+= -L${LOCALBASE}/lib | |
CONFIGURE_ENV+= PERLPROG="${PERL}" PSPROG="${PS_CMD}" SED="${SED}" | |
CONFIGURE_ARGS+=--enable-shared --enable-internal-md5 \ | |
@@ -58,8 +59,7 @@ CONFIGURE_ARGS+=--enable-shared --enable-internal-md5 \ | |
--with-sys-location="${NET_SNMP_SYS_LOCATION}" \ | |
--with-logfile="${NET_SNMP_LOGFILE}" \ | |
--with-persistent-directory="${NET_SNMP_PERSISTENTDIR}" \ | |
- --with-gnu-ld --without-libwrap \ | |
- --with-ldflags="-lm -lkvm -ldevstat -L${PKG_PREFIX}/lib -L${LOCALBASE}/lib ${LCRYPTO}" | |
+ --with-gnu-ld --without-libwrap | |
SUB_FILES= pkg-message | |
.if !defined(WITHOUT_SSP) | |
@@ -78,8 +78,7 @@ TLS_CONFIGURE_ON= --with-security-modules=tsm --with-transports=TLSTCP,DTLSUDP | |
PYDISTUTILS_PKGNAME?= netsnmp-python | |
PYDISTUTILS_PKGVERSION?= 1.0a1 | |
USES+= python:3.5+ | |
-RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} | |
-BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} | |
+USE_PYTHON+= distutils | |
CONFIGURE_ARGS+=--with-python-modules | |
CONFIGURE_ENV+= PYTHONPROG="${PYTHON_CMD}" | |
MAKE_ENV+= PYDISTUTILS_INSTALLARGS="${PYDISTUTILS_INSTALLARGS}" STAGEDIR="${STAGEDIR}" | |
@@ -91,6 +90,13 @@ PLIST_SUB+= WITH_PYTHON="@comment " | |
CONFIGURE_ARGS+=--with-openssl="${OPENSSLBASE}" | |
+.if ${PORT_OPTIONS:MPCRE} | |
+CONFIGURE_ARGS+=--with-pcre | |
+LIB_DEPENDS+= libpcre.so:devel/pcre | |
+.else | |
+CONFIGURE_ARGS+=--without-pcre | |
+.endif | |
+ | |
.if ${PORT_OPTIONS:MDUMMY} | |
CONFIGURE_ARGS+=--with-dummy-values | |
.endif | |
@@ -135,9 +141,11 @@ CONFIGURE_ARGS+=--enable-agentx-dom-sock-only | |
.if ${PORT_OPTIONS:MIPV6} | |
CONFIGURE_ARGS+=--enable-ipv6 | |
-# --with-transport="UDPIPv6 TCPIPv6" --with-modules=mibII/ipv6" | |
+CONFIGURE_ARGS+=--with-transports="UDPIPv6 TCPIPv6" | |
+NET_SNMP_WITH_MIB_MODULE_LIST+= mibII/ipv6 | |
PLIST_SUB+= WITH_IPV6="" | |
.else | |
+NET_SNMP_WITHOUT_MIB_MODULE_LIST+= mibII/ipv6 | |
PLIST_SUB+= WITH_IPV6="@comment " | |
.endif | |
@@ -157,10 +165,6 @@ NET_SNMP_LOGFILE?= /var/log/snmpd.log | |
NET_SNMP_PERSISTENTDIR?=/var/net-snmp | |
NET_SNMP_WITH_MIB_MODULE_LIST+= host disman/event-mib mibII/mta_sendmail mibII/tcpTable ucd-snmp/diskio | |
-.if ${OPSYS} == FreeBSD | |
-NET_SNMP_WITHOUT_MIB_MODULE_LIST+= mibII/ipv6 | |
-.endif | |
- | |
.if ${PORT_OPTIONS:MSCTP} | |
NET_SNMP_WITH_MIB_MODULE_LIST+= sctp-mib | |
.endif | |
@@ -216,10 +220,9 @@ CONFLICTS= ucd-snmp-4.* net-snmp-5.3.* | |
.include <bsd.port.pre.mk> | |
-.if ${SSL_DEFAULT} != base | |
-LCRYPTO= -lcrypto | |
-.else | |
-LCRYPTO= | |
+.if ${LOCALBASE} != ${PREFIX} | |
+CPPFLAGS+= -I${PREFIX}/include | |
+LDFLAGS+= -L${PREFIX}/lib | |
.endif | |
pre-everything:: | |
@@ -262,6 +265,8 @@ pre-configure: | |
-e 's|pkg[.]h|ignore-pkg.h|g' \ | |
-e 's|in pkg ;|in ignore-pkg ;|' \ | |
${WRKSRC}/configure | |
+.else | |
+LIB_DEPENDS+= libpkg.so:ports-mgmt/pkg | |
.endif | |
post-configure: | |
-- | |
2.40.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment