--- debathena-machtype-9.4.0.orig/debian/compat
+++ debathena-machtype-9.4.0/debian/compat
@@ -0,0 +1 @@
+4
--- debathena-machtype-9.4.0.orig/debian/control.in
+++ debathena-machtype-9.4.0/debian/control.in
@@ -0,0 +1,12 @@
+Source: debathena-machtype
+Section: debathena/net
+Priority: extra
+Maintainer: Debian-Athena Project <debathena@mit.edu>
+Build-Depends: @cdbs@
+Standards-Version: 3.7.2
+
+Package: debathena-machtype
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Print Athena machine type to standard output
+ Print CPU type and hardware configuration information.
--- debathena-machtype-9.4.0.orig/debian/copyright
+++ debathena-machtype-9.4.0/debian/copyright
@@ -0,0 +1,20 @@
+The Athena source code was obtained from the Athena CVS repository at
+/afs/dev.mit.edu/source, and is licensed as follows:
+
+  Copyright 1996 by the Massachusetts Institute of Technology.
+
+  Permission to use, copy, modify, and distribute this
+  software and its documentation for any purpose and without
+  fee is hereby granted, provided that the above copyright
+  notice appear in all copies and that both that copyright
+  notice and this permission notice appear in supporting
+  documentation, and that the name of M.I.T. not be used in
+  advertising or publicity pertaining to distribution of the
+  software without specific, written prior permission.
+  M.I.T. makes no representations about the suitability of
+  this software for any purpose.  It is provided "as is"
+  without express or implied warranty.
+
+This Debian package was created as part of the Debian-Athena Project
+<http://web.mit.edu/debathena/www/> of the MIT Student Information
+Processing Board, and is released to the public domain.
--- debathena-machtype-9.4.0.orig/debian/control
+++ debathena-machtype-9.4.0/debian/control
@@ -0,0 +1,12 @@
+Source: debathena-machtype
+Section: debathena/net
+Priority: extra
+Maintainer: Debian-Athena Project <debathena@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), autotools-dev, debhelper (>= 4.2.0), autoconf, quilt, patchutils (>= 0.2.25), cdbs (>= 0.4.27-1)
+Standards-Version: 3.7.2
+
+Package: debathena-machtype
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Print Athena machine type to standard output
+ Print CPU type and hardware configuration information.
--- debathena-machtype-9.4.0.orig/debian/rules
+++ debathena-machtype-9.4.0/debian/rules
@@ -0,0 +1,56 @@
+#!/usr/bin/make -f
+
+DEB_AUTO_UPDATE_DEBIAN_CONTROL = 1
+DEB_AUTO_UPDATE_AUTOCONF = 1
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
+
+ATHENA_MAJOR_VERSION = 9
+ATHENA_MINOR_VERSION = 4
+
+DEBIAN_VERSION = $(shell dpkg-query --showformat='$${Version}' --show base-files)
+
+SYS_COMPAT=
+
+ifneq ($(shell dpkg --compare-versions $(DEBIAN_VERSION) '>=' '3.1' && echo y),y)
+    $(error Debian version $(DEBIAN_VERSION) is too old)
+endif
+
+ifeq ($(shell dpkg --compare-versions $(DEBIAN_VERSION) '>=' '4' && echo y),y)
+    ifeq ($(DEB_BUILD_ARCH),amd64)
+        SYS_COMPAT += amd64_deb40 i386_deb40 i386_rhel4
+    else
+        ifeq ($(DEB_BUILD_ARCH),i386)
+            SYS_COMPAT += i386_deb40 i386_rhel4
+        else
+            $(error Unrecognized architecture $(DEB_BUILD_ARCH))
+        endif
+    endif
+endif
+
+ifeq ($(shell dpkg --compare-versions $(DEBIAN_VERSION) '>=' '3.1' && echo y),y)
+    ifeq ($(DEB_BUILD_ARCH),amd64)
+        SYS_COMPAT += amd64_deb31 i386_deb31
+    else
+        ifeq ($(DEB_BUILD_ARCH),i386)
+            SYS_COMPAT += i386_deb31
+        else
+            $(error Unrecognized architecture $(DEB_BUILD_ARCH))
+        endif
+    endif
+endif
+
+SYS_COMPAT += i386_rhel3 i386_rh9 i386_linux24 i386_linux22 i386_linux3 i386_linux2 i386_linux1
+
+ATHENA_SYS = $(word 1, $(SYS_COMPAT))
+ATHENA_SYS_COMPAT = $(patsubst %:,%,$(subst : ,:,$(patsubst %,%:,$(wordlist 2, $(words $(SYS_COMPAT)), $(SYS_COMPAT)))))
+
+DEB_CONFIGURE_EXTRA_FLAGS += lbindir=/bin \
+	ATHENA_SYS=$(ATHENA_SYS) \
+	ATHENA_SYS_COMPAT=$(ATHENA_SYS_COMPAT) \
+	ATHENA_MAJOR_VERSION=$(ATHENA_MAJOR_VERSION) \
+	ATHENA_MINOR_VERSION=$(ATHENA_MINOR_VERSION)
+
+clean::
+	rm -f configure
--- debathena-machtype-9.4.0.orig/debian/patches/series
+++ debathena-machtype-9.4.0/debian/patches/series
@@ -0,0 +1,2 @@
+machtype-lspci-path.patch
+machtype-disk-memory.patch
--- debathena-machtype-9.4.0.orig/debian/patches/machtype-lspci-path.patch
+++ debathena-machtype-9.4.0/debian/patches/machtype-lspci-path.patch
@@ -0,0 +1,22 @@
+Index: debathena-machtype-9.4.0/machtype_linux.sh
+===================================================================
+--- debathena-machtype-9.4.0.orig/machtype_linux.sh	2007-01-30 22:38:29.000000000 -0500
++++ debathena-machtype-9.4.0/machtype_linux.sh	2007-01-30 22:46:18.000000000 -0500
+@@ -19,7 +19,7 @@
+ #  -P     : print out Athena System packs (from /srvd/.rvdinfo)
+ #  -S     : Print out the Athena System name
+ 
+-PATH=/bin:/usr/bin:/usr/sbin
++PATH=/bin:/usr/bin:/sbin:/usr/sbin
+ 
+ while getopts cdk:m:rvACELMNPS i; do
+ 	case "$i" in
+@@ -133,7 +133,7 @@
+ fi
+ 
+ if [ $display ] ; then
+-        /sbin/lspci | awk -F: '/VGA/ {print $3}' | sed -n -e 's/^ //' -e p
++	lspci | awk -F: '/VGA/ {print $3}' | sed -n -e 's/^ //' -e p
+ 	printed=1
+ fi
+ 
--- debathena-machtype-9.4.0.orig/debian/patches/machtype-disk-memory.patch
+++ debathena-machtype-9.4.0/debian/patches/machtype-disk-memory.patch
@@ -0,0 +1,35 @@
+--- debathena-machtype-9.4.0.orig/machtype_linux.sh	2007-04-19 22:00:41.000000000 -0400
++++ debathena-machtype-9.4.0/machtype_linux.sh	2007-11-05 16:16:43.000000000 -0500
+@@ -138,22 +138,22 @@
+ fi
+ 
+ if [ $rdsk ]; then
+-	awk '/^SCSI device/ { print; }
+-	     /^hd[a-z]:/ { print; }
+-	     /^Floppy/ { for (i=3; i <= NF; i += 3) print $i ": " $(i+2); }' \
+-	     /var/log/dmesg
++	for d in /sys/block/[fhs]d*; do
++	    echo $(basename "$d"): \
++		$(xargs -I @ expr @ '*' 8 / 15625 < "$d/size")MB \
++		$(cat "$d/device/model" ||
++		  cat "/proc/ide/$(basename "$d")/model")
++	done 2>/dev/null
+ 	printed=1
+ fi
+ 
+ if [ $memory ] ; then
+ 	if [ $verbose ]; then
+-		awk 'BEGIN { FS="[^0-9]+" }
+-		     /^Memory:/ { printf "user=%d, phys=%d (%d M)\n",
+-				         $2*1.024, $3*1.024, $3/1000; }' \
+-		    /var/log/dmesg
++		awk '/^MemTotal:/ { printf "user=%d, phys=%d (%d M)\n",
++					   $2, $2, $2/1024 }' \
++		    /proc/meminfo
+ 	else
+-		awk 'BEGIN { FS="[^0-9]+" }
+-		     /^Memory:/ { printf "%d\n", $3*1.024; }' /var/log/dmesg
++		awk '/^MemTotal:/ { printf "%d\n", $2 }' /proc/meminfo
+ 	fi
+ 	printed=1
+ fi
--- debathena-machtype-9.4.0.orig/debian/changelog
+++ debathena-machtype-9.4.0/debian/changelog
@@ -0,0 +1,39 @@
+debathena-machtype (9.4.0-0debathena6) unstable; urgency=low
+
+  * Get disk and memory information from /sys and /proc instead of
+    /var/log/dmesg.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Mon, 05 Nov 2007 16:18:58 -0500
+
+debathena-machtype (9.4.0-0debathena5) unstable; urgency=low
+
+  * Compute Debian version from the version of base-files instead of
+    /etc/debian_version.  This has the side effect that dapper and edgy 
+    no longer have a deb40 sysname.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 17 Jul 2007 18:29:55 -0400
+
+debathena-machtype (9.4.0-0debathena4) unstable; urgency=low
+
+  * Section: debathena/net.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 17 Jul 2007 06:33:53 -0400
+
+debathena-machtype (9.4.0-0debathena3) unstable; urgency=low
+
+  * Slight fix for conditional logic.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 10 Jul 2007 18:29:13 -0400
+
+debathena-machtype (9.4.0-0debathena2) unstable; urgency=low
+
+  * Pass ATHENA_SYS, ATHENA_SYS_COMPAT, ATHENA_MAJOR_VERSION, 
+    ATHENA_MINOR_VERSION to configure.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Thu, 19 Apr 2007 22:00:55 -0400
+
+debathena-machtype (9.4.0-0debathena1) unstable; urgency=low
+
+  * Initial release.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 30 Jan 2007 01:36:52 -0500
