diff -u proxytunnel-1.9.0/Makefile proxytunnel-1.9.0/Makefile
--- proxytunnel-1.9.0/Makefile
+++ proxytunnel-1.9.0/Makefile
@@ -16,9 +16,6 @@
 # Most systems
 OPTFLAGS += -DSETPROCTITLE -DSPT_TYPE=2
 
-# Comment if you don't have this flag
-OPTFLAGS += -DSO_REUSEPORT
-
 # System dependant blocks... if your system is listed below, uncomment
 # the relevant lines
 
diff -u proxytunnel-1.9.0/debian/changelog proxytunnel-1.9.0/debian/changelog
--- proxytunnel-1.9.0/debian/changelog
+++ proxytunnel-1.9.0/debian/changelog
@@ -1,3 +1,11 @@
+proxytunnel (1.9.0-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix FTBFS on GNU/kFreeBSD. Thanks Steven Chamberlain.  (Closes:
+    #664470)
+
+ -- Robert Millan <rmh@debian.org>  Sat, 28 Apr 2012 14:26:37 +0200
+
 proxytunnel (1.9.0-3) unstable; urgency=low
 
   * Provide more useful error messages from GNUTLS
only in patch2:
unchanged:
--- proxytunnel-1.9.0.orig/debian/patches/series
+++ proxytunnel-1.9.0/debian/patches/series
@@ -0,0 +1 @@
+kfreebsd-gnu.diff
only in patch2:
unchanged:
--- proxytunnel-1.9.0.orig/debian/patches/kfreebsd-gnu.diff
+++ proxytunnel-1.9.0/debian/patches/kfreebsd-gnu.diff
@@ -0,0 +1,12 @@
+--- a/Makefile
++++ b/Makefile
+@@ -16,9 +16,6 @@
+ # Most systems
+ OPTFLAGS += -DSETPROCTITLE -DSPT_TYPE=2
+ 
+-# Comment if you don't have this flag
+-OPTFLAGS += -DSO_REUSEPORT
+-
+ # System dependant blocks... if your system is listed below, uncomment
+ # the relevant lines
+ 
only in patch2:
unchanged:
--- proxytunnel-1.9.0.orig/.pc/.version
+++ proxytunnel-1.9.0/.pc/.version
@@ -0,0 +1 @@
+2
only in patch2:
unchanged:
--- proxytunnel-1.9.0.orig/.pc/.quilt_series
+++ proxytunnel-1.9.0/.pc/.quilt_series
@@ -0,0 +1 @@
+series
only in patch2:
unchanged:
--- proxytunnel-1.9.0.orig/.pc/.quilt_patches
+++ proxytunnel-1.9.0/.pc/.quilt_patches
@@ -0,0 +1 @@
+debian/patches
only in patch2:
unchanged:
--- proxytunnel-1.9.0.orig/.pc/applied-patches
+++ proxytunnel-1.9.0/.pc/applied-patches
@@ -0,0 +1 @@
+kfreebsd-gnu.diff
only in patch2:
unchanged:
--- proxytunnel-1.9.0.orig/.pc/kfreebsd-gnu.diff/Makefile
+++ proxytunnel-1.9.0/.pc/kfreebsd-gnu.diff/Makefile
@@ -0,0 +1,78 @@
+# Makefile for proxytunnel
+#
+# Please uncomment the appropriate settings
+
+CC ?= cc
+CFLAGS ?= -Wall -O2 -ggdb
+
+OPTFLAGS = -DREV=$(shell ./getrev.sh)
+
+# Comment on non-gnu systems
+OPTFLAGS += -DHAVE_GETOPT_LONG
+
+# Comment if you don't have/want ssl
+OPTFLAGS += -DUSE_SSL
+
+# Most systems
+OPTFLAGS += -DSETPROCTITLE -DSPT_TYPE=2
+
+# Comment if you don't have this flag
+OPTFLAGS += -DSO_REUSEPORT
+
+# System dependant blocks... if your system is listed below, uncomment
+# the relevant lines
+
+# OpenBSD
+#OPTFLAGS += -DHAVE_SYS_PSTAT_H
+
+# DARWIN
+#OPTFLAGS += -DDARWIN
+
+# CYGWIN
+#OPTFLAGS += -DCYGWIN
+
+# SOLARIS
+#LDFLAGS += -lsocket -lnsl
+#LDFLAGS += -L/usr/local/ssl/lib	# Path to your SSL lib dir
+
+# END system dependant block
+
+SSL_LIBS := $(shell pkg-config --libs gnutls 2>/dev/null)
+SSL_LIBS += -lmhash
+LDFLAGS += $(SSL_LIBS)
+
+PREFIX =/usr/local
+BINDIR = $(PREFIX)/bin
+DATADIR = $(PREFIX)/share
+MANDIR = $(DATADIR)/man
+
+PROGNAME = proxytunnel
+
+# Remove strlcpy/strlcat on (open)bsd/darwin systems
+OBJ = proxytunnel.o	\
+	base64.o	\
+	strlcpy.o	\
+	strlcat.o	\
+	strzcat.o	\
+	setproctitle.o	\
+	io.o		\
+	http.o		\
+	basicauth.o	\
+	readpassphrase.o	\
+	messages.o	\
+	cmdline.o	\
+	ntlm.o		\
+	ptstream.o
+
+proxytunnel: $(OBJ)
+	$(CC) -o $(PROGNAME) $(CFLAGS) $(OPTFLAGS) $(OBJ) $(LDFLAGS)
+
+clean:
+	@rm -f $(PROGNAME) $(OBJ)
+
+install:
+	install -Dp -m0755 $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
+	install -Dp -m0644 $(PROGNAME).1 $(DESTDIR)$(MANDIR)/man1/$(PROGNAME).1
+
+.c.o:
+	$(CC) $(CFLAGS) $(OPTFLAGS) -c -o $@ $<
