--- boxes-1.0.1a.orig/debian/boxes-1.0.1.patch
+++ boxes-1.0.1a/debian/boxes-1.0.1.patch
@@ -0,0 +1,109 @@
+diff -Nru boxes-1.0.1.orig/src/lexer.l boxes-1.0.1/src/lexer.l
+--- boxes-1.0.1.orig/src/lexer.l	2000-03-18 00:53:59.000000000 +0100
++++ boxes-1.0.1/src/lexer.l	2006-06-15 02:47:12.507645100 +0200
+@@ -116,7 +116,6 @@
+     "$Id: lexer.l,v 1.17 1999/08/20 19:51:12 tsjensen Exp tsjensen $";
+ 
+ 
+-int yylineno = 1;
+ static int yyerrcnt = 0;
+ 
+ static char sdel = '\"';
+@@ -138,6 +137,7 @@
+ %option noyywrap
+ %option never-interactive
+ %option caseless
++%option noyylineno
+ 
+ 
+ %x SAMPLE
+@@ -468,7 +468,7 @@
+         exit (EXIT_FAILURE);
+     }
+     yy_delete_buffer (YY_CURRENT_BUFFER);
+-    YY_CURRENT_BUFFER = yy_create_buffer (yyin, sinf.st_size+10);
++    yy_switch_to_buffer (yy_create_buffer (yyin, sinf.st_size+10));
+ }
+ 
+ 
+diff -Nru boxes-1.0.1.orig/src/regexp/Makefile boxes-1.0.1/src/regexp/Makefile
+--- boxes-1.0.1.orig/src/regexp/Makefile	2000-03-18 00:54:00.000000000 +0100
++++ boxes-1.0.1/src/regexp/Makefile	2006-06-15 02:46:04.877614708 +0200
+@@ -32,7 +32,7 @@
+ #============================================================================
+ 
+ 
+-CFLAGS   = -traditional -O -I. $(CFLAGS_ADDTL)
++CFLAGS   = -O -I. $(CFLAGS_ADDTL)
+ 
+ ALL_CL   = regexp/regexp.c regexp/regsub.c
+ C_SRC    = $(notdir $(ALL_CL))
+diff -Nru boxes-1.0.1.orig/src/regexp/regexp.c boxes-1.0.1/src/regexp/regexp.c
+--- boxes-1.0.1.orig/src/regexp/regexp.c	2000-03-18 00:54:00.000000000 +0100
++++ boxes-1.0.1/src/regexp/regexp.c	2006-06-15 02:49:18.027413460 +0200
+@@ -23,6 +23,8 @@
+  * regular-expression syntax might require a total rethink.
+  */
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <regexp.h>
+ #include "regmagic.h"
+ 
+@@ -197,7 +199,6 @@
+ 	register char *longest;
+ 	register int len;
+ 	int flags;
+-	extern char *malloc();
+ 
+ 	if (exp == NULL)
+ 		FAIL("NULL argument");
+@@ -706,7 +707,6 @@
+ register char *string;
+ {
+ 	register char *s;
+-	extern char *strchr();
+ 
+ 	/* Be paranoid... */
+ 	if (prog == NULL || string == NULL) {
+@@ -805,7 +805,6 @@
+ {
+ 	register char *scan;	/* Current node. */
+ 	char *next;		/* Next node. */
+-	extern char *strchr();
+ 
+ 	scan = prog;
+ #ifdef DEBUG
+diff -Nru boxes-1.0.1.orig/src/regexp/regsub.c boxes-1.0.1/src/regexp/regsub.c
+--- boxes-1.0.1.orig/src/regexp/regsub.c	2000-03-18 00:54:00.000000000 +0100
++++ boxes-1.0.1/src/regexp/regsub.c	2006-06-15 02:50:13.361074690 +0200
+@@ -42,6 +42,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <string.h>
+ #include <regexp.h>
+ #include "regmagic.h"
+ 
+@@ -74,7 +75,6 @@
+     register int no;
+     register int len;
+     size_t fill;                         /* current number of chars in dest */
+-    extern char *strncpy();
+ 
+     if (prog == NULL || source == NULL || dest == NULL) {
+         regerror("NULL parm to regsub");
+diff -Nru boxes-1.0.1a.orig/Makefile boxes-1.0.1a/Makefile
+--- boxes-1.0.1a.orig/Makefile	2000-03-18 00:53:58.000000000 +0100
++++ boxes-1.0.1a/Makefile	2006-06-18 17:48:28.000000000 +0200
+@@ -51,8 +51,8 @@
+ 
+ 
+ # The following line (GLOBALCONF) is the only line you should need to edit!
+-GLOBALCONF = /usr/local/share/boxes
+-BVERSION   = 1.0.1
++GLOBALCONF = /etc/boxes/boxes-config
++BVERSION   = 1.0.1a
+ 
+ SNAPFILE   = boxes-SNAP-$(shell date +%Y%m%d)
+ WEBHOME    = $(HOME)/d/public_html/software/boxes
--- boxes-1.0.1a.orig/debian/dirs
+++ boxes-1.0.1a/debian/dirs
@@ -0,0 +1,2 @@
+usr/bin
+etc/boxes
--- boxes-1.0.1a.orig/debian/copyright
+++ boxes-1.0.1a/debian/copyright
@@ -0,0 +1,15 @@
+This package was debianized by
+KELEMEN Péter <fuji@debian.org>
+on Tue, 31 Aug 1999 21:57:17 +0200.
+
+It was downloaded from http://home.pages.de/~jensen/boxes/ .
+Current homepage is http://boxes.thomasjensen.com/ .
+
+Upstream Author: Thomas Jensen <tsjensen@stud.informatik.uni-erlangen.de>
+
+Copyright (C) 1999 Thomas Jensen <tsjensen@stud.informatik.uni-erlangen.de>
+
+boxes is released under the GNU GPL license as free, open source software.  
+
+On Debian GNU/Linux systems, the complete text of the GNU General Public
+License can be found in /usr/share/common-licenses/GPL .
--- boxes-1.0.1a.orig/debian/examples
+++ boxes-1.0.1a/debian/examples
@@ -0,0 +1 @@
+boxes-config
--- boxes-1.0.1a.orig/debian/changelog
+++ boxes-1.0.1a/debian/changelog
@@ -0,0 +1,100 @@
+boxes (1.0.1a-2.3.4.201403151106) ucs4-0-0-0; urgency=low
+
+  * UCS auto build. No patches were applied to the original source package
+
+ -- Univention builddaemon <buildd@univention.de>  Sat, 15 Mar 2014 11:06:23 +0100
+
+boxes (1.0.1a-2.3) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Use _GNU_SOURCE on GNU/kFreeBSD and GNU/Hurd, as suggested by Petr
+    Salinger, fixing FTBFS on those platforms (Closes: #401741).
+
+ -- Cyril Brulebois <kibi@debian.org>  Fri, 28 Aug 2009 05:07:07 +0200
+
+boxes (1.0.1a-2.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Adjust location for configuration file, it should be
+    /etc/boxes/boxes-config and not the directory /etc/boxes/
+    itself. (Closes: #374304, #384696)
+
+ -- Michael Prokop <mika@grml.org>  Sat, 20 Jan 2007 18:16:55 +0100
+
+boxes (1.0.1a-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Move configuration file to /etc (Closes: #374490)
+  * Add boxes-config to debian/examples
+
+ -- Julien Danjou <acid@debian.org>  Tue, 11 Jul 2006 13:56:12 +0200
+
+boxes (1.0.1a-2) unstable; urgency=low
+
+  * Global config is in /usr/share/boxes/. (Closes: #374304)
+
+ -- KELEMEN Peter <fuji@debian.org>  Sun, 18 Jun 2006 17:51:27 +0200
+
+boxes (1.0.1a-1) unstable; urgency=low
+
+  * Pristine source.
+  * Bumped Standards-Version: 3.7.2
+  * Bumped DH_COMPAT=4
+  * Assorted compile fixes. (Closes: #191178)
+  * New URL. (Closes: #348700)
+
+ -- KELEMEN Peter <fuji@debian.org>  Thu, 15 Jun 2006 14:40:16 +0200
+
+boxes (1.0.1-5) unstable; urgency=low
+
+  * Acknowledgning NMU bt Tore Anderson, thanks.
+  * debian/copyright
+    - Fixed URL.
+    - Fixed Upstream Authors.
+  * debian/control
+    - Standards-Version: 3.6.1
+    - Fixed Build-Depends: field.
+    - Fixed Maintainer: field.
+    - Fixed Description: field.
+
+ -- KELEMEN Péter <fuji@debian.org>  Sun, 15 Aug 2004 12:36:41 +0200
+
+boxes (1.0.1-4.1) unstable; urgency=low
+
+  * NMU (sponsored by joeyh)
+  * Build-Depend on flex-old instead of flex, closes: #191187.
+
+ -- Tore Anderson <tore@linpro.no>  Sat, 12 Jul 2003 21:10:04 +0200
+
+boxes (1.0.1-4) unstable; urgency=MEDIUM
+
+  * Modernized packaging (debhelper v3).
+  * (debian/control) Bumped Standards-Version: field to 3.5.6.
+  * #define _GNU_SOURCE decision based on #defined __GNUC__. (Closes: #106761)
+  * /usr/share/boxes/boxes: Removed bogus test designs. (Closes: #96301)
+
+ -- KELEMEN Peter <fuji@debian.org>  Fri, 19 Apr 2002 00:18:27 +0200
+
+boxes (1.0.1-3) unstable; urgency=low
+
+  * Fixed Build-Depends: *again*. (Closes: #95073)
+
+ -- KELEMEN Peter <fuji@debian.org>  Tue, 24 Apr 2001 13:27:37 +0200
+
+boxes (1.0.1-2) unstable; urgency=low
+
+  * Fixed Build-Depends:. (Closes: #70199)
+
+ -- KELEMEN Peter <fuji@debian.org>  Sun, 22 Apr 2001 00:45:43 +0200
+
+boxes (1.0.1-1) unstable; urgency=low
+
+  * New Upstream Release.
+
+ -- KELEMEN Peter <fuji@debian.org>  Wed, 26 Apr 2000 17:54:54 +0200
+
+boxes (1.0-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- KELEMEN Peter <fuji@debian.org>  Tue, 31 Aug 1999 21:57:17 +0200
--- boxes-1.0.1a.orig/debian/rules
+++ boxes-1.0.1a/debian/rules
@@ -0,0 +1,106 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+# This is the debhelper compatibility version to use.
+export DH_COMPAT=4
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+
+	touch configure-stamp
+
+
+build: patch-stamp build-stamp
+
+build-stamp: configure-stamp 
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE)
+	#/usr/bin/docbook-to-man debian/boxes.sgml > boxes.1
+
+	touch build-stamp
+
+patch-stamp:
+	patch -p1 < debian/boxes-1.0.1.patch
+	touch patch-stamp
+
+unpatch-stamp:
+	if [ -f patch-stamp ]; then patch -R -p1 < debian/boxes-1.0.1.patch; rm patch-stamp; fi
+
+clean: unpatch-stamp
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+
+	# Add here commands to clean up after the build process.
+	-$(MAKE) clean
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Add here commands to install the package into debian/boxes.
+	# $(MAKE) install DESTDIR=$(CURDIR)/debian/boxes
+	cp src/boxes $(CURDIR)/debian/boxes/usr/bin
+	cp boxes-config $(CURDIR)/debian/boxes/etc/boxes
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+#	dh_installdebconf	
+	dh_installdocs
+	dh_installexamples
+	dh_installmenu
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+#	dh_installinit
+	dh_installcron
+	dh_installman doc/boxes.1
+	dh_installinfo
+#	dh_undocumented
+	dh_installchangelogs 
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+#	dh_makeshlibs
+	dh_installdeb
+#	dh_perl
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
--- boxes-1.0.1a.orig/debian/control
+++ boxes-1.0.1a/debian/control
@@ -0,0 +1,14 @@
+Source: boxes
+Section: text
+Priority: optional
+Maintainer: KELEMEN Peter <fuji@debian.org>
+Standards-Version: 3.7.2
+Build-Depends: debhelper (>= 4.0.0), bison, flex
+
+Package: boxes
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Textmode box- and comment drawing filter
+ Boxes is extremely configurable filter for adding and removing ASCII art
+ (comments, for example) around chunks of text.  Most modern text editors
+ support filtering text through external filters.  Boxes is such a filter.
--- boxes-1.0.1a.orig/debian/docs
+++ boxes-1.0.1a/debian/docs
@@ -0,0 +1 @@
+README
--- boxes-1.0.1a.orig/src/config.h
+++ boxes-1.0.1a/src/config.h
@@ -41,7 +41,7 @@
 #define CONFIG_H
 
 
-#if defined(__linux__)
+#if defined(__linux__) || defined(__GLIBC__) || defined(__GNU__)
 
 #define _GNU_SOURCE
 
