--- a56-1.3.orig/debian/bin2h.c
+++ a56-1.3/debian/bin2h.c
@@ -0,0 +1,65 @@
+/*
+ *  Copyright (C) 2008  Robert Millan
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main (int argc, char *argv[])
+{
+  int b, i, bytes_per_line;
+
+  if (argc != 2)
+    {
+      fprintf (stderr, "Usage: %s bytes_per_line\n", argv[0]);
+      exit (1);
+    }
+
+  bytes_per_line = atoi (argv[1]);
+
+  b = getchar ();
+  if (b == EOF)
+    goto abort;
+
+  printf ("/* THIS CHUNK OF BYTES IS AUTOMATICALY GENERATED */\n");
+
+  while (1)
+    {
+      printf ("0x%02x", b);
+
+      b = getchar ();
+      if (b == EOF)
+	goto end;
+
+      for (i = 0; i < bytes_per_line - 1; i++)
+	{
+	  printf (", 0x%02x", b);
+
+	  b = getchar ();
+	  if (b == EOF)
+	    goto end;
+	}
+
+      printf (",\n");
+    }
+
+end:
+  putchar ('\n');
+
+abort:
+  exit (0);
+}
--- a56-1.3.orig/debian/copyright
+++ a56-1.3/debian/copyright
@@ -0,0 +1,26 @@
+This package was debianized by Robert Millan <rmh@aybabtu.com> on
+Mon, 20 Oct 2008 15:03:37 +0000.
+
+It was downloaded from <http://www.zdomain.com/a56.html>
+
+Upstream Author:
+
+    Quinn C. Jensen
+
+Copyright:
+
+    Copyright (C) 1990-1998 Quinn C. Jensen
+
+License:
+
+    Permission to use, copy, modify, distribute, and sell this software
+    and its documentation for any purpose is hereby granted without fee,
+    provided that the above copyright notice appear in all copies and
+    that both that copyright notice and this permission notice appear
+    in supporting documentation.  The author makes no representations
+    about the suitability of this software for any purpose.  It is
+    provided "as is" without express or implied warranty.
+
+The Debian packaging is (C) 2008, Robert Millan <rmh@aybabtu.com> and
+is licensed under the GPL version 3 (or, at your option, any later version),
+see `/usr/share/common-licenses/GPL'.
--- a56-1.3.orig/debian/a56-tobin.c
+++ a56-1.3/debian/a56-tobin.c
@@ -0,0 +1,69 @@
+/*
+ *  Copyright (C) 2008  Robert Millan
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+int
+main (int argc, char *argv[])
+{
+  unsigned int offset, prev_offset = 0;
+  unsigned int native_value;
+  int fd;
+  uint8_t value[3];
+  char type;
+  char *line = NULL;
+  size_t zero = 0;
+
+  if (argc != 2)
+    {
+      fprintf (stderr, "Usage: %s output < input\n", argv[0]);
+      exit (1);
+    }
+
+  fd = open (argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);
+
+  while (getline (&line, &zero, stdin) != -1)
+    {
+      sscanf (line, "%c ", &type);
+
+      if (type != 'P')
+	continue;
+
+      sscanf (line + 2, "%x %x\n", &offset, &native_value);
+
+      value[0] = (native_value >> 16) & 0xff;
+      value[1] = (native_value >> 8) & 0xff;
+      value[2] = native_value & 0xff;
+
+      /* FIXME: Needed for linux/drivers/char/dsp56k.c.  Is this correct?  */
+      if (offset > 0x7000)
+        offset = prev_offset + 1;
+      
+      pwrite (fd, value, 3, (off_t) (offset * 3));
+
+      prev_offset = offset;
+    }
+
+  close (fd);
+
+  exit (0);
+}
--- a56-1.3.orig/debian/install
+++ a56-1.3/debian/install
@@ -0,0 +1,5 @@
+build-tree/a56		usr/bin
+build-tree/a56-keybld	usr/bin
+build-tree/a56-toomf	usr/bin
+debian/a56-tobin	usr/bin
+debian/bin2h		usr/bin
--- a56-1.3.orig/debian/manpages
+++ a56-1.3/debian/manpages
@@ -0,0 +1 @@
+a56.1
\ No newline at end of file
--- a56-1.3.orig/debian/dirs
+++ a56-1.3/debian/dirs
@@ -0,0 +1 @@
+usr/bin
--- a56-1.3.orig/debian/changelog
+++ a56-1.3/debian/changelog
@@ -0,0 +1,40 @@
+a56 (1.3-6) unstable; urgency=low
+
+  * QA upload, set maintainer to Debian QA group
+  * Fix typo (Closes: #503842)
+  * Add manpage created by Denis Briand (Closes: #579595)
+
+ -- Moritz Muehlenhoff <jmm@inutil.org>  Fri, 10 Jun 2011 00:32:20 +0200
+
+a56 (1.3-5) unstable; urgency=high
+
+  * patches/04_add_missing_prototypes.diff: Add missing prototypes for
+    alloc() and fixstring().  (Closes: #503698)
+  * bin2h.c: Refurbish CLI to make it more flexible.
+
+ -- Robert Millan <rmh@aybabtu.com>  Mon, 27 Oct 2008 21:39:44 +0100
+
+a56 (1.3-4) unstable; urgency=high
+
+  * Add bin2h for binary to C-header conversion.
+
+ -- Robert Millan <rmh@aybabtu.com>  Sun, 26 Oct 2008 17:00:38 +0100
+
+a56 (1.3-3) unstable; urgency=high
+
+  * Add a56- prefix to tobin, toomf and keybld.
+
+ -- Robert Millan <rmh@aybabtu.com>  Sun, 26 Oct 2008 13:54:06 +0100
+
+a56 (1.3-2) unstable; urgency=high
+
+  * Build-depend on bison.
+
+ -- Robert Millan <rmh@aybabtu.com>  Tue, 21 Oct 2008 17:35:19 +0200
+
+a56 (1.3-1) unstable; urgency=high
+
+  * Initial release.  (Closes: #502508)
+
+ -- Robert Millan <rmh@aybabtu.com>  Mon, 20 Oct 2008 15:03:37 +0000
+
--- a56-1.3.orig/debian/compat
+++ a56-1.3/debian/compat
@@ -0,0 +1 @@
+5
--- a56-1.3.orig/debian/rules
+++ a56-1.3/debian/rules
@@ -0,0 +1,16 @@
+#!/usr/bin/make -f
+
+DEB_TAR_SRCDIR = /
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/tarball.mk
+include /usr/share/cdbs/1/rules/simple-patchsys.mk
+include /usr/share/cdbs/1/class/makefile.mk
+
+pre-build::
+	chmod +w -R $(DEB_SRCDIR)
+
+build/a56:: debian/a56-tobin debian/bin2h
+
+clean::
+	rm -f debian/a56-tobin debian/bin2h
--- a56-1.3.orig/debian/control
+++ a56-1.3/debian/control
@@ -0,0 +1,15 @@
+Source: a56
+Section: devel
+Priority: extra
+Maintainer: Debian QA Group <packages@qa.debian.org>
+Build-Depends: cdbs, debhelper (>= 5), bison
+Standards-Version: 3.9.2
+Homepage: http://www.zdomain.com/a56.html
+
+Package: a56
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Motorola DSP56001 assembler
+ a56 is an assembler for the Motorola DSP56001 family of microcontrollers.
+ .
+ It is capable of compiling the firmware used in Linux' dsp56k.c driver.
--- a56-1.3.orig/debian/patches/01_keybld_not_in_path.diff
+++ a56-1.3/debian/patches/01_keybld_not_in_path.diff
@@ -0,0 +1,11 @@
+--- build-tree/Makefile~	1998-03-18 17:22:46.000000000 +0100
++++ build-tree/Makefile	2008-10-20 17:13:20.000000000 +0200
+@@ -84,7 +84,7 @@
+ lex.o:	lex.c gram.h
+ 
+ kparse.c:	a56.key keybld
+-	keybld < a56.key > kparse.c
++	./keybld < a56.key > kparse.c
+ 
+ gram.c gram.h:	a56.y
+ 	@echo "[expect 2 shift/reduce conflicts here]"
--- a56-1.3.orig/debian/patches/02_use_bison.diff
+++ a56-1.3/debian/patches/02_use_bison.diff
@@ -0,0 +1,11 @@
+--- build-tree/Makefile~	2008-10-20 17:29:33.000000000 +0200
++++ build-tree/Makefile	2008-10-21 17:34:22.000000000 +0200
+@@ -13,7 +13,7 @@
+ # generic unix
+ CC = cc
+ HOSTCC = cc
+-YACC = yacc
++YACC = bison -y
+ CCDEFS = -DLDEBUG
+ MV = mv
+ YTABC = y.tab.c
--- a56-1.3.orig/debian/patches/04_add_missing_prototypes.diff
+++ a56-1.3/debian/patches/04_add_missing_prototypes.diff
@@ -0,0 +1,33 @@
+diff -ur build-tree.old/a56.h build-tree/a56.h
+--- build-tree.old/a56.h	1995-01-28 18:51:07.000000000 +0100
++++ build-tree/a56.h	2008-10-27 21:38:46.000000000 +0100
+@@ -92,3 +92,6 @@
+ 
+ #define ASSERT(expr, str) \
+ 		if(expr) fprintf(stderr, "ASSERT: %s: line %d: %s\n", __FILE__, __LINE__, str);
++
++char *alloc (int size);
++char *fixstring (char *s);
+diff -ur build-tree.old/main.c build-tree/main.c
+--- build-tree.old/main.c	1995-06-12 14:12:49.000000000 +0200
++++ build-tree/main.c	2008-10-27 21:36:54.000000000 +0100
+@@ -39,7 +39,6 @@
+ FILE *obj = NULL;
+ extern BOOL list_on;
+ BOOL list_on_next = TRUE;
+-char *alloc();
+ 
+ main(argc,argv)
+ int argc;
+diff -ur build-tree.old/subs.c build-tree/subs.c
+--- build-tree.old/subs.c	1994-09-07 23:59:43.000000000 +0200
++++ build-tree/subs.c	2008-10-27 21:38:34.000000000 +0100
+@@ -30,8 +30,6 @@
+ 
+ #define MAX 1024
+ 
+-char *alloc();
+-
+ FILE *open_read(file)
+ char *file;
+ {
--- a56-1.3.orig/debian/patches/03_a56_prefixes.diff
+++ a56-1.3/debian/patches/03_a56_prefixes.diff
@@ -0,0 +1,55 @@
+--- build-tree/Makefile~	2008-10-26 13:45:49.000000000 +0100
++++ build-tree/Makefile	2008-10-26 13:47:37.000000000 +0100
+@@ -64,15 +64,15 @@
+ 
+ CFLAGS = $(DEBUG) $(DEFINES)
+ 
+-all:	keybld a56 toomf
++all:	a56-keybld a56 a56-toomf
+ 
+ a56:	$(OBJS)
+ 	$(CC) $(CFLAGS) -o a56 $(OBJS) -lm
+ 	@$(POSTPROCESS) a56
+ 
+-keybld:	keybld.o ksubs.o
+-	$(HOSTCC) $(CFLAGS) -o keybld keybld.o ksubs.o
+-	@$(POSTPROCESS) keybld
++a56-keybld:	keybld.o ksubs.o
++	$(HOSTCC) $(CFLAGS) -o $@ keybld.o ksubs.o
++	@$(POSTPROCESS) $@
+ 
+ keybld.o:	keybld.c
+ 	$(HOSTCC) $(CFLAGS) -c keybld.c
+@@ -83,8 +83,8 @@
+ 
+ lex.o:	lex.c gram.h
+ 
+-kparse.c:	a56.key keybld
+-	./keybld < a56.key > kparse.c
++kparse.c:	a56.key a56-keybld
++	./a56-keybld < a56.key > kparse.c
+ 
+ gram.c gram.h:	a56.y
+ 	@echo "[expect 2 shift/reduce conflicts here]"
+@@ -98,9 +98,9 @@
+ y.output:	a56.y
+ 	$(YACC) -v a56.y
+ 
+-toomf:	toomf.o
+-	$(CC) -o toomf $(CFLAGS) toomf.o
+-	@$(POSTPROCESS) toomf
++a56-toomf:	toomf.o
++	$(CC) -o $@ $(CFLAGS) toomf.o
++	@$(POSTPROCESS) $@
+ 
+ torom:	torom.o subs.o
+ 	$(CC) -o torom $(CFLAGS) torom.o subs.o
+@@ -110,7 +110,7 @@
+ 
+ main.o gram.o lex.o:	a56.h
+ 
+-clean:	; rm -f a56 toomf y.output *.o *.out tmp *.bak a56.tar.gz keybld
++clean:	; rm -f a56 a56-toomf y.output *.o *.out tmp *.bak a56.tar.gz a56-keybld
+ 
+ spotless:	clean
+ 	rm -f gram.c lexyy.c gram.h toktab.c kparse.c
