diff -r -N -u syslog-ng-devel.old/Makefile syslog-ng-devel/Makefile
--- syslog-ng-devel.old/Makefile	2012-11-17 07:01:47.000000000 +0100
+++ syslog-ng-devel/Makefile	2012-12-14 11:21:13.000000000 +0100
@@ -10,8 +10,8 @@
 CATEGORIES=	sysutils
 PKGNAMESUFFIX=	-devel
 DISTVERSION=	$(PORTVERSION:S/a/alpha/)
-DISTFILES=	$(PORTNAME)_$(DISTVERSION).tar.gz
-MASTER_SITES=	http://www.balabit.com/downloads/files/syslog-ng/sources/$(DISTVERSION)/source/
+DISTFILES=	syslog-ng-3.4.0alpha3-20121210-v3.4.0alpha3-176-gfded.tar.gz
+MASTER_SITES=	http://packages.madhouse-project.org/syslog-ng/3.4/3.4.0alpha3/
 
 MAINTAINER=	cy@FreeBSD.org
 COMMENT=	A powerful syslogd replacement
@@ -28,8 +28,7 @@
 		IPV6 "Build with IPV6 support" on \
 		PCRE "Build with PCRE support" on \
 		SMTP "Build with SMTP support" off \
-		JSON_C "Build with JSON-C support" off \
-		JSON_GLIB "Build with JSON-GLIB support" off \
+		JSON "Build with JSON-C support" off \
 
 .include <bsd.port.options.mk>
 
@@ -120,19 +119,10 @@
 CONFIGURE_ARGS+=	--disable-sql
 .endif
 
-.if defined(WITH_JSON_C) && defined(WITH_JSON_GLIB)
-BROKEN=		JSON_C and JSON_GLIB are mutually exclusive
-.endif
-
-.if defined(WITH_JSON_GLIB)
-LIB_DEPENDS+=		json-glib-1.0.0:${PORTSDIR}/devel/json-glib
-CONFIGURE_ARGS+=	--with-json=json-glib
-PLIST_FILES+=		lib/syslog-ng/libtfjson.la lib/syslog-ng/libtfjson.so
-.elif defined(WITH_JSON_C)
+.if defined(WITH_JSON)
 LIB_DEPENDS+=		json.0:${PORTSDIR}/devel/json-c
-CONFIGURE_ARGS+=	--with-json=json-c
-PLIST_FILES+=		lib/syslog-ng/libtfjson.la lib/syslog-ng/libtfjson.so
-PLIST_FILES+= 		lib/syslog-ng/libjsonparser.so lib/syslog-ng/libjsonparser.la
+CONFIGURE_ARGS+=	--enable-json
+PLIST_FILES+= 		lib/syslog-ng/libjson-plugin.la lib/syslog-ng/libjson-plugin.so
 .else
 CONFIGURE_ARGS+=        --disable-json
 .endif
@@ -144,13 +134,6 @@
 post-patch:
 	@${REINPLACE_CMD} -e 's:libnet-config:libnet115-config:g' ${WRKSRC}/configure
 	@${LN} ${WRKSRC}/scl/syslog-ng.conf ${WRKSRC}/scl/syslog-ng.conf.dist
-.if ${OSVERSION} >= 900007
-	@${REINPLACE_CMD} \
-		-e 's|utmp|utmpx|' -e 's|getutent|getutxent|' \
-		-e 's|ut_name|ut_user|' \
-		${WRKSRC}/configure ${WRKSRC}/modules/afuser/afuser.c \
-		${WRKSRC}/lib/utils.c ${WRKSRC}/lib/utils.h
-.endif
 
 post-install:
 .if !defined(NOPORTDOCS)
diff -r -N -u syslog-ng-devel.old/distinfo syslog-ng-devel/distinfo
--- syslog-ng-devel.old/distinfo	2012-07-04 21:57:19.000000000 +0200
+++ syslog-ng-devel/distinfo	2012-12-14 11:28:07.000000000 +0100
@@ -1,2 +1,2 @@
-SHA256 (syslog-ng_3.4.0alpha3.tar.gz) = a8534c72ffad7f74bcb96429580615ecbbf72895db3becee0ddacf6331167f10
-SIZE (syslog-ng_3.4.0alpha3.tar.gz) = 2623951
+SHA256 (syslog-ng-3.4.0alpha3-20121210-v3.4.0alpha3-176-gfded.tar.gz) = c7814d1145b9777c23eaeeead491e87f2f7f56d86074fe1f83f03cfc4f20b936
+SIZE (syslog-ng-3.4.0alpha3-20121210-v3.4.0alpha3-176-gfded.tar.gz) = 3320324
diff -r -N -u syslog-ng-devel.old/files/patch-libnet.in syslog-ng-devel/files/patch-libnet.in
--- syslog-ng-devel.old/files/patch-libnet.in	1970-01-01 01:00:00.000000000 +0100
+++ syslog-ng-devel/files/patch-libnet.in	2012-12-14 11:02:19.000000000 +0100
@@ -0,0 +1,62 @@
+From 04387b2f373337bb582acb68eb4facbc4f5b471f Mon Sep 17 00:00:00 2001
+From: Gergely Nagy <algernon@balabit.hu>
+Date: Wed, 12 Dec 2012 17:52:49 +0100
+Subject: [PATCH] afsocket: Fix compilation under various circumstances
+
+On at least FreeBSD, the libnet_t typedef in afinet-dest.h causes a
+compile time error, because the same typedef is made by libnet itself
+earlier.
+
+To work around the issue, only add the typedef if __LIBNET_H is
+undefined, and move the afinet-dest.h inclusion in afinet-dest.c after
+<libnet.h>.
+
+Reported-by: Peter Czanik <czanik@balabit.hu>
+Signed-off-by: Gergely Nagy <algernon@balabit.hu>
+---
+ modules/afsocket/afinet-dest.c |    3 ++-
+ modules/afsocket/afinet-dest.h |    2 ++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/modules/afsocket/afinet-dest.c b/modules/afsocket/afinet-dest.c
+index ef3270b..d8919a2 100644
+--- modules/afsocket/afinet-dest.c.old
++++ modules/afsocket/afinet-dest.c
+@@ -21,7 +21,6 @@
+  *
+  */
+ 
+-#include "afinet-dest.h"
+ #include "messages.h"
+ #include "misc.h"
+ #include "gprocess.h"
+@@ -48,6 +47,8 @@
+ #  define _GNU_SOURCE 1
+ #endif
+ 
++#include "afinet-dest.h"
++
+ void
+ afinet_dd_set_localip(LogDriver *s, gchar *ip)
+ {
+diff --git a/modules/afsocket/afinet-dest.h b/modules/afsocket/afinet-dest.h
+index 0a482c7..17f5e6c 100644
+--- modules/afsocket/afinet-dest.h.old
++++ modules/afsocket/afinet-dest.h
+@@ -29,11 +29,13 @@
+ 
+ #if ENABLE_SPOOF_SOURCE
+ 
++#ifndef __LIBNET_H
+ /* this forward declaration avoids having to include libnet, which requires
+  * ugly playing with macros, see that for yourself in the implementation
+  * file */
+ typedef struct libnet_context libnet_t;
+ #endif
++#endif
+ 
+ typedef struct _AFInetDestDriver
+ {
+-- 
+1.7.10
+
diff -r -N -u syslog-ng-devel.old/files/patch-modules-Makefile.in syslog-ng-devel/files/patch-modules-Makefile.in
--- syslog-ng-devel.old/files/patch-modules-Makefile.in	2012-04-05 22:29:58.000000000 +0200
+++ syslog-ng-devel/files/patch-modules-Makefile.in	1970-01-01 01:00:00.000000000 +0100
@@ -1,13 +0,0 @@
---- modules/Makefile.in.orig	2012-04-05 10:46:11.219706762 -0700
-+++ modules/Makefile.in	2012-04-05 12:45:02.702508603 -0700
-@@ -265,7 +265,9 @@
- top_build_prefix = @top_build_prefix@
- top_builddir = @top_builddir@
- top_srcdir = @top_srcdir@
--SUBDIRS = afsocket afsql afstreams affile afprog afuser afmongodb afsmtp csvparser confgen syslogformat pacctformat basicfuncs dbparser tfjson tfuuid jsonparser
-+# XXX Temporarily afsmtp build temporarily broken
-+# XXX SUBDIRS = afsocket afsql afstreams affile afprog afuser afmongodb afsmtp csvparser confgen syslogformat pacctformat basicfuncs dbparser tfjson tfuuid jsonparser
-+SUBDIRS = afsocket afsql afstreams affile afprog afuser afmongodb csvparser confgen syslogformat pacctformat basicfuncs dbparser tfjson tfuuid jsonparser
- all: all-recursive
- 
- .SUFFIXES:
diff -r -N -u syslog-ng-devel.old/pkg-plist syslog-ng-devel/pkg-plist
--- syslog-ng-devel.old/pkg-plist	2012-07-04 21:57:19.000000000 +0200
+++ syslog-ng-devel/pkg-plist	2012-12-14 11:23:02.000000000 +0100
@@ -35,6 +35,16 @@
 include/syslog-ng/logparser.h
 include/syslog-ng/logpipe.h
 include/syslog-ng/logproto.h
+include/syslog-ng/logproto-buffered-server.h
+include/syslog-ng/logproto-builtins.h
+include/syslog-ng/logproto-client.h
+include/syslog-ng/logproto-dgram-server.h
+include/syslog-ng/logproto-framed-client.h
+include/syslog-ng/logproto-framed-server.h
+include/syslog-ng/logproto-record-server.h
+include/syslog-ng/logproto-server.h
+include/syslog-ng/logproto-text-client.h
+include/syslog-ng/logproto-text-server.h
 include/syslog-ng/logqueue-fifo.h
 include/syslog-ng/logqueue.h
 include/syslog-ng/logreader.h
@@ -78,10 +88,14 @@
 lib/libsyslog-ng.so
 lib/libsyslog-ng-3.4.0alpha3.so
 libdata/pkgconfig/syslog-ng.pc
+lib/syslog-ng/libcryptofuncs.la
+lib/syslog-ng/libcryptofuncs.so
 lib/syslog-ng/libaffile.la
 lib/syslog-ng/libaffile.so
 lib/syslog-ng/libafmongodb.la
 lib/syslog-ng/libafmongodb.so
+lib/syslog-ng/libafamqp.la
+lib/syslog-ng/libafamqp.so
 lib/syslog-ng/libafprog.la
 lib/syslog-ng/libafprog.so
 lib/syslog-ng/libafsocket-notls.la
@@ -101,13 +115,12 @@
 lib/syslog-ng/libsyslog-ng-crypto.so
 lib/syslog-ng/libsyslogformat.la
 lib/syslog-ng/libsyslogformat.so
-lib/syslog-ng/libtfuuid.so
-lib/syslog-ng/libtfuuid.la
+lib/syslog-ng/libsystem-source.la
+lib/syslog-ng/libsystem-source.so
 share/include/scl/pacct/plugin.conf
 share/include/scl/syslogconf/README
 share/include/scl/syslogconf/convert-syslogconf.awk
 share/include/scl/syslogconf/plugin.conf
-share/include/scl/system/generate-system-source.sh
 share/include/scl/system/plugin.conf
 share/tools/cfg-grammar.y
 share/tools/lex-rules.am
