--- hwinfo-13.41.orig/debian/patches/kbd.c-tiocgdev_undefined
+++ hwinfo-13.41/debian/patches/kbd.c-tiocgdev_undefined
@@ -0,0 +1,18 @@
+Index: src/hd/kbd.c
+===================================================================
+--- src/hd/kbd.c.orig
++++ src/hd/kbd.c
+@@ -121,11 +121,13 @@
+   }
+ 
+   if(!dev && (fd = open(DEV_CONSOLE, O_RDWR | O_NONBLOCK | O_NOCTTY)) >= 0) {
++    /* Removing since TIOCGDEV isn't supported in the mainline kernel
+     if(ioctl(fd, TIOCGDEV, &u) != -1) {
+       tty_major = (u >> 8) & 0xfff;
+       tty_minor = (u & 0xff) | ((u >> 12) & 0xfff00);
+       ADD2LOG(DEV_CONSOLE ": major %u, minor %u\n", tty_major, tty_minor);
+     }
++    */
+ 
+     if(tty_major == 229 /* iseries hvc */) {
+       if (tty_minor >= 128) {
--- hwinfo-13.41.orig/debian/patches/series
+++ hwinfo-13.41/debian/patches/series
@@ -0,0 +1,6 @@
+hwinfo.8-strip_suse -p0
+new_archs -p0
+sparc_kioc -p0
+serial_struct -p0
+kbd.c-tiocgdev_undefined -p0
+cpu.c-alpha_bogo -p0
--- hwinfo-13.41.orig/debian/patches/new_archs
+++ hwinfo-13.41/debian/patches/new_archs
@@ -0,0 +1,19 @@
+Index: src/hd/hd.c
+===================================================================
+--- src/hd/hd.c.orig
++++ src/hd/hd.c
+@@ -142,6 +142,14 @@
+ #define HD_ARCH "hppa"
+ #endif
+ 
++#ifdef __mc68000__
++#define HD_ARCH "m68k"
++#endif
++
++#ifdef __powerpc64__
++#define HD_ARCH "ppc64"
++#endif
++
+ typedef struct disk_s {
+   struct disk_s *next;
+   unsigned crc;
--- hwinfo-13.41.orig/debian/patches/sparc_kioc
+++ hwinfo-13.41/debian/patches/sparc_kioc
@@ -0,0 +1,21 @@
+Index: src/hd/kbd.c
+===================================================================
+--- src/hd/kbd.c.orig
++++ src/hd/kbd.c
+@@ -45,7 +45,6 @@
+ typedef unsigned int u_int;
+ #endif
+ 
+-#include <asm/kbio.h>
+ #include <asm/openpromio.h>
+ #endif
+ 
+@@ -253,8 +252,6 @@
+ 
+   if((fd = open(DEV_KBD, O_RDWR | O_NONBLOCK | O_NOCTTY)) >= 0)
+     {
+-      if(ioctl(fd, KIOCTYPE, &kid)) kid = -1;
+-      if(ioctl(fd, KIOCLAYOUT, &klay)) klay = -1;
+       close(fd);
+ 
+       if(kid != -1)
--- hwinfo-13.41.orig/debian/patches/cpu.c-alpha_bogo
+++ hwinfo-13.41/debian/patches/cpu.c-alpha_bogo
@@ -0,0 +1,28 @@
+Index: src/hd/cpu.c
+===================================================================
+--- src/hd/cpu.c.orig
++++ src/hd/cpu.c
+@@ -104,6 +104,7 @@
+ #ifdef __alpha__
+   char model_id[80], system_id[80], serial_number[80], platform[80];
+   unsigned cpu_variation, cpu_revision, u, hz;
++  double bogo;
+   cpu_info_t *ct1;
+ #endif
+ 
+@@ -133,6 +134,7 @@
+ #ifdef __alpha__
+   *model_id = *system_id = *serial_number = *platform = 0;
+   cpu_variation = cpu_revision = hz = 0;
++  bogo = 0;
+ 
+   for(sl = hd_data->cpu; sl; sl = sl->next) {
+     if(sscanf(sl->str, "cpu model : %79[^\n]", model_id) == 1) continue;
+@@ -143,6 +145,7 @@
+     if(sscanf(sl->str, "cpus detected : %u", &cpus) == 1) continue;
+     if(sscanf(sl->str, "cycle frequency [Hz] : %u", &hz) == 1) continue;
+     if(sscanf(sl->str, "system variation : %79[^\n]", platform) == 1) continue;
++    if(sscanf(sl->str, "BogoMIPS : %lg", &bogo) == 1) continue;
+   }
+ 
+   if(*model_id || *system_id) {	/* at least one of those */
--- hwinfo-13.41.orig/debian/patches/serial_struct
+++ hwinfo-13.41/debian/patches/serial_struct
@@ -0,0 +1,31 @@
+Index: src/hd/kbd.c
+===================================================================
+--- src/hd/kbd.c.orig
++++ src/hd/kbd.c
+@@ -21,26 +21,6 @@
+ 
+ #ifdef __sparc__
+ 
+-struct serial_struct {
+-  int     type;
+-  int     line;
+-  unsigned long   port;
+-  int     irq;
+-  int     flags;
+-  int     xmit_fifo_size;
+-  int     custom_divisor;
+-  int     baud_base;
+-  unsigned short  close_delay;
+-  char    io_type;
+-  char    reserved_char[1];
+-  int     hub6;
+-  unsigned short  closing_wait; /* time to wait before closing */
+-  unsigned short  closing_wait2; /* no longer used... */
+-  unsigned char   *iomem_base;
+-  unsigned short  iomem_reg_shift;
+-  int     reserved[2];
+-};
+-
+ #ifdef DIET
+ typedef unsigned int u_int;
+ #endif
--- hwinfo-13.41.orig/debian/hwinfo.8
+++ hwinfo-13.41/debian/hwinfo.8
@@ -0,0 +1,46 @@
+.\" Process this file with
+.\" groff -man -Tascii hwinfo.8
+.\"
+.TH HWINFO 8 "SEPTEMBER 2006"
+.SH NAME
+hwinfo \- probe for hardware
+.SH SYNOPSIS
+.B hwinfo [ options ]
+.SH DESCRIPTION
+.B hwinfo
+is used to probe for the hardware present in the system.
+.SH OPTIONS
+.TP
+.B \-\^\-debug level
+The debug info is shown only in the log file.  If you specify a log file, the
+debug level is implicitly set to a reasonable value.
+.TP
+.B \-\^\-dump\-db n
+.RB "Dump hardware database, " n " is either " 0
+.RB " for the external database, or " 1 " for the internal database."
+.TP
+.B \-\^\-help
+Print a usage and exit.
+.TP
+.B \-\^\-log logfile
+Write info to logfile.
+.TP
+.B \-\^\-short
+Print a short listing.
+.TP
+.B \-\^\-<hwitem>
+Probe for the particular hardware item.  Available hardware items are:
+.B cdrom, floppy, disk, network, gfxcard, framebuffer, monitor, camera,
+.B storage-ctrl, netcard, printer, tv, dvb, scanner, braille, sys, bios,
+.B cpu, partition, usb-ctrl, usb, pci, isapnp, ide, scsi, bridge, hub,
+.B memory, smp, ppoe, all
+and
+.B reallyall.
+.SH BUGS
+Not all hardware can be detected.
+.SH AUTHOR
+\(md Steffen Winterfeldt snwint@suse.de - hwinfo
+.TP
+\(md Michal Svec msvec@suse.cz - man page
+.SH "SEE ALSO"
+discover (8).
--- hwinfo-13.41.orig/debian/copyright
+++ hwinfo-13.41/debian/copyright
@@ -0,0 +1,29 @@
+This package was debianized by Morten Werner Olsen <werner@skolelinux.no> on
+Sun, 30 May 2004 21:39:25 +0200.
+
+It was downloaded from:
+   http://mirrors.kernel.org/pub/opensuse/distribution/SL-OSS-factory/inst-source/suse/src/
+
+Copyright:
+
+   SuSE Linux AG, Nuernberg, Germany
+   (http://www.suse.de/feedback)
+
+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; version 2 dated June, 1991.
+
+   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'.
+
--- hwinfo-13.41.orig/debian/libhd13-doc.doc-base
+++ hwinfo-13.41/debian/libhd13-doc.doc-base
@@ -0,0 +1,9 @@
+Document: hwinfo
+Title: C hwinfo Library
+Section: Apps/Programming
+
+Format: HTML
+Index: /usr/share/doc/libhd13-doc/html/index.html
+Files: /usr/share/doc/libhd13-doc/html/*.html
+
+
--- hwinfo-13.41.orig/debian/TODO
+++ hwinfo-13.41/debian/TODO
@@ -0,0 +1,9 @@
+TODO for the hwinfo Debian package
+----------------------------------
+
+  * Write man-pages for check_hd, convert_hd, getsysinfo and mk_isdnhwdb.
+  * Include the binaries that isn't included, and maybe make it possible to
+    use hwinfo as the hardware detection tool that loads modules at boot.
+
+ -- Morten Werner Olsen <werner@skolelinux.no>  Sun, 30 May 2004 21:26:11 +0200
+
--- hwinfo-13.41.orig/debian/changelog
+++ hwinfo-13.41/debian/changelog
@@ -0,0 +1,280 @@
+hwinfo (13.41-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- William Vera <billy@billy.com.mx>  Thu, 09 Aug 2007 09:34:01 -0500
+
+hwinfo (13.39-1) unstable; urgency=low
+
+  * New upstream release
+  * Added command in debian/rules to erase .pc, related with quilt
+
+ -- William Vera <billy@billy.com.mx>  Wed, 01 Aug 2007 05:03:00 -0500
+
+hwinfo (13.35-2) unstable; urgency=low
+
+  * New maintainer (Closes: #412637).
+  * Changed deprecated variables at control file.
+
+ -- William Vera <billy@billy.com.mx>  Tue, 03 Jul 2007 01:16:03 -0500
+
+hwinfo (13.35-1) unstable; urgency=low
+
+  * New upstream releases.
+  * Refresh patches against new upstream
+  * Update debian/watch to handle multi-digit revisions of a single version of
+    the upstream source rpm.
+  * Orphan package.
+    - Set maintainer to Debian QA Group
+
+ -- James Vega <jamessan@debian.org>  Mon, 18 Jun 2007 20:54:02 +0100
+
+hwinfo (13.28-1) unstable; urgency=low
+
+  * New upstream releases.
+    - Fixes usage of x86 asm on non-x86 architectures
+      (Closes: #412713, #414723)
+
+ -- James Vega <jamessan@debian.org>  Tue, 13 Mar 2007 10:38:19 -0400
+
+hwinfo (13.23-1) unstable; urgency=low
+
+  * New upstream releases
+  * debian/rules: Add a get-orig-source target which fetches the upstream RPM
+    and repacks as a tarball.
+
+ -- James Vega <jamessan@debian.org>  Mon, 26 Feb 2007 07:24:26 -0500
+
+hwinfo (13.11-3) unstable; urgency=low
+
+  * Add cpu.c-alpha_bogo patch, which fixes a FTBFS on alpha because of an
+    undefined variable.
+
+ -- James Vega <jamessan@debian.org>  Fri,  3 Nov 2006 07:28:15 -0500
+
+hwinfo (13.11-2) unstable; urgency=low
+
+  * Stop shipping our own hwinfo manpage, and use a patched version of
+    upstream's.  The patch removes references to items that are SUSE-specific.
+
+ -- James Vega <jamessan@debian.org>  Thu,  2 Nov 2006 23:19:47 -0500
+
+hwinfo (13.11-1) unstable; urgency=low
+
+  * New upstream version.
+  * Re-add a previous patch (tiocgdev_undefined) which removes use of
+    TIOCGDEV, an ioctl that isn't supported in the mainline kernel anymore.
+
+ -- James Vega <jamessan@debian.org>  Thu,  2 Nov 2006 22:35:50 -0500
+
+hwinfo (13.4-1) unstable; urgency=low
+
+  * New upstream version.
+  * Switch from dbs to quilt
+    - Revamp debian/rules
+    - Add quilt and remove dbs from Build-Depends in debian/control
+  * Remove reference to hwscan(8) from manpage. (closes: #388245)
+  * Re-wrote manpage from scratch.  Drop docbook-to-man from Build-Depends.
+  * Remove NEWS.Debian since it is no longer applicable.
+
+ -- James Vega <jamessan@debian.org>  Thu, 28 Sep 2006 20:56:06 -0400
+
+hwinfo (13.3-3) unstable; urgency=low
+
+  * Add debian/patches/93_serial_struct to fix a FTBFS on sparc. Thanks Clint
+    Adams.  (closes: #387952)
+
+ -- James Vega <jamessan@debian.org>  Sun, 17 Sep 2006 13:56:18 -0400
+
+hwinfo (13.3-2) unstable; urgency=low
+
+  * debian/control:
+    - Move doxygen from Build-Depends-Indep to Build-Depends.
+      (closes: #387872)
+  * debian/copyright:
+    - Update the download URL.
+
+ -- James Vega <jamessan@debian.org>  Sun, 17 Sep 2006 09:30:12 -0400
+
+hwinfo (13.3-1) unstable; urgency=low
+
+  * New maintainer. (closes: #386035)
+  * New upstream releases.
+    - hwinfo --pci no longer lists everything as an ISDN adapter
+      (closes: #381387)
+  * debian/patches:
+    - Remove 01_sysfsutils2 and 02_sysfsutils2_s390, sysfs isn't used in the
+      new release.
+    - Remove 03_dbus-api-fix-thoenig, applied upstream.
+  * debian/control:
+    - Update maintainer address.
+    - Remove libsysfs-dev Build-Depends.
+    - Remove libhd13-dev's libsysfs-dev Depends.
+    - Add libhd13-doc package.
+    - Add doxygen Build-Depends-Indep.
+  * debian/rules:
+    - Add build/binary-indep to build libhd's documentation.
+  * Add debian/watch file.
+
+ -- James Vega <jamessan@debian.org>  Fri, 15 Sep 2006 01:15:00 -0400
+
+hwinfo (13.0-6) unstable; urgency=low
+
+  * Added patch from upstream to change dbus connection-close function.
+    Thanks to Sebastian Dröge for bugreport and patch. (Closes: #385527)
+
+ -- Morten Werner Olsen <werner@debian.org>  Mon,  4 Sep 2006 21:47:48 +0200
+
+hwinfo (13.0-5) unstable; urgency=low
+
+  * Fixed a cut'n'paste error in sysfsutils2 patch which caused all the PCI
+    interfaces to be reported as ISDN adapters. (Closes: #381387)
+  * Corrected a typo in debian/copyright (URL to .src.rpm).
+
+ -- Morten Werner Olsen <werner@debian.org>  Sun, 20 Aug 2006 13:34:08 +0200
+
+hwinfo (13.0-4) unstable; urgency=low
+
+  * Patch src/hd/kbd.c to not include asm/kbio.h or use KIOC* defines
+    (thanks to Clint Adams). (Closes: #378653)
+
+ -- Morten Werner Olsen <werner@debian.org>  Tue, 18 Jul 2006 11:23:17 +0200
+
+hwinfo (13.0-3) unstable; urgency=low
+
+  * Added separate Section-fileds for libhd13 and libhd13-dev in
+    debian/control. Thanks to the Debian distribution maintenance software
+    for notifying me. :)
+
+ -- Morten Werner Olsen <werner@debian.org>  Sun, 16 Jul 2006 16:16:08 +0200
+
+hwinfo (13.0-2) unstable; urgency=low
+
+  * New sysfsutils2-patch for src/hd/s390.c to fix FTBFS on S/390.
+    (Closes: #377611)
+  * New patch to remove the redefine of serial_struct in src/hd/kbd.c.
+  * Added linux-kernel-headers to Build-Depends as it has some files needed
+    for at least Sparc.
+
+ -- Morten Werner Olsen <werner@debian.org>  Sun, 16 Jul 2006 15:12:43 +0200
+
+hwinfo (13.0-1) unstable; urgency=low
+
+  * New upstream release.
+  * Upstream is bumping the soname, so changing libhd12 and libhd12-dev
+    to libhd13 and libhd13-dev.
+  * Removed debian/patches/02_tiocgdev_undeclared as the TIOCGDEV is
+    commented out by upstream.
+  * Added patch from Steinar H. Gunderson and Filippo Giunchedi that ports
+    hwinfo to use sysfsutils2. Thanks a lot for this patch, Steinar and
+    Filippo! (Closes: #356352)
+
+ -- Morten Werner Olsen <werner@debian.org>  Sun,  9 Jul 2006 21:26:26 +0200
+
+hwinfo (12.9-2experimental1) experimental; urgency=low
+
+  * Added the libhd12 and libhd12-dev packages again. (Closes: #362865)
+  * Added Build-Dependency to perl (dbs-script in debian/rules).
+  * Bumped Standards-Version to 3.7.2 (no changes needed).
+
+ -- Morten Werner Olsen <werner@debian.org>  Sun,  4 Jun 2006 13:53:40 +0200
+
+hwinfo (12.9-2) unstable; urgency=low
+
+  * Added patch that prevents segfault on architectures where the size
+    of a pointer is greater than the size of an integer (thanks to
+    Dann Frazier). (Closes: #356393)
+
+ -- Morten Werner Olsen <werner@debian.org>  Sun, 30 Apr 2006 23:00:25 +0200
+
+hwinfo (12.9-1) unstable; urgency=low
+
+  * New upstream release.
+     - Rewrote debian/patches/800_new_arches to debian/patches/80_new_archs
+       as some parts was included upstream and other parts is afaik not
+       needed.
+     - Removed debian/patches/810_gcc4_fix (fixed upstream).
+     - Removed debian/patches/820_amd64_fix (fixed upstream)
+  * Updated debian/copyright:
+     - Changed Copyright to License (thanks to Justin Pryzby).
+       (Closes: #290182)
+     - FSF's address (thanks to Lintian).
+  * Added Build-Dependency on libdbus-1-dev and libhal-dev.
+  * Now building against the new version of sysfsutils (2.0.0).
+    (Closes: #347633, #355335)
+  * Added debian/patches/01_sysfsutils with missing structs and functions
+    from old version of sysfsutils (thanks to Petter Reinholdtsen).
+  * Added debian/NEWS with info about the missing functionality due to the
+    changes in debian/patches/01_sysfsutils.
+  * Added debian/patches/02_tiocgdev_undefined which remove one test in a
+    serial console test where TIOCGDEV is used (a SuSE-specific thing). :/
+  * New maintainer email address. :)
+
+ -- Morten Werner Olsen <werner@debian.org>  Sat, 11 Mar 2006 09:25:08 +0100
+
+hwinfo (8.38-5) unstable; urgency=low
+
+  * The patches/820_amd64_fix seems to have disappeared. (Closes: #329185)
+
+ -- Morten Werner Olsen <werner@skolelinux.no>  Sat, 26 Nov 2005 23:18:52 +0100
+
+hwinfo (8.38-4) unstable; urgency=low
+
+  * Replaced 810_hppa_and_m68k_port with 800_new_archs which now includes
+    hppa, m68k, and ppc64 (thanks to Andreas Jochens).
+    (Closes: #304079, #329240)
+  * Added 810_gcc4_fix to make hwinfo build with gcc4 (thanks to
+    Andreas Johens). (Closes: #304079)
+  * Added 820_amd64_fix which fixes some assembly bugs with 64bit arch
+    (thanks to Andreas Johens). (Closes: #329185)
+  * Bumped Standards-Version to 3.6.2 (no changes).
+
+ -- Morten Werner Olsen <werner@skolelinux.no>  Mon, 14 Nov 2005 18:58:17 +0100
+
+hwinfo (8.38-3) unstable; urgency=low
+
+  * 810_hppa_and_m68k_port: replaced both occurances of __m68k__ with
+    __mc68000__ to make hwinfo build on m68k-archs (thanks to Adam Conrad).
+    (Closes: #270408)
+
+ -- Morten Werner Olsen <werner@skolelinux.no>  Tue,  5 Oct 2004 19:29:14 +0200
+
+hwinfo (8.38-2) unstable; urgency=low
+
+  * Removed conflicts to libhd, libhd-dev and libhd-doc to provide an easier
+    upgrade path.
+
+ -- Morten Werner Olsen <werner@skolelinux.no>  Mon,  2 Aug 2004 12:25:30 +0200
+
+hwinfo (8.38-1) unstable; urgency=low
+
+  * New upstream release.
+  * Major change: now building a static version of the hwinfo binary, and
+    dropping the libhd* packages due to upstream's way of maintaining the
+    otherwise shared library in the hwinfo package (thanks to my AM,
+    Michael Banck, for pointing out this problem for me).
+  * Added conflicts to libhd, libhd-dev and libhd-doc.
+  * Added man-page for hwinfo.
+  * Added patch to make hwinfo build on hppa and m68k (thanks to Joel Soete
+    and Martin-Ãric Racine). (Closes: #252298, #253673)
+  * Tried to improve package descriptions. (Closes: #245080)
+  * Removed the binary hwscan from the package.
+
+ -- Morten Werner Olsen <werner@skolelinux.no>  Mon,  5 Jul 2004 22:13:29 +0000
+
+hwinfo (7.30-2) unstable; urgency=low
+
+  * Moved /usr/lib/libhd.a and /usr/lib/libhd_tiny.a from libhd to libhd-dev.
+    (Thanks to Petter Reinholdtsen for pointing this out.)
+  * Added gcc option -D_REENTRANT to Makefile and Makefile.common
+    (debian/patches/010_makefile and debian/patches/020_makefile_common).
+  * Fixed a typo in debian/control (hdlib -> libhd).
+
+ -- Morten Werner Olsen <werner@skolelinux.no>  Sun, 18 Apr 2004 11:29:18 +0200
+
+hwinfo (7.30-1) unstable; urgency=low
+
+  * Initial Release. (Closes: #242208)
+
+ -- Morten Werner Olsen <werner@skolelinux.no>  Tue,  6 Apr 2004 09:50:03 +0200
+
--- hwinfo-13.41.orig/debian/libhd13-dev.install
+++ hwinfo-13.41/debian/libhd13-dev.install
@@ -0,0 +1,4 @@
+debian/tmp/usr/include/hd.h
+debian/tmp/usr/lib/libhd.a
+debian/tmp/usr/lib/libhd.so
+debian/tmp/usr/lib/pkgconfig/
--- hwinfo-13.41.orig/debian/watch
+++ hwinfo-13.41/debian/watch
@@ -0,0 +1,6 @@
+# Example watch control file for uscan
+# Rename this file to "watch" and then you can run the "uscan" command
+# to check for upstream updates and more.
+# Site		Directory		Pattern			Version	Script
+version=3
+ftp://mirrors.kernel.org/pub/opensuse/distribution/SL-OSS-factory/inst-source/suse/src/hwinfo-([\d.]+)-\d+.src.rpm
--- hwinfo-13.41.orig/debian/hwinfo.manpages
+++ hwinfo-13.41/debian/hwinfo.manpages
@@ -0,0 +1 @@
+doc/hwinfo.8
--- hwinfo-13.41.orig/debian/rules
+++ hwinfo-13.41/debian/rules
@@ -0,0 +1,128 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+#
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+#
+# Modified to make a template file for a multi-binary package with separated
+# build-arch and build-indep targets  by Bill Allombert 2001
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+export QUILT_PATCHES=debian/patches
+export QUILT_DIFF_ARGS="--no-timestamps -p 0"
+export QUILT_REFRESH_ARGS="--no-timestamps -p 0"
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
+
+UPURL=ftp://mirrors.kernel.org/pub/opensuse/distribution/SL-OSS-factory/inst-source/suse/src/
+UPVERSION=$(shell dpkg-parsechangelog | grep '^Version' | sed -e 's/^[^ ]* //' -e 's/-[^-]*$$//')
+
+get-orig-source:
+	@dh_testdir
+	@if [ ! -d ../tarballs ]; then \
+	  mkdir ../tarballs; \
+	fi
+	@if [ ! -e ../tarballs/hwinfo_$(UPVERSION).orig.tar.gz ]; then \
+	  echo "Fetching hwinfo $(UPVERSION)..."; \
+	  for f in $$(w3m -dump $(UPURL) | grep -o 'hwinfo-$(UPVERSION)-[[:digit:]]\+.src.rpm' | tail -n 1); do \
+	    cd ../tarballs && wget -q -O $$f $(UPURL)$$f; \
+	    echo "Repacking RPM as a tarball..."; \
+	    alien -d --nopatch -s $$f >/dev/null 2>&1; \
+	    bzcat hwinfo-$(UPVERSION)/hwinfo-$(UPVERSION).tar.bz2 | gzip -c - > hwinfo_$(UPVERSION).orig.tar.gz; \
+	    rm -rf hwinfo-$(UPVERSION) $$f; \
+	  done; \
+	fi
+
+patch: patch-stamp
+patch-stamp:
+	dh_testdir
+	quilt push -a
+	touch $@
+
+
+#Architecture 
+build: build-arch build-indep
+
+build-arch: build-arch-stamp
+build-arch-stamp: patch-stamp 
+	$(MAKE)
+	touch $@
+
+build-indep: build-indep-stamp
+build-indep-stamp: patch-stamp 
+	$(MAKE) doc
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-arch-stamp build-indep-stamp patch-stamp
+	
+	[ ! -f Makefile ] || $(MAKE) distclean
+
+	-quilt pop -a
+	rm -rf .pc
+	
+	dh_clean 
+
+install: install-indep install-arch
+install-indep:
+	dh_testdir
+	dh_testroot
+	dh_clean -k -i 
+	dh_installdirs -i
+	
+	dh_install -i doc/libhd/html usr/share/doc/libhd13-doc
+
+install-arch:
+	dh_testdir
+	dh_testroot
+	dh_clean -k -s 
+	dh_installdirs -s
+	
+	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
+	install -D -m 644 src/libhd.a debian/tmp/usr/lib/libhd.a
+	
+	dh_install -s
+# Must not depend on anything. This is to be called by
+# binary-arch/binary-indep
+# in another 'make' thread.
+binary-common:
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs Changelog
+	dh_installdocs
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress 
+	dh_fixperms
+	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+# Build architecture independant packages using the common target.
+binary-indep: build-indep install-indep
+	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+
+# Build architecture dependant packages using the common target.
+binary-arch: build-arch install-arch
+	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
+
+binary: binary-arch binary-indep
+.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch patch get-orig-source
--- hwinfo-13.41.orig/debian/control
+++ hwinfo-13.41/debian/control
@@ -0,0 +1,81 @@
+Source: hwinfo
+Section: admin
+Priority: optional
+Maintainer: William Vera <billy@billy.com.mx>
+Build-Depends: debhelper (>= 4.0.0), quilt, perl, flex, libdbus-1-dev, libhal-dev, linux-kernel-headers, doxygen
+Standards-Version: 3.7.2
+
+Package: hwinfo
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Hardware identification system
+ hwinfo is the hardware detection tool used in SuSE Linux.
+ .
+ In Debian-Edu (Skolelinux) hwinfo has shown better results than discover when
+ detecting mouse, keyboard and monitor.
+ .
+ hwinfo collects information about the hardware installed on a system.  Among
+ others, libhd contains information about cdrom, zip, floppy, disks and
+ partitions, network card, graphics card, monitor, camera, mouse, sound, pppoe,
+ isdn, modem, printer, scanner, bios, cpu, usb, memory and smp.
+ .
+ This package does not include the binaries hwscan, hwscand and hwscanqueue. If
+ you think one or more of these should be included in the package, please
+ contact the maintainer at hwinfo@packages.debian.org.
+
+Package: libhd13
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Hardware identification system library
+ hwinfo is the hardware detection tool used in SuSE Linux.
+ .
+ In Debian-Edu (Skolelinux) hwinfo has shown better results than discover when
+ detecting mouse, keyboard and monitor.
+ .
+ hwinfo collects information about the hardware installed on a system.  Among
+ others, libhd contains information about cdrom, zip, floppy, disks and
+ partitions, network card, graphics card, monitor, camera, mouse, sound, pppoe,
+ isdn, modem, printer, scanner, bios, cpu, usb, memory and smp.
+ .
+ This package contains the shared library from the hwinfo package.
+
+Package: libhd13-doc
+Section: doc
+Architecture: all
+Suggests: doc-base
+Enhances: libhd13-dev
+Description: Hardware identification system library documentation
+ hwinfo is the hardware detection tool used in SuSE Linux.
+ .
+ In Debian-Edu (Skolelinux) hwinfo has shown better results than discover when
+ detecting mouse, keyboard and monitor.
+ .
+ hwinfo collects information about the hardware installed on a system.  Among
+ others, libhd contains information about cdrom, zip, floppy, disks and
+ partitions, network card, graphics card, monitor, camera, mouse, sound, pppoe,
+ isdn, modem, printer, scanner, bios, cpu, usb, memory and smp.
+ .
+ This package contains the documentation for the libhd13-dev package.
+
+Package: libhd13-dev
+Section: libdevel
+Architecture: any
+Depends: libhd13 (= ${binary:Version}), libdbus-1-dev (>= 0.61), libhal-dev (>= 0.5)
+Suggests: libhd13-doc
+Provides: libhd12-dev
+Replaces: libhd12-dev
+Conflicts: libhd12-dev
+Description: Hardware identification system library and headers
+ hwinfo is the hardware detection tool used in SuSE Linux.
+ .
+ In Debian-Edu (Skolelinux) hwinfo has shown better results than discover when
+ detecting mouse, keyboard and monitor.
+ .
+ hwinfo collects information about the hardware installed on a system.  Among
+ others, libhd contains information about cdrom, zip, floppy, disks and
+ partitions, network card, graphics card, monitor, camera, mouse, sound, pppoe,
+ isdn, modem, printer, scanner, bios, cpu, usb, memory and smp.
+ .
+ This package contains the static library and header files from the hwinfo
+ package.
--- hwinfo-13.41.orig/debian/hwinfo.install
+++ hwinfo-13.41/debian/hwinfo.install
@@ -0,0 +1 @@
+debian/tmp/usr/sbin/hwinfo
--- hwinfo-13.41.orig/debian/libhd13.install
+++ hwinfo-13.41/debian/libhd13.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/libhd.so.*
--- hwinfo-13.41.orig/debian/README.Debian
+++ hwinfo-13.41/debian/README.Debian
@@ -0,0 +1,12 @@
+hwinfo for Debian
+-----------------
+
+The source for this package was downloaded from Suse's FTP-archives:
+http://ftp.opensuse.org/pub/opensuse/distribution/SL-OSS-factory/inst-source/suse/src/hwinfo-13.0-2.src.rpm
+
+This package does not include the binaries hwscan, hwscand and
+hwscanqueue. If you miss one of those, please contact the maintainer at
+hwinfo@packages.debian.org.
+
+ -- Morten Werner Olsen <werner@debian.org>, Sun,  9 Jul 2006 14:12:04 +0200
+
--- hwinfo-13.41.orig/debian/compat
+++ hwinfo-13.41/debian/compat
@@ -0,0 +1 @@
+4
