Hi ports@,

Here is a diff to switch syslog-ng from net/GeoIP to net/libmaxminddb.
This adds support for using GeoIP2/GeoLite2 databases instead of the
deprecated GeoIP/GeoLite databases [1].

Compile tested only.

Comments? OK?

[1] 
https://blog.maxmind.com/2018/01/02/discontinuation-of-the-geolite-legacy-databases/

Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/syslog-ng/Makefile,v
retrieving revision 1.66
diff -u -p -r1.66 Makefile
--- Makefile    27 Sep 2019 10:52:42 -0000      1.66
+++ Makefile    11 Nov 2019 15:54:26 -0000
@@ -6,7 +6,7 @@ V =             3.12.1
 REL =          3.12
 DISTNAME =     syslog-ng-$V
 CATEGORIES =   sysutils
-REVISION =     6
+REVISION =     7
 
 MAINTAINER =   Steven Mestdagh <[email protected]>
 
@@ -15,8 +15,8 @@ HOMEPAGE =    https://syslog-ng.com/
 # GPL v2
 PERMIT_PACKAGE =               Yes
 
-WANTLIB =  GeoIP c crypto curl dbi evtlog glib-2.0 gmodule-2.0
-WANTLIB += gthread-2.0 iconv intl ivykis json-c m nghttp2 pcre pthread
+WANTLIB += c crypto curl dbi evtlog glib-2.0 gmodule-2.0 gthread-2.0
+WANTLIB += iconv intl ivykis json-c m maxminddb nghttp2 pcre pthread
 WANTLIB += ssl z
 
 MASTER_SITES = 
http://github.com/balabit/syslog-ng/releases/download/${DISTNAME}/
@@ -31,7 +31,7 @@ LIB_DEPENDS = devel/glib2 \
                sysutils/eventlog \
                databases/libdbi>=0.9.0 \
                net/curl \
-               net/GeoIP
+               net/libmaxminddb
 
 CONFIGURE_STYLE =      gnu
 CONFIGURE_ARGS +=      --disable-tcp-wrapper \
@@ -46,7 +46,8 @@ CONFIGURE_ARGS +=     --disable-tcp-wrapper 
                        --disable-stomp \
                        --disable-redis \
                        --disable-riemann \
-                       --enable-geoip \
+                       --disable-geoip \
+                       --enable-geoip2 \
                        --without-libnet \
                        --with-ivykis=system \
                        --with-libcurl=${LOCALBASE} \
@@ -54,7 +55,8 @@ CONFIGURE_ARGS +=     --disable-tcp-wrapper 
                        --enable-manpages
 
 CONFIGURE_ENV +=       OPENSSL_CFLAGS="-I/usr/include/openssl" \
-                       OPENSSL_LIBS="-lssl -lcrypto" 
+                       OPENSSL_LIBS="-lssl -lcrypto" \
+                       LDFLAGS="-L${LOCALBASE}/lib"
 # json-c only installs libjson-c.pc; syslog-ng checks for libjson.pc
 CONFIGURE_ENV +=       JSON_C_CFLAGS="`pkg-config json-c --cflags`" \
                        JSON_C_LIBS="`pkg-config json-c --libs`" \
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/sysutils/syslog-ng/pkg/PLIST,v
retrieving revision 1.23
diff -u -p -r1.23 PLIST
--- pkg/PLIST   10 Nov 2017 21:58:26 -0000      1.23
+++ pkg/PLIST   11 Nov 2019 15:54:26 -0000
@@ -1,4 +1,5 @@
 @comment $OpenBSD: PLIST,v 1.23 2017/11/10 21:58:26 steven Exp $
+@rcscript ${RCDIR}/syslog_ng
 @bin bin/dqtool
 @bin bin/loggen
 @bin bin/pdbtool
@@ -248,7 +249,7 @@ lib/syslog-ng/libcsvparser.so
 lib/syslog-ng/libdate.so
 lib/syslog-ng/libdbparser.so
 lib/syslog-ng/libdisk-buffer.so
-lib/syslog-ng/libgeoip-plugin.so
+lib/syslog-ng/libgeoip2-plugin.so
 lib/syslog-ng/libgraphite.so
 lib/syslog-ng/libhttp.so
 lib/syslog-ng/libjson-plugin.so
@@ -338,4 +339,3 @@ share/syslog-ng/xsd/patterndb-2.xsd
 share/syslog-ng/xsd/patterndb-3.xsd
 share/syslog-ng/xsd/patterndb-4.xsd
 share/syslog-ng/xsd/patterndb-5.xsd
-@rcscript ${RCDIR}/syslog_ng

Reply via email to