diff options
author | Kurt Jaeger <pi@FreeBSD.org> | 2020-08-05 14:42:27 +0000 |
---|---|---|
committer | Kurt Jaeger <pi@FreeBSD.org> | 2020-08-05 14:42:27 +0000 |
commit | de0521e60820bf67881c0482b23182e485d75aaa (patch) | |
tree | 6fbf125ca2eb65c30e4f0b3f22c398ea8f61d5b7 /net-mgmt/pmacct | |
parent | 5fb47772017d4d164d4b1466f59b396f2da33ee5 (diff) | |
download | ports-de0521e60820bf67881c0482b23182e485d75aaa.tar.gz ports-de0521e60820bf67881c0482b23182e485d75aaa.zip |
net-mgmt/pmacct: update 1.7.4p1 -> 1.7.5
- added REDIS option, pmacct daemons can now connect to a Redis cache
- fix SQLDOC pkg-plist substitute
- fixed SQL headers/libs detection
PR: 243455
Submitted by: Juraj Lutter <juraj@lutter.sk>
Relnotes: https://github.com/pmacct/pmacct/releases/tag/v1.7.5
Notes
Notes:
svn path=/head/; revision=544223
Diffstat (limited to 'net-mgmt/pmacct')
-rw-r--r-- | net-mgmt/pmacct/Makefile | 151 | ||||
-rw-r--r-- | net-mgmt/pmacct/distinfo | 6 | ||||
-rw-r--r-- | net-mgmt/pmacct/files/patch-Makefile.am | 8 | ||||
-rw-r--r-- | net-mgmt/pmacct/files/patch-Makefile.in | 10 | ||||
-rw-r--r-- | net-mgmt/pmacct/files/patch-src_kafka__plugin.c | 11 | ||||
-rw-r--r-- | net-mgmt/pmacct/files/patch-src_pgsql__plugin.c | 11 | ||||
-rw-r--r-- | net-mgmt/pmacct/files/patch-src_pmacct.c | 22 | ||||
-rw-r--r-- | net-mgmt/pmacct/files/patch-src_sql__common.c | 13 | ||||
-rw-r--r-- | net-mgmt/pmacct/files/patch-src_sql__common.h | 11 | ||||
-rw-r--r-- | net-mgmt/pmacct/files/patch-src_sqlite3__plugin.c | 11 | ||||
-rw-r--r-- | net-mgmt/pmacct/files/patch-src_util.c | 22 |
11 files changed, 149 insertions, 127 deletions
diff --git a/net-mgmt/pmacct/Makefile b/net-mgmt/pmacct/Makefile index 9cfa7a6e3ce2..b41964d83cf0 100644 --- a/net-mgmt/pmacct/Makefile +++ b/net-mgmt/pmacct/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= pmacct -DISTVERSION= 1.7.4p1 +DISTVERSION= 1.7.5 CATEGORIES= net-mgmt MASTER_SITES= http://www.pmacct.net/ @@ -11,146 +11,67 @@ COMMENT= Accounting and aggregation tool for IPv4 and IPv6 traffic LICENSE= GPLv2 -USES= libtool +USES= libtool pkgconfig localbase USE_RC_SUBR= pmacctd nfacctd sfacctd SUB_FILES= pkg-message GNU_CONFIGURE= yes -CPPFLAGS+= "-I${LOCALBASE}/include" -LDFLAGS+= "-L${LOCALBASE}/lib" -WRKSRC= ${WRKDIR}/pmacct-1.7.4 - -OPTIONS_DEFINE= MYSQL PGSQL SQLITE3 THREADS LAYER2 IPV6 DEBUG GEOIP2 \ - DOCS PLABEL RABBITMQ KAFKA JANSSON AVRO EXAMPLES -OPTIONS_DEFAULT=MMAP LAYER2 THREADS SHARED +OPTIONS_DEFINE= MYSQL PGSQL SQLITE3 LAYER2 DEBUG GEOIP2 \ + DOCS PLABEL RABBITMQ REDIS KAFKA AVRO EXAMPLES +OPTIONS_DEFAULT=LAYER2 +OPTIONS_SUB= 1 AVRO_DESC= Enable avro support GEOIP2_DESC= Enable GeoIPv2 (libmaxminddb) support -JANSSON_DESC= Enable Jansson support KAFKA_DESC= Enable Kafka support LAYER2_DESC= Enable Layer-2 support: MAC addresses and VLANs -# Requires libnetfilter_log port/package -# NFLOG_DESC= Enable NFLOG support -# Requires legacy mongo-c-driver version 0.8 which is not available -# MONGO_DESC= Enable MongoDB support PLABEL_DESC= Enable IP prefix labels RABBITMQ_DESC= Enable RabbitMQ/AMQP support +REDIS_DESC= Enable Redis support SQLITE3_DESC= Enable SQLite3 support -.include <bsd.port.options.mk> +SQLDOC= "@comment " -.if ${PORT_OPTIONS:MMYSQL} -USES+= mysql -CONFIGURE_ARGS+=--enable-mysql -PLIST_SUB+= WITH_MYSQL="" -PLIST_SUB+= SQLDOC="" -.else -CONFIGURE_ARGS+=--disable-mysql -PLIST_SUB+= WITH_MYSQL="@comment " -PLIST_SUB+= SQLDOC="@comment " -.endif +MYSQL_USES= mysql +MYSQL_CONFIGURE_ENABLE= mysql +MYSQL_VARS+= SQLDOC="" -.if ${PORT_OPTIONS:MPGSQL} -USES+= pgsql -WANT_PGSQL= client -CONFIGURE_ARGS+=--enable-pgsql -PLIST_SUB+= WITH_PGSQL="" -PLIST_SUB+= SQLDOC="" -.else -CONFIGURE_ARGS+=--disable-pgsql -PLIST_SUB+= WITH_PGSQL="@comment " -PLIST_SUB+= SQLDOC="@comment " -.endif +PGSQL_USES= pgsql +PGSQL_CONFIGURE_ENABLE= pgsql +PGSQL_VARS+= WANT_PGSQL=client +PGSQL_VARS+= SQLDOC="" -.if ${PORT_OPTIONS:MSQLITE3} -USES+= pkgconfig sqlite -CONFIGURE_ARGS+=--enable-sqlite3 \ - --with-sqlite3-includes=${LOCALBASE}/include -PLIST_SUB+= WITH_SQLITE3="" -PLIST_SUB+= SQLDOC="" -.else -CONFIGURE_ARGS+=--disable-sqlite3 -PLIST_SUB+= WITH_SQLITE3="@comment " -PLIST_SUB+= SQLDOC="@comment " -.endif +SQLITE3_USES= sqlite +SQLITE3_CONFIGURE_ENABLE= sqlite3 +SQLITE3_VARS= SQLDOC="" -.if ${PORT_OPTIONS:MLAYER2} -CONFIGURE_ARGS+=--enable-l2 -.else -CONFIGURE_ARGS+=--disable-l2 -.endif +LAYER2_CONFIGURE_ENABLE= l2 +PLABEL_CONFIGURE_ENABLE= plabel +DEBUG_CONFIGURE_ENABLE= debug -.if ${PORT_OPTIONS:MIPV6} -CONFIGURE_ARGS+=--enable-ipv6 -.else -CONFIGURE_ARGS+=--disable-ipv6 -.endif +RABBITMQ_VARS= LIB_DEPENDS+=librabbitmq.so:net/rabbitmq-c-devel +RABBITMQ_CONFIGURE_ENABLE= rabbitmq -.if ${PORT_OPTIONS:MPLABEL} -CONFIGURE_ARGS+=--enable-plabel -.else -CONFIGURE_ARGS+=--disable-plabel -.endif +REDIS_VARS= LIB_DEPENDS+=libhiredis.so:databases/hiredis +REDIS_CONFIGURE_ENABLE= redis -.if ${PORT_OPTIONS:MTHREADS} -CONFIGURE_ARGS+=--enable-threads -.else -CONFIGURE_ARGS+=--disable-threads -.endif +KAFKA_VARS= LIB_DEPENDS+=librdkafka.so:net/librdkafka +KAFKA_CONFIGURE_ENABLE== kafka -.if ${PORT_OPTIONS:MDEBUG} -CONFIGURE_ARGS+=--enable-debug -.endif +AVRO_VARS= LIB_DEPENDS+=libavro.so:devel/avro-c +AVRO_CONFIGURE_ENABLE= avro -.if ${PORT_OPTIONS:MMONGO} -#CONFIGURE_ARGS+=--enable-mongodb -.else -CONFIGURE_ARGS+=--disable-mongodb -.endif +GEOIP2_VARS= LIB_DEPENDS+=libmaxminddb.so:net/libmaxminddb +GEOIP2_CONFIGURE_ENABLE= geoipv2 -.if ${PORT_OPTIONS:MRABBITMQ} -.if ${PORT_OPTIONS:MJANSSON} -USES+= pkgconfig -LIB_DEPENDS+= libjansson.so:devel/jansson -CONFIGURE_ARGS+=--enable-jansson -.else -IGNORE= RabbitMQ support requires enabled Jansson support -.endif -LIB_DEPENDS+= librabbitmq.so:net/rabbitmq-c-devel -CONFIGURE_ARGS+=--enable-rabbitmq -.endif +.include <bsd.port.options.mk> + +PLIST_SUB+= SQLDOC=${SQLDOC} +PLIST_SUB+= WITH_KAFKA=${KAFKA} -.if ${PORT_OPTIONS:MKAFKA} -.if ${PORT_OPTIONS:MJANSSON} -USES+= pkgconfig +.if ${PORT_OPTIONS:MRABBITMQ} || ${PORT_OPTIONS:MKAFKA} LIB_DEPENDS+= libjansson.so:devel/jansson CONFIGURE_ARGS+=--enable-jansson -.else -IGNORE= Kafaka support requires enabled Jansson support -.endif -LIB_DEPENDS+= librdkafka.so:net/librdkafka -CONFIGURE_ARGS+=--enable-kafka -PLIST_SUB+=WITH_KAFKA="" -.else -PLIST_SUB+=WITH_KAFKA="@comment " -.endif - -.if ${PORT_OPTIONS:MAVRO} -LIB_DEPENDS+= libavro.so:devel/avro-c -CONFIGURE_ARGS+=--enable-avro -.endif - -.if ${PORT_OPTIONS:MNFLOG} -#CONFIGURE_ARGS+=--enable-nflog -#PLIST_SUB+=WITH_NFLOG="" -.else -CONFIGURE_ARGS+=--disable-nflog -PLIST_SUB+=WITH_NFLOG="@comment " -.endif - -.if ${PORT_OPTIONS:MGEOIP2} -LIB_DEPENDS+= libmaxminddb.so:net/libmaxminddb -CONFIGURE_ARGS+=--enable-geoipv2 .endif .include <bsd.port.pre.mk> diff --git a/net-mgmt/pmacct/distinfo b/net-mgmt/pmacct/distinfo index a6764823f178..bb1716bee674 100644 --- a/net-mgmt/pmacct/distinfo +++ b/net-mgmt/pmacct/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1582385432 -SHA256 (pmacct-1.7.4p1.tar.gz) = 8a35fdde01a2e34faf7c0d68cb3010bca56667638a6227b02384d015ee9c1335 -SIZE (pmacct-1.7.4p1.tar.gz) = 1581347 +TIMESTAMP = 1596635446 +SHA256 (pmacct-1.7.5.tar.gz) = 2e778bd3cdd968c4b9f22e28008b9b72f229980201d2cc2ee04cb02f6b0bdcd5 +SIZE (pmacct-1.7.5.tar.gz) = 1626770 diff --git a/net-mgmt/pmacct/files/patch-Makefile.am b/net-mgmt/pmacct/files/patch-Makefile.am index b6c26e48dda3..99b6d01256e1 100644 --- a/net-mgmt/pmacct/files/patch-Makefile.am +++ b/net-mgmt/pmacct/files/patch-Makefile.am @@ -1,7 +1,7 @@ ---- Makefile.am.orig 2019-04-19 04:06:27.000000000 +0200 -+++ Makefile.am 2019-06-16 19:58:43.298406000 +0200 -@@ -17,7 +17,7 @@ - pmacct_examples_lg_arch_dir = $(pmacct_examples_arch_dir)/lg +--- Makefile.am.orig 2019-12-07 17:48:46 UTC ++++ Makefile.am +@@ -22,7 +22,7 @@ pmacct_examples_lg_arch_dir = $(pmacct_examples_arch_d + endif pmacct_examples_custom_dir = $(pmacct_examples_arch_dir)/custom if USING_SQL -pmacct_sql_dir = $(pmacct_data_dir)/sql diff --git a/net-mgmt/pmacct/files/patch-Makefile.in b/net-mgmt/pmacct/files/patch-Makefile.in index 48b626c87a12..cf7b889797dc 100644 --- a/net-mgmt/pmacct/files/patch-Makefile.in +++ b/net-mgmt/pmacct/files/patch-Makefile.in @@ -1,8 +1,8 @@ ---- Makefile.in.orig 2019-06-16 20:01:08.854403000 +0200 -+++ Makefile.in 2019-06-16 20:01:32.038160000 +0200 -@@ -346,7 +346,7 @@ - pmacct_examples_lg_dir = $(pmacct_examples_dir)/lg - pmacct_examples_lg_arch_dir = $(pmacct_examples_arch_dir)/lg +--- Makefile.in.orig 2020-06-17 22:02:42 UTC ++++ Makefile.in +@@ -417,7 +417,7 @@ pmacct_examples_avro_dir = $(pmacct_examples_dir)/avro + @USING_BGP_BINS_TRUE@pmacct_examples_lg_dir = $(pmacct_examples_dir)/lg + @USING_BGP_BINS_TRUE@pmacct_examples_lg_arch_dir = $(pmacct_examples_arch_dir)/lg pmacct_examples_custom_dir = $(pmacct_examples_arch_dir)/custom -@USING_SQL_TRUE@pmacct_sql_dir = $(pmacct_data_dir)/sql +@USING_SQL_TRUE@pmacct_sql_dir = $(pmacct_data_dir) diff --git a/net-mgmt/pmacct/files/patch-src_kafka__plugin.c b/net-mgmt/pmacct/files/patch-src_kafka__plugin.c new file mode 100644 index 000000000000..7dbb48e28b8e --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_kafka__plugin.c @@ -0,0 +1,11 @@ +--- src/kafka_plugin.c.orig 2020-05-10 13:57:54 UTC ++++ src/kafka_plugin.c +@@ -875,7 +875,7 @@ void kafka_cache_purge(struct chained_cache *queue[], + + p_kafka_close(&kafkap_kafka_host, FALSE); + +- Log(LOG_INFO, "INFO ( %s/%s ): *** Purging cache - END (PID: %u, QN: %u/%u, ET: %lu) ***\n", ++ Log(LOG_INFO, "INFO ( %s/%s ): *** Purging cache - END (PID: %u, QN: %u/%u, ET: %zu) ***\n", + config.name, config.type, writer_pid, qn, saved_index, duration); + + if (config.sql_trigger_exec && !safe_action) P_trigger_exec(config.sql_trigger_exec); diff --git a/net-mgmt/pmacct/files/patch-src_pgsql__plugin.c b/net-mgmt/pmacct/files/patch-src_pgsql__plugin.c new file mode 100644 index 000000000000..22042ef4be7e --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_pgsql__plugin.c @@ -0,0 +1,11 @@ +--- src/pgsql_plugin.c.orig 2019-12-07 17:48:46 UTC ++++ src/pgsql_plugin.c +@@ -611,7 +611,7 @@ void PG_cache_purge(struct db_cache *queue[], int inde + if (pqq_ptr) goto start; + + idata->elap_time = time(NULL)-start; +- Log(LOG_INFO, "INFO ( %s/%s ): *** Purging cache - END (PID: %u, QN: %u/%u, ET: %lu) ***\n", ++ Log(LOG_INFO, "INFO ( %s/%s ): *** Purging cache - END (PID: %u, QN: %u/%u, ET: %zu) ***\n", + config.name, config.type, writer_pid, idata->qn, saved_index, idata->elap_time); + + if (config.sql_trigger_exec) { diff --git a/net-mgmt/pmacct/files/patch-src_pmacct.c b/net-mgmt/pmacct/files/patch-src_pmacct.c new file mode 100644 index 000000000000..f6812f0d6ae8 --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_pmacct.c @@ -0,0 +1,22 @@ +--- src/pmacct.c.orig 2020-05-10 13:57:54 UTC ++++ src/pmacct.c +@@ -2898,7 +2898,7 @@ int main(int argc,char **argv) + /* print packets */ + else if (which_counter == 1) printf("%" PRIu64 "\n", acc_elem->pkt_num); + /* print packets+bytes+flows+num */ +- else if (which_counter == 2) printf("%" PRIu64 " %" PRIu64 " %" PRIu64 " %lu\n", acc_elem->pkt_num, acc_elem->pkt_len, acc_elem->flo_num, acc_elem->time_start.tv_sec); ++ else if (which_counter == 2) printf("%" PRIu64 " %" PRIu64 " %" PRIu64 " %zu\n", acc_elem->pkt_num, acc_elem->pkt_len, acc_elem->flo_num, acc_elem->time_start.tv_sec); + /* print flows */ + else if (which_counter == 3) printf("%" PRIu64 "\n", acc_elem->flo_num); + } +@@ -3725,8 +3725,8 @@ void pmc_compose_timestamp(char *buf, int buflen, stru + struct tm *time2; + + if (tstamp_since_epoch) { +- if (usec) snprintf(buf, buflen, "%ld.%.6ld", tv->tv_sec, (long)tv->tv_usec); +- else snprintf(buf, buflen, "%ld", tv->tv_sec); ++ if (usec) snprintf(buf, buflen, "%ld.%.6ld", (long)tv->tv_sec, (long)tv->tv_usec); ++ else snprintf(buf, buflen, "%ld", (long)tv->tv_sec); + } + else { + time1 = tv->tv_sec; diff --git a/net-mgmt/pmacct/files/patch-src_sql__common.c b/net-mgmt/pmacct/files/patch-src_sql__common.c new file mode 100644 index 000000000000..d8d5d82a8e1c --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_sql__common.c @@ -0,0 +1,13 @@ +--- src/sql_common.c.orig 2020-05-10 13:57:54 UTC ++++ src/sql_common.c +@@ -126,8 +126,8 @@ void sql_init_global_buffers() + lru_tail = &lru_head; + + Log(LOG_INFO, "INFO ( %s/%s ): cache entries=%d base cache memory=%luu bytes\n", config.name, config.type, +- config.sql_cache_entries, ((config.sql_cache_entries * sizeof(struct db_cache)) + +- (2 * (qq_size * sizeof(struct db_cache *))))); ++ config.sql_cache_entries, (unsigned long) ((config.sql_cache_entries * sizeof(struct db_cache)) + ++ (2 * (qq_size * sizeof(struct db_cache *)))) ); + + pipebuf = (unsigned char *) malloc(config.buffer_size); + sql_cache = (struct db_cache *) malloc(config.sql_cache_entries*sizeof(struct db_cache)); diff --git a/net-mgmt/pmacct/files/patch-src_sql__common.h b/net-mgmt/pmacct/files/patch-src_sql__common.h new file mode 100644 index 000000000000..934a90351a0e --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_sql__common.h @@ -0,0 +1,11 @@ +--- src/sql_common.h.orig 2020-02-22 20:28:47 UTC ++++ src/sql_common.h +@@ -64,7 +64,7 @@ + #define SQL_TABLE_VERSION_BGP 1000 + + /* macros */ +-#define SPACELEFT(x) (sizeof(x)-strlen(x)) ++#define SPACELEFT(x) (sizeof(x)-strlen(x)-1) + #define SPACELEFT_LEN(x,y) (sizeof(x)-y) + #define SPACELEFT_PTR(x,y) (y-strlen(x)) + diff --git a/net-mgmt/pmacct/files/patch-src_sqlite3__plugin.c b/net-mgmt/pmacct/files/patch-src_sqlite3__plugin.c new file mode 100644 index 000000000000..cb546d7bad45 --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_sqlite3__plugin.c @@ -0,0 +1,11 @@ +--- src/sqlite3_plugin.c.orig 2020-05-10 13:57:54 UTC ++++ src/sqlite3_plugin.c +@@ -537,7 +537,7 @@ void SQLI_cache_purge(struct db_cache *queue[], int in + if (pqq_ptr) goto start; + + idata->elap_time = time(NULL)-start; +- Log(LOG_INFO, "INFO ( %s/%s ): *** Purging cache - END (PID: %u, QN: %u/%u, ET: %lu) ***\n", ++ Log(LOG_INFO, "INFO ( %s/%s ): *** Purging cache - END (PID: %u, QN: %u/%u, ET: %zu) ***\n", + config.name, config.type, writer_pid, idata->qn, saved_index, idata->elap_time); + + if (config.sql_trigger_exec) { diff --git a/net-mgmt/pmacct/files/patch-src_util.c b/net-mgmt/pmacct/files/patch-src_util.c new file mode 100644 index 000000000000..2c9b8765fe73 --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_util.c @@ -0,0 +1,22 @@ +--- src/util.c.orig 2020-05-10 13:57:54 UTC ++++ src/util.c +@@ -1594,7 +1594,7 @@ void *pm_malloc(size_t size) + + obj = (unsigned char *) malloc(size); + if (!obj) { +- Log(LOG_ERR, "ERROR ( %s/%s ): Unable to grab enough memory (requested: %lu bytes). Exiting ...\n", ++ Log(LOG_ERR, "ERROR ( %s/%s ): Unable to grab enough memory (requested: %zu bytes). Exiting ...\n", + config.name, config.type, size); + exit_gracefully(1); + } +@@ -2010,8 +2010,8 @@ void compose_timestamp(char *buf, int buflen, struct t + if (buflen < VERYSHORTBUFLEN) return; + + if (since_epoch) { +- if (usec) snprintf(buf, buflen, "%ld.%.6ld", tv->tv_sec, (long)tv->tv_usec); +- else snprintf(buf, buflen, "%ld", tv->tv_sec); ++ if (usec) snprintf(buf, buflen, "%ld.%.6ld", (long)tv->tv_sec, (long)tv->tv_usec); ++ else snprintf(buf, buflen, "%ld", (long)tv->tv_sec); + } + else { + time1 = tv->tv_sec; |