From fdf1eb985c9c78779e0b1074589c3a763dff33c5 Mon Sep 17 00:00:00 2001 From: Muhammad Moinur Rahman Date: Sun, 10 Mar 2024 16:17:14 +0100 Subject: net-mgmt/bsnmp-regex: Fix build time warnings - Utilize OPTIONSNG - Utilize USES=localbase - Refresh patches --- net-mgmt/bsnmp-regex/Makefile | 29 +++++------- net-mgmt/bsnmp-regex/files/patch-bsnmp-regex.c | 11 ----- net-mgmt/bsnmp-regex/files/patch-configure.in | 52 ++++++++++++++++++++++ .../bsnmp-regex/files/patch-module_bsnmp-regex.c | 11 +++++ 4 files changed, 74 insertions(+), 29 deletions(-) delete mode 100644 net-mgmt/bsnmp-regex/files/patch-bsnmp-regex.c create mode 100644 net-mgmt/bsnmp-regex/files/patch-configure.in create mode 100644 net-mgmt/bsnmp-regex/files/patch-module_bsnmp-regex.c diff --git a/net-mgmt/bsnmp-regex/Makefile b/net-mgmt/bsnmp-regex/Makefile index 62ef0283315c..a10e74da945b 100644 --- a/net-mgmt/bsnmp-regex/Makefile +++ b/net-mgmt/bsnmp-regex/Makefile @@ -1,6 +1,6 @@ PORTNAME= bsnmp-regex PORTVERSION= 0.6 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= net-mgmt MASTER_SITES= LOCAL/olivier @@ -10,33 +10,26 @@ WWW= http://thewalter.net/stef/software/bsnmp-regex/ LICENSE= BSD3CLAUSE +USES= libtool localbase + GNU_CONFIGURE= yes GNU_CONFIGURE_MANPREFIX=${PREFIX}/share -CPPFLAGS+= "-I${LOCALBASE}/include" -INSTALL_TARGET= install-strip -USES= libtool -OPTIONS_DEFINE= DEBUG PCRE -PCRE_DESC= Use PCRE instead of the default regex library +INSTALL_TARGET= install-strip PLIST_FILES= bin/sockin lib/snmp_regex.so lib/snmp_regex.so.0 \ lib/snmp_regex.so.0.0.0 lib/snmp_regex.a share/man/man1/sockin.1.gz \ share/man/man5/bsnmp-regex.conf.5.gz \ share/man/man8/bsnmp-regex.8.gz -.include +# OPTION PCRE is safe to be removed when devel/pcre is removed +# CONFIGURE_ARGS+= --disable-pcre +OPTIONS_DEFINE= DEBUG PCRE -.if ${PORT_OPTIONS:MDEBUG} -CONFIGURE_ARGS+=--enable-debug -.else -CONFIGURE_ARGS+=--disable-debug -.endif +PCRE_DESC= Use PCRE instead of the default regex library -.if ${PORT_OPTIONS:MPCRE} -LIB_DEPENDS+= libpcre.so:devel/pcre -CONFIGURE_ARGS+= --enable-pcre -.else -CONFIGURE_ARGS+= --disable-pcre -.endif +DEBUG_CONFIGURE_ENABLE=debug +PCRE_LIB_DEPENDS= libpcre.so:devel/pcre +PCRE_CONFIGURE_ENABLE=pcre .include diff --git a/net-mgmt/bsnmp-regex/files/patch-bsnmp-regex.c b/net-mgmt/bsnmp-regex/files/patch-bsnmp-regex.c deleted file mode 100644 index 3118d723b448..000000000000 --- a/net-mgmt/bsnmp-regex/files/patch-bsnmp-regex.c +++ /dev/null @@ -1,11 +0,0 @@ ---- module/bsnmp-regex.c.orig 2011-10-21 16:05:37.000000000 +0700 -+++ module/bsnmp-regex.c 2018-06-05 21:16:44.471250000 +0700 -@@ -788,7 +788,7 @@ config_var (char *name, char *value, int - if (strcmp (name, "expire") == 0 || strcmp (name, "expires") == 0) { - - i = strtol (value, &t2, 10); -- if (i <= 0 || *t2) -+ if (i < 0 || *t2) - emsg ("invalid value for '%s' variable. ignoring: %s", name, value); - else - option_expires = i * 100; diff --git a/net-mgmt/bsnmp-regex/files/patch-configure.in b/net-mgmt/bsnmp-regex/files/patch-configure.in new file mode 100644 index 000000000000..7eb06d891cca --- /dev/null +++ b/net-mgmt/bsnmp-regex/files/patch-configure.in @@ -0,0 +1,52 @@ +--- configure.in.orig 2024-03-10 15:09:20 UTC ++++ configure.in +@@ -13,14 +13,14 @@ AC_PROG_LIBTOOL + AC_PROG_INSTALL + AC_PROG_LIBTOOL + +-AC_CHECK_PROG(GENSNMPTREE, gensnmptree, "gensnmptree") +-if test -z "$GENSNMPTREE"; then +- echo "ERROR: gensnmptree program not found." +- exit 1 ++AC_CHECK_PROG(GENSNMPTREE, gensnmptree, "gensnmptree") ++if test -z "$GENSNMPTREE"; then ++ echo "ERROR: gensnmptree program not found." ++ exit 1 + fi + + # Debug mode +-AC_ARG_ENABLE(debug, ++AC_ARG_ENABLE(debug, + AC_HELP_STRING([--enable-debug], + [Compile binaries in debug mode])) + +@@ -36,20 +36,21 @@ AC_ARG_ENABLE(pcre, + AC_ARG_ENABLE(pcre, + AC_HELP_STRING([--with-pcre], + [Use PCRE instead of the default regular expression library])) +- ++ + if test "$enable_pcre" = "yes"; then +- AC_CHECK_LIB(pcre, pcre_compile, , ++ AC_CHECK_LIB(pcre, pcre_compile, , + [echo "Couldn't find the pcre library"; exit 1]) +- AC_CHECK_HEADERS("pcre.h", , ++ AC_CHECK_HEADERS("pcre.h", , + [echo "Couldn't find pcre headers"; exit 1]) + AC_DEFINE_UNQUOTED(WITH_PCRE, 1, [Use PCRE regular expression library]) + fi + +-AC_CHECK_HEADERS([sys/queue.h sys/limits.h sys/stat.h sys/time.h sys/un.h], , +- [echo "ERROR: required header not found."; exit 1]) +-AC_CHECK_HEADERS([bsnmp/snmpmod.h], , +- [echo "ERROR: required bsnmp header not found." exit 1]) +- ++AC_CHECK_HEADERS([sys/queue.h sys/limits.h sys/stat.h sys/time.h sys/un.h], , ++ [echo "ERROR: required header not found."; exit 1]) ++AC_CHECK_HEADERS([bsnmp/snmpmod.h], , ++ [echo "ERROR: required bsnmp header not found." exit 1], ++ [#include ]) ++ + # Checks for typedefs, structures, and compiler characteristics. + AC_C_CONST + AC_TYPE_SIZE_T diff --git a/net-mgmt/bsnmp-regex/files/patch-module_bsnmp-regex.c b/net-mgmt/bsnmp-regex/files/patch-module_bsnmp-regex.c new file mode 100644 index 000000000000..296158bac548 --- /dev/null +++ b/net-mgmt/bsnmp-regex/files/patch-module_bsnmp-regex.c @@ -0,0 +1,11 @@ +--- module/bsnmp-regex.c.orig 2011-10-21 09:05:37 UTC ++++ module/bsnmp-regex.c +@@ -788,7 +788,7 @@ config_var (char *name, char *value, int line) + if (strcmp (name, "expire") == 0 || strcmp (name, "expires") == 0) { + + i = strtol (value, &t2, 10); +- if (i <= 0 || *t2) ++ if (i < 0 || *t2) + emsg ("invalid value for '%s' variable. ignoring: %s", name, value); + else + option_expires = i * 100; -- cgit v1.2.3