--- amideco-0.31e.orig/debian/dirs
+++ amideco-0.31e/debian/dirs
@@ -0,0 +1 @@
+usr/bin
--- amideco-0.31e.orig/debian/amideco.1
+++ amideco-0.31e/debian/amideco.1
@@ -0,0 +1,34 @@
+.TH AMIDECO 1 "August 22, 2006"
+.SH NAME
+amideco \- Decompress flashfiles equipped with an AMI BIOS
+.SH SYNOPSIS
+.B amideco
+.RB "filename"
+.RB [ "OPTIONS" ]
+.SH DESCRIPTION
+.B amideco
+is a program which can decompress BIOS images which contain an AMI BIOS.
+.SH OPTIONS
+.B \-l
+List BIOS structure.
+.PP
+.B \-x
+Extract BIOS modules.
+.PP
+.B \-d
+Create directory.
+.PP
+.B \-h
+Show help text and exit.
+.SH BUGS
+Please report any bugs to Anton Borisov <anton.borisov@gmail.com>.
+.SH LICENCE
+.B amideco
+is covered by the GNU General Public License (GPL), version 2 or later.
+Parts are covered by the GNU Lesser General Public License (LGPL),
+version 2.1 or later.
+.SH AUTHORS
+Anton Borisov <anton.borisov@gmail.com>
+.PP
+This manual page was written by Uwe Hermann <uwe@hermann-uwe.de>.
+It is licensed under the terms of the GNU GPL (version 2 or later).
--- amideco-0.31e.orig/debian/amideco.install
+++ amideco-0.31e/debian/amideco.install
@@ -0,0 +1 @@
+src/amideco usr/bin
--- amideco-0.31e.orig/debian/copyright
+++ amideco-0.31e/debian/copyright
@@ -0,0 +1,66 @@
+This package was debianized by Uwe Hermann <uwe@debian.org> on
+Sat, 12 Aug 2006 00:48:59 +0200.
+
+It was downloaded from: http://www.kaos.ru/biosgfx/
+
+Upstream Author:
+
+    Anton Borisov <anton.borisov@gmail.com>
+
+-------------------------------------------------------------------------------
+
+Copyright:
+
+    Copyright (C) 2000, 2003 Anton Borisov <anton.borisov@gmail.com>
+
+License:
+
+    This package 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 2 of the License, or
+    (at your option) any later version.
+
+    This package 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 package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+-------------------------------------------------------------------------------
+
+amifunc.c:
+
+Copyright:
+
+    Copyright (C) 2000, 2003 Anton Borisov <anton.borisov@gmail.com>
+
+License:
+
+     This package is free software; you can redistribute it and/or
+     modify it under the terms of the GNU Lesser General Public
+     License as published by the Free Software Foundation; either
+     version 2 of the License, or (at your option) any later version.
+
+     This package 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
+     Lesser General Public License for more details.
+
+     You should have received a copy of the GNU Lesser General Public
+     License along with this package; if not, write to the Free Software
+     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU Lesser General
+Public License can be found in `/usr/share/common-licenses/LGPL'.
+
+-------------------------------------------------------------------------------
+
+The Debian packaging is (C) 2006-2008, Uwe Hermann <uwe@debian.org> and
+is licensed under the GPL (version 2 or later), see above.
+
--- amideco-0.31e.orig/debian/changelog
+++ amideco-0.31e/debian/changelog
@@ -0,0 +1,33 @@
+amideco (0.31e-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * 30_hurd.diff. Fix FTBFS on GNU/Hurd. (Closes: #532695).
+  * 40_bad_table.diff. Fix compression flag. (Closes: #486265).
+  * 50_bad_output.diff. Fix bogus output. (Closes: #486085).
+    + Thanks to Bjørn Mork for the patches (40 and 50).
+
+ -- Barry deFreese <bdefreese@debian.org>  Wed, 23 Dec 2009 15:19:51 -0500
+
+amideco (0.31e-3) unstable; urgency=low
+
+  * Install the binary in /usr/bin, not /bin.
+  * Standards-Version: 3.7.3 (no changes required).
+  * debian/control: Add Homepage field.
+  * Honor the 'nostrip' build option (Closes: #436455).
+
+ -- Uwe Hermann <uwe@debian.org>  Sat, 09 Feb 2008 23:16:00 +0100
+
+amideco (0.31e-2) unstable; urgency=low
+
+  * Fix FTBFS on GNU/kFreeBSD (Closes: #414229).
+    Thanks Cyril Brulebois <cyril.brulebois@enst-bretagne.fr> for the patch.
+
+ -- Uwe Hermann <uwe@debian.org>  Sun, 08 Apr 2007 02:30:49 +0200
+
+amideco (0.31e-1) unstable; urgency=low
+
+  * Initial release (Closes: #385127).
+  * I wrote a manpage for amideco, as there was none upstream.
+
+ -- Uwe Hermann <uwe@debian.org>  Sat,  2 Sep 2006 17:22:03 +0200
+
--- amideco-0.31e.orig/debian/compat
+++ amideco-0.31e/debian/compat
@@ -0,0 +1 @@
+5
--- amideco-0.31e.orig/debian/rules
+++ amideco-0.31e/debian/rules
@@ -0,0 +1,11 @@
+#!/usr/bin/make -f
+  
+DEB_INSTALL_MANPAGES_amideco := debian/amideco.1
+
+include /usr/share/cdbs/1/class/makefile.mk
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/simple-patchsys.mk
+
+DEB_BUILDDIR := src
+DEB_MAKE_MAKEFILE := Makefile
+
--- amideco-0.31e.orig/debian/control
+++ amideco-0.31e/debian/control
@@ -0,0 +1,15 @@
+Source: amideco
+Section: utils
+Priority: optional
+Maintainer: Uwe Hermann <uwe@debian.org>
+Build-Depends: cdbs, debhelper (>= 5)
+Standards-Version: 3.7.3
+Homepage: http://www.kaos.ru/biosgfx/
+
+Package: amideco
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Decompress flashfiles equipped with an AMI BIOS
+ Amideco is a program which can decompress BIOS images which
+ contain an AMI BIOS.
+
--- amideco-0.31e.orig/debian/patches/20_kfreebsd.patch
+++ amideco-0.31e/debian/patches/20_kfreebsd.patch
@@ -0,0 +1,22 @@
+--- amideco-0.31e/src/amideco.h	2007-03-10 04:53:49.911669000 +0100
++++ amideco-0.31e/src/amideco.h	2007-03-10 04:54:05.000000000 +0100
+@@ -12,7 +12,7 @@
+ #include        <stdio.h>
+ #include        <stdlib.h>
+ 
+-#if defined(LINUX) || defined(__LINUX__) || defined(__linux__)
++#if defined(LINUX) || defined(__LINUX__) || defined(__linux__) || defined(__FreeBSD_kernel__)
+     #include    <memory.h>
+     #define     __LINUX_NOW__
+ #else
+--- amideco-0.31e/src/amifunc.c	2007-03-10 04:52:23.324381000 +0100
++++ amideco-0.31e/src/amifunc.c	2007-03-10 04:53:13.000000000 +0100
+@@ -10,7 +10,7 @@
+ #include        <stdio.h>
+ #include        <stdlib.h>
+ 
+-#if defined(LINUX) || defined(__LINUX__) || defined(__linux__)
++#if defined(LINUX) || defined(__LINUX__) || defined(__linux__) || defined(__FreeBSD_kernel__)
+     #include    <memory.h>
+     #define     __LINUX_NOW__
+ #else
--- amideco-0.31e.orig/debian/patches/40_bad_table.diff
+++ amideco-0.31e/debian/patches/40_bad_table.diff
@@ -0,0 +1,39 @@
+diff -Nur -x '*.orig' -x '*~' amideco-0.31e/src/amifunc.c amideco-0.31e.new/src/amifunc.c
+--- amideco-0.31e/src/amifunc.c	2009-12-23 15:23:04.000000000 -0500
++++ amideco-0.31e.new/src/amifunc.c	2009-12-23 15:23:41.000000000 -0500
+@@ -338,11 +338,11 @@
+                 part.PartID,
+                 PartTotal,
+                 GetModuleName(part.PartID),
+-                (part.IsComprs!=0x80)?(part.ROMSize):(part.CSize),
+-                (part.IsComprs!=0x80)?(part.ROMSize):(part.CSize),
+-                (part.IsComprs!=0x80)?(part.ExpSize):(part.CSize),
+-                (part.IsComprs!=0x80)?(part.ExpSize):(part.CSize),
+-                (part.IsComprs!=0x80)?(IDSign):(" "),
++                ((part.IsComprs&0x80)==0)?(part.ROMSize):(part.CSize),
++		((part.IsComprs&0x80)==0)?(part.ROMSize):(part.CSize),
++		((part.IsComprs&0x80)==0)?(part.ExpSize):(part.CSize),
++		((part.IsComprs&0x80)==0)?(part.ExpSize):(part.CSize),
++		((part.IsComprs&0x80)==0)?(IDSign):(" "),
+ 
+                 Offset-ConstOff
+                 );
+@@ -375,7 +375,7 @@
+                 interface.dicbit = 13;
+                 interface.method = 5;
+ 
+-                if(part.IsComprs!=0x80)
++                if((part.IsComprs&0x80)==0)
+                 decode(interface);
+                         else
+                         {
+@@ -384,6 +384,9 @@
+                                 fread(&Buf[0],1,1,ptx);
+                                 fwrite(&Buf[0],1,1,pto);
+                                 };
++				if(part.IsComprs!=0x80)
++					printf("WARNING: Ignoring unknown compression flag (0x%02x) for part id %02X\n", 
++					       part.IsComprs, part.PartID);
+                         }
+                 fclose(pto);
+                         break;
--- amideco-0.31e.orig/debian/patches/30_hurd.diff
+++ amideco-0.31e/debian/patches/30_hurd.diff
@@ -0,0 +1,24 @@
+diff -Nur -x '*.orig' -x '*~' amideco-0.31e/src/amideco.h amideco-0.31e.new/src/amideco.h
+--- amideco-0.31e/src/amideco.h	2009-06-10 14:14:06.000000000 -0400
++++ amideco-0.31e.new/src/amideco.h	2009-06-10 14:14:38.000000000 -0400
+@@ -12,7 +12,7 @@
+ #include        <stdio.h>
+ #include        <stdlib.h>
+ 
+-#if defined(LINUX) || defined(__LINUX__) || defined(__linux__) || defined(__FreeBSD_kernel__)
++#if defined(LINUX) || defined(__LINUX__) || defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
+     #include    <memory.h>
+     #define     __LINUX_NOW__
+ #else
+diff -Nur -x '*.orig' -x '*~' amideco-0.31e/src/amifunc.c amideco-0.31e.new/src/amifunc.c
+--- amideco-0.31e/src/amifunc.c	2009-06-10 14:14:06.000000000 -0400
++++ amideco-0.31e.new/src/amifunc.c	2009-06-10 14:14:24.000000000 -0400
+@@ -10,7 +10,7 @@
+ #include        <stdio.h>
+ #include        <stdlib.h>
+ 
+-#if defined(LINUX) || defined(__LINUX__) || defined(__linux__) || defined(__FreeBSD_kernel__)
++#if defined(LINUX) || defined(__LINUX__) || defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
+     #include    <memory.h>
+     #define     __LINUX_NOW__
+ #else
--- amideco-0.31e.orig/debian/patches/10_makefile.patch
+++ amideco-0.31e/debian/patches/10_makefile.patch
@@ -0,0 +1,13 @@
+--- src/Makefile.orig	2006-08-12 01:07:42.000000000 +0200
++++ src/Makefile	2006-08-12 01:08:12.000000000 +0200
+@@ -5,7 +5,9 @@
+ 
+ MAKE = make
+ 
+-amideco:
++all: amideco
++
++amideco: amifunc kernel
+ 	gcc amideco.c amifunc.o kernel.o -s -fpack-struct -o amideco
+ 
+ amifunc:
--- amideco-0.31e.orig/debian/patches/50_bad_output.diff
+++ amideco-0.31e/debian/patches/50_bad_output.diff
@@ -0,0 +1,66 @@
+diff -Nur -x '*.orig' -x '*~' amideco-0.31e/src/amideco.h amideco-0.31e.new/src/amideco.h
+--- amideco-0.31e/src/amideco.h	2009-12-23 15:27:01.000000000 -0500
++++ amideco-0.31e.new/src/amideco.h	2009-12-23 15:28:01.000000000 -0500
+@@ -11,6 +11,7 @@
+ 
+ #include        <stdio.h>
+ #include        <stdlib.h>
++#include        <stdint.h>
+ 
+ #if defined(LINUX) || defined(__LINUX__) || defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
+     #include    <memory.h>
+@@ -20,9 +21,9 @@
+     #include    <conio.h>
+ #endif
+ 
+-typedef unsigned char   byte;
+-typedef unsigned short  word;
+-typedef unsigned long   dword;
++typedef uint8_t   byte;
++typedef uint16_t  word;
++typedef uint32_t  dword;
+ 
+ #define Xtract  0x10
+ #define List    0x01
+diff -Nur -x '*.orig' -x '*~' amideco-0.31e/src/amifunc.c amideco-0.31e.new/src/amifunc.c
+--- amideco-0.31e/src/amifunc.c	2009-12-23 15:27:01.000000000 -0500
++++ amideco-0.31e.new/src/amifunc.c	2009-12-23 15:28:01.000000000 -0500
+@@ -9,6 +9,7 @@
+ 
+ #include        <stdio.h>
+ #include        <stdlib.h>
++#include        <stdint.h>
+ 
+ #if defined(LINUX) || defined(__LINUX__) || defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
+     #include    <memory.h>
+@@ -18,9 +19,9 @@
+     #include    <conio.h>
+ #endif
+ 
+-typedef unsigned char   byte;
+-typedef unsigned short  word;
+-typedef unsigned long   dword;
++typedef uint8_t   byte;
++typedef uint16_t  word;
++typedef uint32_t  dword;
+ 
+ #define Xtract  0x10
+ #define List    0x01
+@@ -244,7 +245,7 @@
+                                 "October",
+                                 "November",
+                                 "December"};
+-                byte Buf[20];
++                static byte Buf[20];
+                 sprintf(Buf,"%2.2s",year);
+ 
+                 if((atoi(Buf)>=0) && (atoi(Buf)<70)) sprintf(Buf,"%.2s %s %s%.2s",day,Months[atoi(mon)],"20",year);
+@@ -334,7 +335,7 @@
+ 
+                 case List:
+ 
+-printf("\n   %.2X %.2i (%17.17s)    %5.5lX (%6.5lu) => %5.5lX (%6.5lu)  %.2s   %5.5lXh",
++printf("\n   %.2X %.2i (%17.17s)    %5.5X (%6.5u) => %5.5X (%6.5u)  %.2s   %5.5Xh",
+                 part.PartID,
+                 PartTotal,
+                 GetModuleName(part.PartID),
--- amideco-0.31e.orig/debian/patches/15_honor_nostrip.patch
+++ amideco-0.31e/debian/patches/15_honor_nostrip.patch
@@ -0,0 +1,11 @@
+--- src/Makefile.orig	2008-02-09 23:11:35.000000000 +0100
++++ src/Makefile	2008-02-09 23:11:42.000000000 +0100
+@@ -8,7 +8,7 @@
+ all: amideco
+ 
+ amideco: amifunc kernel
+-	gcc amideco.c amifunc.o kernel.o -s -fpack-struct -o amideco
++	gcc amideco.c amifunc.o kernel.o -fpack-struct -o amideco
+ 
+ amifunc:
+ 	gcc amifunc.c -c -o amifunc.o -fpack-struct
