--- cdecl-2.5.orig/cdecl.1
+++ cdecl-2.5/cdecl.1
@@ -274,7 +274,7 @@
 	<modifier>	::= short | long | unsigned | signed | <ptrmod>
 	<ptrmodlist>	::= <ptrmod> <ptrmodlist> | NOTHING
 	<ptrmod>	::= const | volatile | noalias
-	<storage>	::= auto | extern | register | auto
+	<storage>	::= auto | extern | register | static
 	<optstorage>	::= NOTHING | <storage>
 	<options>	::= NOTHING | <options>
 		| create | nocreate
--- cdecl-2.5.orig/Makefile
+++ cdecl-2.5/Makefile
@@ -15,9 +15,9 @@
 #
 # add -DUSE_READLINE	To compile in support for the GNU readline library.
 
-CFLAGS= -s -O2 -DUSE_READLINE
+CFLAGS= -g -O2 -DUSE_READLINE
 CC= gcc
-LIBS= -lreadline -ltermcap
+LIBS= -lreadline
 ALLFILES= makefile cdgram.y cdlex.l cdecl.c cdecl.1 testset testset++
 BINDIR= /usr/bin
 MANDIR= /usr/man/man1
@@ -26,7 +26,7 @@
 INSTALL_DATA= install -c -m 644
 
 cdecl: c++decl
-	ln c++decl cdecl
+	ln -s c++decl cdecl
 
 c++decl: cdgram.c cdlex.c cdecl.c
 	$(CC) $(CFLAGS) -o c++decl cdecl.c $(LIBS)
@@ -44,7 +44,7 @@
 
 install: cdecl
 	$(INSTALL) cdecl $(BINDIR)
-	ln $(BINDIR)/cdecl $(BINDIR)/c++decl
+	ln -s cdecl $(BINDIR)/c++decl
 	$(INSTALL_DATA) cdecl.1 $(MANDIR)
 	$(INSTALL_DATA) c++decl.1 $(MANDIR)
 
--- cdecl-2.5.orig/cdecl.c
+++ cdecl-2.5/cdecl.c
@@ -67,6 +67,7 @@
 # include <stddef.h>
 # include <string.h>
 # include <stdarg.h>
+# include <errno.h>
 #else
 # ifndef NOVARARGS
 #  include <varargs.h>
@@ -90,7 +91,7 @@
 #ifdef USE_READLINE
 # include <readline/readline.h>
   /* prototypes for functions related to readline() */
-  char * getline();
+  char * get_line();
   char ** attempt_completion(char *, int, int);
   char * keyword_completion(char *, int);
   char * command_completion(char *, int);
@@ -124,7 +125,6 @@
 
 #if __STDC__
   char *ds(char *), *cat(char *, ...), *visible(int);
-  int getopt(int,char **,char *);
   int main(int, char **);
   int yywrap(void);
   int dostdin(void);
@@ -375,7 +375,7 @@
 static char *line_read = NULL;
 
 /* Read a string, and return a pointer to it.  Returns NULL on EOF. */
-char * getline ()
+char * get_line ()
 {
   /* If the buffer has already been allocated, return the memory
      to the free pool. */
@@ -887,7 +887,7 @@
 
 	if (!quiet) (void) printf("Type `help' or `?' for help\n");
 	ret = 0;
-	while ((line = getline())) {
+	while ((line = get_line())) {
 	    if (!strcmp(line, "quit") || !strcmp(line, "exit")) {
 		free(line);
 		return ret;
--- cdecl-2.5.orig/debian/postrm
+++ cdecl-2.5/debian/postrm
@@ -0,0 +1,10 @@
+#!/bin/sh -e
+
+if [ "$1" = remove ]; then
+    dpkg-divert --package cdecl --remove --rename \
+	--divert /usr/bin/cdecl.cutils /usr/bin/cdecl
+    dpkg-divert --package cdecl --remove --rename \
+	--divert /usr/share/man/man1/cdecl.cutils.1.gz /usr/share/man/man1/cdecl.1.gz
+fi
+
+#DEBHELPER#
--- cdecl-2.5.orig/debian/dirs
+++ cdecl-2.5/debian/dirs
@@ -0,0 +1,3 @@
+usr/bin
+usr/share/man/man1
+
--- cdecl-2.5.orig/debian/copyright
+++ cdecl-2.5/debian/copyright
@@ -0,0 +1,8 @@
+This package was debianized by Fredrik Hallenberg <hallon@debian.org> on
+Wed,  7 Jul 1999 21:39:17 +0200.
+
+It was downloaded from ftp://ftp.cc.gatech.edu/pub/linux/devel/lang/c
+
+Upstream Author: David R. Conrad <conrad@detroit.freenet.org>
+
+In the public domain.
--- cdecl-2.5.orig/debian/changelog
+++ cdecl-2.5/debian/changelog
@@ -0,0 +1,77 @@
+cdecl (2.5-11.4.201403160944) ucs4-0-0-0; urgency=low
+
+  * UCS auto build. No patches were applied to the original source package
+
+ -- Univention builddaemon <buildd@univention.de>  Sun, 16 Mar 2014 09:44:32 +0100
+
+cdecl (2.5-11) unstable; urgency=low
+
+  * Applied patch from Colin Watson <cjwatson@ubuntu.com>:
+    Rename getline to get_line to avoid conflict with POSIX:2008.
+    (closes: #550373)
+    
+ -- Fredrik Hallenberg <hallon@debian.org>  Fri, 09 Oct 2009 18:57:29 +0200
+
+cdecl (2.5-10) unstable; urgency=low
+
+  * Removed dependency on libreadline5-dev.
+
+ -- Fredrik Hallenberg <hallon@debian.org>  Mon, 14 Sep 2009 07:33:01 +0200
+
+cdecl (2.5-9) unstable; urgency=low
+
+  * Fixed lintian warnings.
+  
+ -- Fredrik Hallenberg <hallon@debian.org>  Sun, 28 Dec 2008 14:45:04 +0100
+
+cdecl (2.5-8) unstable; urgency=low
+
+  * Build-depend on libreadline5-dev (closes: #326381)
+
+ -- Fredrik Hallenberg <hallon@debian.org>  Sun,  4 Sep 2005 13:11:23 +0200
+
+cdecl (2.5-7) unstable; urgency=low
+
+  * Applied patch from Mauro Antonio Persano <mpersano@gpnet.com.br>
+    to fix minor bug in cdecl manpage.
+  * Fixed spelling error in description (closes: #124487)
+  
+ -- Fredrik Hallenberg <hallon@debian.org>  Wed, 18 Jun 2003 18:37:38 +0200
+
+cdecl (2.5-6) unstable; urgency=low
+
+  * Fixed build problem (closes: #134470)
+  * Removed hard link
+
+ -- Fredrik Hallenberg <hallon@debian.org>  Sun, 17 Feb 2002 22:09:52 +0100
+
+cdecl (2.5-5) unstable; urgency=low
+
+  * Fixed diverts so that a correct man page filename is used.
+
+ -- Fredrik Hallenberg <hallon@debian.org>  Tue,  4 Jul 2000 12:49:22 +0200
+
+cdecl (2.5-4) frozen unstable; urgency=low
+
+  * Fixed build-depends (closes: #55757)
+
+ -- Fredrik Hallenberg <hallon@debian.org>  Thu, 20 Jan 2000 09:55:30 +0100
+
+cdecl (2.5-3) frozen unstable; urgency=low
+
+  * Updated man page divertion to avoid conflict with cutils. 
+    (closes: #55408)
+
+ -- Fredrik Hallenberg <hallon@debian.org>  Mon, 17 Jan 2000 10:44:30 +0100
+
+cdecl (2.5-2) unstable; urgency=low
+
+  * Recompile with new readline and ncurses.
+
+ -- Fredrik Hallenberg <hallon@debian.org>  Sun, 16 Jan 2000 14:03:11 +0100
+
+cdecl (2.5-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Fredrik Hallenberg <hallon@debian.org>  Wed,  7 Jul 1999 21:47:26 +0200
--- cdecl-2.5.orig/debian/compat
+++ cdecl-2.5/debian/compat
@@ -0,0 +1,2 @@
+7
+
--- cdecl-2.5.orig/debian/substvars
+++ cdecl-2.5/debian/substvars
@@ -0,0 +1 @@
+shlibs:Depends=libc6 (>= 2.3.5-1), libreadline4 (>= 4.3-1)
--- cdecl-2.5.orig/debian/rules
+++ cdecl-2.5/debian/rules
@@ -0,0 +1,64 @@
+#!/usr/bin/make -f
+#-*- makefile -*-
+# Made with the aid of dh_make, by Craig Small
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+# Some lines taken from debmake, by Christoph Lameter.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+
+	$(MAKE) 
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp install-stamp
+
+	[ ! -f Makefile ] || $(MAKE) clean
+
+	dh_clean
+
+install: install-stamp
+install-stamp: build-stamp
+	dh_testdir
+	dh_testroot
+	dh_clean
+	dh_installdirs
+
+	$(MAKE) install BINDIR=debian/cdecl/usr/bin MANDIR=debian/cdecl/usr/share/man/man1
+
+	touch install-stamp
+
+# 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_testversion
+	dh_testdir
+	dh_testroot
+	dh_installdocs README
+	dh_installman c++decl.1 cdecl.1
+	dh_installchangelogs 
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+source diff:                                                                  
+	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary
--- cdecl-2.5.orig/debian/control
+++ cdecl-2.5/debian/control
@@ -0,0 +1,17 @@
+Source: cdecl
+Section: devel
+Priority: optional
+Maintainer: Fredrik Hallenberg <hallon@debian.org>
+Standards-Version: 3.8.3.0
+Build-Depends: debhelper (>=7), bison, flex, libreadline-dev
+
+Package: cdecl
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Turn English phrases to C or C++ declarations
+ Cdecl is a program which will turn English-like phrases such as "declare
+ foo as array 5 of pointer to function returning int" into C declarations
+ such as "int (*foo[5])()". It can also translate the C into the pseudo-
+ English. And it handles typecasts, too. Plus C++. And in this version
+ it has command line editing and history with the GNU readline library.
+
--- cdecl-2.5.orig/debian/preinst
+++ cdecl-2.5/debian/preinst
@@ -0,0 +1,31 @@
+#!/bin/sh -e
+
+if [ "$1" = upgrade ]; then
+    if [ -n "`dpkg-divert --list | grep /usr/man/man1/cdecl.1.cutils`" ]; then
+        if [ -f /usr/man/man1/cdecl.1.gz ]; then
+    	    rm /usr/man/man1/cdecl.1.gz
+	fi
+        dpkg-divert --package cdecl --remove --rename \
+	    --divert /usr/man/man1/cdecl.1.cutils.gz /usr/man/man1/cdecl.1.gz
+        dpkg-divert --package cdecl --add --rename \
+   	    --divert /usr/share/man/man1/cdecl.cutils.1.gz /usr/share/man/man1/cdecl.1.gz
+    fi
+    if [ -n "`dpkg-divert --list | grep /usr/share/man/man1/cdecl.1.cutils`" ]; then
+        if [ -f /usr/share/man/man1/cdecl.1.gz ]; then
+    	    rm /usr/share/man/man1/cdecl.1.gz
+	fi
+        dpkg-divert --package cdecl --remove --rename \
+	    --divert /usr/share/man/man1/cdecl.1.cutils.gz /usr/share/man/man1/cdecl.1.gz
+        dpkg-divert --package cdecl --add --rename \
+   	    --divert /usr/share/man/man1/cdecl.cutils.1.gz /usr/share/man/man1/cdecl.1.gz
+    fi
+fi
+
+if [ "$1" = install ]; then
+    dpkg-divert --package cdecl --add --rename \
+	--divert /usr/bin/cdecl.cutils /usr/bin/cdecl
+    dpkg-divert --package cdecl --add --rename \
+	--divert /usr/share/man/man1/cdecl.cutils.1.gz /usr/share/man/man1/cdecl.1.gz
+fi
+
+#DEBHELPER#
