--- mcelog-0.9~pre+1git543dbb.orig/Makefile
+++ mcelog-0.9~pre+1git543dbb/Makefile
@@ -16,7 +16,7 @@
 # The on disk database has still many problems (partly in this code and partly
 # due to missing support from BIOS), so it's disabled by default. You can 
 # enable it here by uncommenting the following line
-# CONFIG_DISKDB = 1
+CONFIG_DISKDB = 1
 
 all: mcelog
 
@@ -26,7 +26,7 @@
        nehalem.o dunnington.o tulsa.o config.o memutil.o msg.o
 DISKDB_OBJ := diskdb.o dimm.o db.o
 CLEAN := mcelog dmi tsc dbquery .depend .depend.X dbquery.o ${DISKDB_OBJ}
-DOC := mce.pdf smbios.spec
+DOC := mce.pdf #smbios.spec
 
 ADD_DEFINES :=
 
--- mcelog-0.9~pre+1git543dbb.orig/debian/compat
+++ mcelog-0.9~pre+1git543dbb/debian/compat
@@ -0,0 +1 @@
+5
--- mcelog-0.9~pre+1git543dbb.orig/debian/docs
+++ mcelog-0.9~pre+1git543dbb/debian/docs
@@ -0,0 +1 @@
+README
--- mcelog-0.9~pre+1git543dbb.orig/debian/changelog
+++ mcelog-0.9~pre+1git543dbb/debian/changelog
@@ -0,0 +1,321 @@
+mcelog (0.9~pre+1git543dbb-2~bpo50+1) lenny-backports; urgency=low
+
+  * Rebuild for lenny-backports as it is needed by DSA.
+
+ -- Martin Zobel-Helas <zobel@debian.org>  Wed, 14 Oct 2009 00:15:36 +0200
+
+mcelog (0.9~pre+1git543dbb-2) unstable; urgency=low
+
+  * debian/control:
+    + Swap udev and makedev in the alternative (closes: #546875).
+    + Bump Standards-Version to 3.8.3 (no changes).
+
+ -- Julien BLACHE <jblache@debian.org>  Wed, 16 Sep 2009 18:58:09 +0200
+
+mcelog (0.9~pre+1git543dbb-1) unstable; urgency=low
+
+  * Snapshot from git (543dbb) (closes: #538163).
+
+  * Makefile:
+    + Enable disk db (was always enabled in previous versions).
+
+  * debian/copyright:
+    + Mention upstream git tree location.
+  * debian/rules:
+    + Pass etcprefix at install time.
+  * debian/dirs:
+    + Add etc for conffile installation.
+
+  * debian/patches/01_64bit_mem_addr.dpatch:
+    + Updated.
+  * debian/patches/02_tsc_secs_fix.dpatch:
+    + Removed; fixed upstream.
+  * debian/patches/03_memory_errors.dpatch:
+    + Updated.
+
+ -- Julien BLACHE <jblache@debian.org>  Fri, 24 Jul 2009 09:02:07 +0200
+
+mcelog (0.9~pre1-3) unstable; urgency=low
+
+  * Reupload to unstable.
+
+ -- Julien BLACHE <jblache@debian.org>  Thu, 09 Jul 2009 13:27:33 +0200
+
+mcelog (0.9~pre1-2) experimental; urgency=low
+
+  * Switch to running mcelog via the kernel MCE trigger instead of running
+    via cron (closes: #535180).
+
+  * debian/README.Debian:
+    + Updated for trigger mode.
+  * debian/mcelog.NEWS:
+    + Document switch to trigger mode.
+  * debian/control:
+    + Remove po-debconf build-dep.
+    + Add fixed dependencies on debconf for purging the templates.
+    + Fix description, MCE will now be logged to syslog.
+  * debian/rules:
+    + Do not install logrotate config snippet.
+    + Do not install cron config snippet.
+    + Do not install debconf scripts.
+    + Install mcelog init script.
+  * debian/mcelog.postinst:
+    + Remove debconf code and stop checking for /dev/mcelog usability.
+  * debian/mcelog.postrm:
+    + Purge debconf templates on purge (manually).
+  * debian/mcelog.preinst:
+    + Remove obsolete conffiles: /etc/logrotate.d/mcelog, /etc/cron.d/mcelog,
+      /etc/mcelog-disabled.
+  * debian/mcelog.init:
+    + Added; simple init script to set up the kernel trigger.
+
+  * debian/patches/10_debian_test.dpatch, debian/patches/11_logrotate.dpatch,
+    debian/mcelog.cron.d, debian/mcelog.templates, debian/po/*:
+    + Removed.
+
+ -- Julien BLACHE <jblache@debian.org>  Thu, 02 Jul 2009 18:41:32 +0200
+
+mcelog (0.9~pre1-1) unstable; urgency=low
+
+  * New upstream (pre) release.
+
+  * debian/control:
+    + Bump Standards-Version to 3.8.2 (no changes).
+    + Remove supported processors from the description; the list is
+      growing and is pointless now.
+  * debian/copyright:
+    + Updated.
+
+  * debian/patches/03_memory_errors.dpatch:
+    + Updated.
+  * debian/patches/10_debian_test.dpatch:
+    + Updated.
+
+ -- Julien BLACHE <jblache@debian.org>  Tue, 30 Jun 2009 19:19:29 +0200
+
+mcelog (0.8~pre-8) unstable; urgency=low
+
+  * debian/mcelog.postrm:
+    + Check for /var/lib/mcelog existence, in case it's been removed by dpkg
+      before postrm is run (closes: #507349).
+
+ -- Julien BLACHE <jblache@debian.org>  Sun, 30 Nov 2008 13:38:11 +0100
+
+mcelog (0.8~pre-7) unstable; urgency=low
+
+  * debian/control:
+    + Fix typo in description (closes: #505441).
+
+  * debian/mcelog.postinst, debian/mcelog.postrm:
+    + Make postinst and postrm scripts set -e.
+
+ -- Julien BLACHE <jblache@debian.org>  Wed, 12 Nov 2008 13:43:07 +0100
+
+mcelog (0.8~pre-6) unstable; urgency=low
+
+  * debian/control:
+    + Bump Standards-Version to 3.8.0 (no changes).
+
+  * debconf translations:
+    + sv.po: courtesy of Martin Ågren (closes: #492064).
+
+ -- Julien BLACHE <jblache@debian.org>  Wed, 23 Jul 2008 18:44:15 +0200
+
+mcelog (0.8~pre-5) unstable; urgency=low
+
+  * debian/mcelog.postinst:
+    + Move /var/lib/memory-errors to /var/lib/mcelog/memory-errors.
+  * debian/mcelog.postrm:
+    + Remove /var/lib/mcelog/memory-errors and /var/lib/mcelog (if empty) on
+      purge.
+    + Remove /var/log/mcelog & /var/log/mcelog.* on purge.
+  * debian/patches/03_memory_errors.dpatch:
+    + Added; store memory-errors state file in /var/lib/mcelog
+      (closes: #458030).
+  * debian/control:
+    + Bump Standards-Version to 3.7.3 (no changes).
+
+ -- Julien BLACHE <jblache@debian.org>  Mon, 31 Dec 2007 18:36:29 +0100
+
+mcelog (0.8~pre-4) unstable; urgency=low
+
+  * debian/po/ja.po:
+    + Added Japanese debconf translation courtesy of Kenshi Muto (closes: #446587).
+
+ -- Julien BLACHE <jblache@debian.org>  Sun, 14 Oct 2007 11:44:29 +0200
+
+mcelog (0.8~pre-3) unstable; urgency=low
+
+  * debian/README.Debian:
+    + mcelog must be run via annotate-output for timestamping, piping its
+      output to annotate-output doesn't work (closes: #439223).
+
+ -- Julien BLACHE <jblache@debian.org>  Thu, 23 Aug 2007 16:18:54 +0200
+
+mcelog (0.8~pre-2) unstable; urgency=low
+
+  * debian/rules:
+    + Build with standard -g -O2 -Wall CFLAGS.
+  * debian/patches/02_tsc_secs_fix.dpatch:
+    + Added; Fix typo in TSC-to-uptime computation.
+
+ -- Julien BLACHE <jblache@debian.org>  Thu, 16 Aug 2007 18:40:09 +0200
+
+mcelog (0.8~pre-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/control, debian/rules:
+    + Use dpatch.
+  * debian/patches/10_debian_test.dpatch:
+    + Added (from Debian diff); Add the --debian-test option.
+  * debian/patches/11_logrotate.dpatch:
+    + Added (from Debian diff); Slightly change logrotate options.
+  * debian/patches/01_64bit_mem_addr.dpatch:
+    + Added; Use 64bit variables on 32bit architectures to pass memory addresses
+      around, otherwise the --dmi output is incorrect for machines with more
+      than 4 GB of RAM. Adapted from the patch contributed by Anders Kaseorg
+      for v0.7 (closes: #437022).
+
+ -- Julien BLACHE <jblache@debian.org>  Wed, 15 Aug 2007 12:17:58 +0200
+
+mcelog (0.7-6) unstable; urgency=low
+
+  * debian/po/pt.po:
+    + Add Portuguese debconf translation by AmÃ©rico Monteiro (closes: #434200).
+  * debian/control:
+    + Depend on makedev | udev (closes: #434162).
+  * debian/mcelog.postinst:
+    + Fix MAKEDEV invocation.
+  * debian/rules:
+    + Do not ignore make clean failures in clean target.
+
+ -- Julien BLACHE <jblache@debian.org>  Mon, 23 Jul 2007 00:24:50 +0200
+
+mcelog (0.7-5) unstable; urgency=low
+
+  * debian/po/nl.po:
+    + Add dutch debconf translation by Bart Cornelis (closes: #419726).
+
+ -- Julien BLACHE <jblache@debian.org>  Tue, 17 Apr 2007 19:54:11 +0200
+
+mcelog (0.7-4) unstable; urgency=low
+
+  * debian/README.Debian:
+    + Document the lack of MCE support on Xen kernels (closes: #410023).
+
+ -- Julien BLACHE <jblache@debian.org>  Sun, 11 Feb 2007 17:01:38 +0100
+
+mcelog (0.7-3) unstable; urgency=low
+
+  * debian/po/de.po: german debconf translation courtesy of Alwin Meschede
+    (closes: #400658).
+
+ -- Julien BLACHE <jblache@debian.org>  Thu, 30 Nov 2006 20:09:25 +0100
+
+mcelog (0.7-2) unstable; urgency=low
+
+  * debian/README.Debian:
+    + Explain why timestamping mcelog's output isn't very useful, and how to
+      easily add the timestamping.
+
+ -- Julien BLACHE <jblache@debian.org>  Sun,  8 Oct 2006 18:55:27 +0200
+
+mcelog (0.7-1) unstable; urgency=low
+
+  * New upstream release (closes: #367247).
+  * debian/control:
+    + Bumped Standards-Version to 3.7.2 (no changes).
+
+ -- Julien BLACHE <jblache@debian.org>  Sun, 14 May 2006 20:31:49 +0200
+
+mcelog (0.6-5) unstable; urgency=low
+
+  * debian/po/fr.po
+    + Added french translation (closes: #364263).
+
+ -- Julien BLACHE <jblache@debian.org>  Sat, 29 Apr 2006 13:15:32 +0200
+
+mcelog (0.6-4) unstable; urgency=low
+
+  * debian/control:
+    + Depends: makedev (>= 2.3.1-81).
+  * debian/mcelog.config:
+    + Removed; merged into the postinst, as it needs mcelog itself and apt runs
+      the config script before unpacking.
+  * debian/mcelog.postinst:
+    + Create /dev/mcelog if it doesn't exist.
+    + Merge mcelog.config back in the postinst.
+  * Added Czech debconf translation (closes: #361122).
+
+ -- Julien BLACHE <jblache@debian.org>  Fri, 14 Apr 2006 12:50:07 +0200
+
+mcelog (0.6-3) unstable; urgency=low
+
+  * debian/mcelog.postinst, debian/rules, debian/control:
+    + Use a debconf note instead of mailing root when mcelog can't be used on
+      the machine (closes: #327532).
+  * mcelog.c:
+    + Remove the -t option.
+
+ -- Julien BLACHE <jblache@debian.org>  Sat,  1 Apr 2006 17:15:05 +0200
+
+mcelog (0.6-2) unstable; urgency=low
+
+  * mcelog.c:
+    + Introduce the --debian-test switch to replace -t; avoid possible clash
+      with upstream's options.
+  
+    ** -t will go away at the next revision, you've been warned **
+  
+  * debian/mcelog.postinst, debian/README.Debian:
+    + Replace mcelog -t with mcelog --debian-test.
+
+ -- Julien BLACHE <jblache@debian.org>  Tue, 14 Mar 2006 19:40:20 +0100
+
+mcelog (0.6-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/mcelog.cron.d:
+    + Add --ignorenodev and --filter to match the sample cron script.
+
+ -- Julien BLACHE <jblache@debian.org>  Tue, 28 Feb 2006 17:13:41 +0100
+
+mcelog (0.4-4) unstable; urgency=low
+
+  * debian/control, debian/README.Debian
+    + Highlight the fact that mcelog works only with x86-64 kernels.
+  * debian/mcelog.postinst:
+    + Do not test /dev/mcelog if /etc/mcelog-disabled exists.
+  * debian/mcelog.postrm:
+    + Remove /etc/mcelog-disabled on purge.
+
+ -- Julien BLACHE <jblache@debian.org>  Thu, 31 Mar 2005 13:39:15 +0200
+
+mcelog (0.4-3) unstable; urgency=low
+
+  * mcelog.c, postinst, README.Debian:
+    + Add a -t option to mcelog to test /dev/mcelog; use it in postinst to
+      enable/disable the mcelog crontab (and mail root if needed); document
+      the procedure in README.Debian (closes: #302041).
+        Thanks to LoÃ¯c Minier and Mario Holbe for their input.
+
+ -- Julien BLACHE <jblache@debian.org>  Tue, 29 Mar 2005 23:31:45 +0200
+
+mcelog (0.4-2) unstable; urgency=low
+
+  * Rewritten the description, it sucked badly.
+
+ -- Julien BLACHE <jblache@debian.org>  Tue, 29 Mar 2005 21:42:34 +0200
+
+mcelog (0.4-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Julien BLACHE <jblache@debian.org>  Mon, 28 Mar 2005 22:59:25 +0200
+
+mcelog (0.3-1) unstable; urgency=low
+
+  * Initial Release (closes: #292559).
+
+ -- Julien BLACHE <jblache@debian.org>  Fri, 28 Jan 2005 22:24:58 +0100
+
--- mcelog-0.9~pre+1git543dbb.orig/debian/mcelog.init
+++ mcelog-0.9~pre+1git543dbb/debian/mcelog.init
@@ -0,0 +1,66 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          mcelog
+# Required-Start:    $syslog $local_fs
+# Required-Stop:     
+# Should-Start:      
+# Should-Stop:       
+# Default-Start:     2 3 4 5
+# Default-Stop:      
+# Short-Description: Machine Check Exceptions (MCE) collector & decoder
+# Description:       Machine Check Exceptions are raised by the CPU whenever
+#                    it encounters an hardware error. mcelog collects and
+#                    decodes Machine Check Exceptions as they happen. 
+### END INIT INFO
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/mcelog
+NAME=mcelog
+DESC="Machine Check Exceptions decoder"
+TRIGGER=/sys/devices/system/machinecheck/machinecheck0/trigger
+
+test -x $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+  start | restart)
+	echo -n "Setting up Machine Check Exceptions trigger..."
+	if [ -e $TRIGGER ]; then
+	    echo $DAEMON > $TRIGGER
+	else
+	    echo " not supported on this machine."
+	    exit 0
+	fi
+	echo " done."
+
+	echo -n "Running $DESC..."
+	$DAEMON
+	echo " done."
+	;;
+  stop)
+	echo -n "Clearing Machine Check Exceptions trigger..."
+	echo "" > $TRIGGER
+	echo " done."
+	;;
+  force-reload)
+	[ "$(cat $TRIGGER)" = $DAEMON ] && $0 restart || exit 0
+	;;
+  status)
+	if [ "$(cat $TRIGGER)" = $DAEMON ]; then
+	    echo "Machine Check Exceptions collected by mcelog."
+	    exit 0
+	else
+	    echo "Machine Check Exceptions not collected by mcelog."
+	    exit 1
+	fi
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
--- mcelog-0.9~pre+1git543dbb.orig/debian/mcelog.postinst
+++ mcelog-0.9~pre+1git543dbb/debian/mcelog.postinst
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = configure ] || [ "$1" = reconfigure ] ; then
+    # create the device node if it doesn't exist
+    if [ -e /dev/MAKEDEV ]; then
+	(cd /dev && ./MAKEDEV mcelog) || true
+    fi
+
+    # Move memory errors DB, bad path prior to 0.8~pre-5
+    if [ -e /var/lib/memory-errors ]; then
+	mv -f /var/lib/memory-errors /var/lib/mcelog/memory-errors
+    fi
+fi
+
+#DEBHELPER#
--- mcelog-0.9~pre+1git543dbb.orig/debian/mcelog.postrm
+++ mcelog-0.9~pre+1git543dbb/debian/mcelog.postrm
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -e
+
+# Remove /etc/mcelog-disabled on purge
+if [ "$1" = "purge" ]; then
+    if [ -d /var/lib/mcelog ]; then
+	rm -f /var/lib/mcelog/memory-errors
+	rmdir --ignore-fail-on-non-empty /var/lib/mcelog
+    fi
+
+    # Remove files and logs created by versions prior to 0.9~pre1-2.
+    rm -f /etc/mcelog-disabled
+    rm -f /var/log/mcelog /var/log/mcelog.*
+
+    # Purge debconf templates; debconf removed starting with 0.9~pre1-2.
+    if [ -e /usr/share/debconf/confmodule ]; then
+	. /usr/share/debconf/confmodule
+	db_purge
+    fi
+fi
+
+#DEBHELPER#
--- mcelog-0.9~pre+1git543dbb.orig/debian/README.Debian
+++ mcelog-0.9~pre+1git543dbb/debian/README.Debian
@@ -0,0 +1,25 @@
+mcelog for Debian
+-----------------
+
+mcelog is only needed/useful on x86-64 platforms, ie AMD64 and EM64T
+hardware. You need to configure your kernel with CONFIG_X86_MCE=y (which
+is the default).
+
+
+mcelog will be invoked directly by the kernel upon receiving an MCE event.
+This is accomplished by using the trigger provided by the kernel under
+  /sys/devices/system/machinecheck/machinecheck0/trigger
+
+The decoded MCE data is logged to syslog.
+
+
+MCE, mcelog and Xen
+-------------------
+
+Xen kernels do not have MCE support, so mcelog is useless on systems running
+a Xen kernel.
+
+On Xen systems, it is the Xen hypervisor that collects the MCE; error messages
+can be seen in the 'xm dmesg' output.
+
+-- Julien BLACHE <jblache@debian.org>, Thr, 02 Jul 2009 18:14:43 +0200
--- mcelog-0.9~pre+1git543dbb.orig/debian/mcelog.preinst
+++ mcelog-0.9~pre+1git543dbb/debian/mcelog.preinst
@@ -0,0 +1,42 @@
+#!/bin/sh
+set -e
+
+# From http://wiki.debian.org/DpkgConffileHandling
+# Remove a no-longer used conffile
+rm_conffile() {
+    local PKGNAME="$1"
+    local CONFFILE="$2"
+
+    [ -e "$CONFFILE" ] || return 0
+
+    local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
+    local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \
+            sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
+    if [ "$md5sum" != "$old_md5sum" ]; then
+        echo "Obsolete conffile $CONFFILE has been modified by you."
+        echo "Saving as $CONFFILE.dpkg-bak ..."
+        mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
+    else
+        echo "Removing obsolete conffile $CONFFILE ..."
+        rm -f "$CONFFILE"
+    fi
+}
+
+if [ "$1" = install ] || [ "$1" = upgrade ]; then
+    # Cleanup files related to cron-mode
+    if dpkg --compare-versions "$2" le "0.9~pre1-1"; then
+        rm_conffile mcelog /etc/logrotate.d/mcelog
+
+	rm_conffile mcelog /etc/cron.d/mcelog
+	if [ -e /etc/cron.d/mcelog ]; then
+	    # Disable the crontab to avoid annoying messages
+	    touch /etc/mcelog-disabled
+	else
+	    # Cleanup now-useless file
+	    rm -f /etc/mcelog-disabled
+	fi
+    fi
+fi
+
+#DEBHELPER#
+
--- mcelog-0.9~pre+1git543dbb.orig/debian/mcelog.NEWS
+++ mcelog-0.9~pre+1git543dbb/debian/mcelog.NEWS
@@ -0,0 +1,23 @@
+mcelog (0.9~pre1-2) experimental; urgency=low
+
+  Starting with this revision, mcelog is no longer run from a crontab every
+  five minutes.
+
+  Instead, mcelog will now be invoked directly by the kernel upon receiving
+  an MCE event. This means there will no longer be any delay between an MCE
+  event happening and that same MCE event being decoded and logged.
+
+  With this change, MCE events will now be logged to syslog instead of
+  /var/log/mcelog.
+
+  You can safely remove /var/log/mcelog* now, and any mcelog conffile that
+  you modified (unmodified conffiles will be taken care of by the preinst
+  script). The /etc/mcelog-disabled file is no longer used and can be removed
+  if present; be sure to remove /etc/cron.d/mcelog beforehand, too.
+
+  Old mcelog conffiles:
+   - /etc/cron.d/mcelog
+   - /etc/logrotate.d/mcelog
+   - /etc/mcelog-disabled (created by postinst)
+
+ -- Julien BLACHE <jblache@debian.org>  Thu, 02 Jul 2009 17:56:52 +0200
--- mcelog-0.9~pre+1git543dbb.orig/debian/rules
+++ mcelog-0.9~pre+1git543dbb/debian/rules
@@ -0,0 +1,89 @@
+#!/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.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+# Include dpatch rules
+include /usr/share/dpatch/dpatch.make
+
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+
+	touch configure-stamp
+
+
+build: build-stamp
+build-stamp: patch-stamp configure-stamp 
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE) CFLAGS="$(CFLAGS)"
+
+	touch build-stamp
+
+clean: real-clean unpatch
+real-clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+
+	# Add here commands to clean up after the build process.
+	$(MAKE) clean
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+
+	# Add here commands to install the package into debian/mcelog.
+	mkdir -p $(CURDIR)/debian/mcelog/usr/share/doc/mcelog
+	$(MAKE) install prefix=$(CURDIR)/debian/mcelog/usr \
+		etcprefix=$(CURDIR)/debian/mcelog \
+		DOCDIR=$(CURDIR)/debian/mcelog/usr/share/doc/mcelog
+
+# 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_testdir
+	dh_testroot
+	dh_installchangelogs CHANGES
+	dh_installdocs
+#	dh_install
+	dh_installinit -r -- start 20 2 3 4 5 .
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure patch unpatch real-clean
--- mcelog-0.9~pre+1git543dbb.orig/debian/dirs
+++ mcelog-0.9~pre+1git543dbb/debian/dirs
@@ -0,0 +1,5 @@
+etc
+usr/sbin
+usr/share/man/man8
+var/lib/mcelog
+
--- mcelog-0.9~pre+1git543dbb.orig/debian/copyright
+++ mcelog-0.9~pre+1git543dbb/debian/copyright
@@ -0,0 +1,31 @@
+This package was debianized by Julien BLACHE <jblache@debian.org> on
+Thu, 27 Jan 2005 21:19:26 +0100.
+
+It was downloaded from:
+ - stable releases: <ftp://ftp.x86-64.org/pub/linux/tools/mcelog>
+ - git tree: <git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git>
+
+Upstream Author: Andi Kleen <ak@suse.de>
+    Copyright (C) 2002, 2003, 2004, 2005, 2006 Andi Kleen, SuSE Labs.
+    Copyright (C) 2005, 2008 Intel Corporation
+    Copyright (C) 2003 Eric Morton, Newisys Inc 
+    Copyright (C) 2005, 2006 Jacob Shin, AMD Inc.
+
+License:
+
+    mcelog 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.
+
+    mcelog 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 find a copy of v2 of the GNU General Public License somewhere
+    on your Linux system; if not, write to the Free Software Foundation,
+    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+On Debian systems, you can find the complete text of the GNU GPLv2 in
+the file /usr/share/common-licenses/GPL-2.
--- mcelog-0.9~pre+1git543dbb.orig/debian/control
+++ mcelog-0.9~pre+1git543dbb/debian/control
@@ -0,0 +1,20 @@
+Source: mcelog
+Section: admin
+Priority: optional
+Maintainer: Julien BLACHE <jblache@debian.org>
+Build-Depends: debhelper (>= 5.0.0), dpatch
+Standards-Version: 3.8.3
+
+Package: mcelog
+Architecture: i386 amd64
+Depends: ${shlibs:Depends}, ${misc:Depends}, debconf (>= 0.5) | debconf-2.0, udev | makedev (>= 2.3.1-81)
+Description: x86-64 Machine Check Exceptions collector and decoder
+ Starting with version 2.6.4, the Linux kernel for x86-64 no longer decodes
+ and logs recoverable Machine Check Exception events to the kernel log on
+ its own.
+ .
+ Instead, the MCE data is kept in a buffer which can be read from userspace
+ via the /dev/mcelog device node.
+ .
+ You need this tool to collect and decode those events; it will log the decoded
+ MCE events to syslog.
--- mcelog-0.9~pre+1git543dbb.orig/debian/patches/01_64bit_mem_addr.dpatch
+++ mcelog-0.9~pre+1git543dbb/debian/patches/01_64bit_mem_addr.dpatch
@@ -0,0 +1,126 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_64bit_mem_addr.dpatch by  <jblache@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Patch from Anders Kaseorg <andersk@MIT.EDU>, #437022
+## DP: mcelog reads 64-bit addresses from the MCE, but passes them around with
+## DP: type unsigned long, which causes mcelog --dmi to give incorrect
+## DP: results on 32-bit systems with more than 4 GiB of RAM.
+
+@DPATCH@
+diff -urNad mcelog-0.9~pre+1git543dbb~/dimm.c mcelog-0.9~pre+1git543dbb/dimm.c
+--- mcelog-0.9~pre+1git543dbb~/dimm.c	2009-06-23 10:26:54.000000000 +0200
++++ mcelog-0.9~pre+1git543dbb/dimm.c	2009-07-24 08:53:00.942168042 +0200
+@@ -350,14 +350,14 @@
+ 		Eprintf("Cannot run error trigger %s for %s\n", trigger, loc);
+ 	open_dimm_db(NULL);
+ }
+-void new_error(unsigned long addr, unsigned long max_error, char *trigger)
++void new_error(unsigned long long addr, unsigned long max_error, char *trigger)
+ {
+ 	struct dmi_memdev **devs;
+ 	int i;
+ 
+ 	devs = dmi_find_addr(addr);
+ 	if (devs[0] == NULL) {
+-		Wprintf("No memory found for address %lx\n", addr);
++		Wprintf("No memory found for address %Lx\n", addr);
+ 		exit(1);
+ 	}
+ 	for (i = 0; devs[i]; i++) {
+@@ -365,7 +365,7 @@
+ 		char *loc = dmi_getstring(&d->header, d->device_locator);
+ 		struct group *g = find_entry(dimm_db, NULL, "Locator", loc);
+ 		if (!g) { // shouldn't happen
+-			Eprintf("No record found for %lx\n", addr);
++			Eprintf("No record found for %Lx\n", addr);
+ 			return;
+ 		}
+ 		unsigned long val = inc_val(g, "corrected errors");
+diff -urNad mcelog-0.9~pre+1git543dbb~/dimm.h mcelog-0.9~pre+1git543dbb/dimm.h
+--- mcelog-0.9~pre+1git543dbb~/dimm.h	2009-06-23 10:26:54.000000000 +0200
++++ mcelog-0.9~pre+1git543dbb/dimm.h	2009-07-24 08:53:00.945167312 +0200
+@@ -1,6 +1,6 @@
+ void close_dimm_db(void);
+ int open_dimm_db(char *fn);
+-void new_error(unsigned long addr, unsigned long max_error, char *trigger);
++void new_error(unsigned long long addr, unsigned long max_error, char *trigger);
+ void reset_dimm(char *locator);
+ void gc_dimms(void);
+ void dump_all_dimms(void);
+diff -urNad mcelog-0.9~pre+1git543dbb~/dmi.c mcelog-0.9~pre+1git543dbb/dmi.c
+--- mcelog-0.9~pre+1git543dbb~/dmi.c	2009-06-23 10:26:54.000000000 +0200
++++ mcelog-0.9~pre+1git543dbb/dmi.c	2009-07-24 08:54:30.795761039 +0200
+@@ -240,7 +240,7 @@
+ 			Wprintf("%s ", type_details[i]);
+ }
+ 
+-static void dump_memdev(struct dmi_memdev *md, unsigned long addr)
++static void dump_memdev(struct dmi_memdev *md, unsigned long long addr)
+ {
+ 	char tmp[20];
+ 	char unit[10];
+@@ -249,7 +249,7 @@
+ 	if (md->header.length < 
+ 			offsetof(struct dmi_memdev, manufacturer)) { 
+ 		if (verbose > 0)
+-			printf("Memory device for address %lx too short %hu expected %lu\n",
++			printf("Memory device for address %Lx too short %hu expected %lu\n",
+ 			       addr, md->header.length, 
+ 			       sizeof(struct dmi_memdev));
+ 		return;
+@@ -442,7 +442,7 @@
+ 			DMIGET(dmi_dimms[i],device_set));
+ }
+ 
+-struct dmi_memdev **dmi_find_addr(unsigned long addr)
++struct dmi_memdev **dmi_find_addr(unsigned long long addr)
+ {
+ 	struct dmi_memdev **devs; 
+ 	int i, k;
+@@ -486,7 +486,7 @@
+ 	return devs;
+ }
+ 
+-void dmi_decodeaddr(unsigned long addr)
++void dmi_decodeaddr(unsigned long long addr)
+ {
+ 	struct dmi_memdev **devs = dmi_find_addr(addr);
+ 	if (devs[0]) { 
+@@ -495,7 +495,7 @@
+ 		for (i = 0; devs[i]; i++) 
+ 			dump_memdev(devs[i], addr);
+ 	} else { 
+-		Wprintf("No DIMM found for %lx in SMBIOS\n", addr);
++		Wprintf("No DIMM found for %Lx in SMBIOS\n", addr);
+ 	}
+ 	free(devs);
+ } 
+diff -urNad mcelog-0.9~pre+1git543dbb~/dmi.h mcelog-0.9~pre+1git543dbb/dmi.h
+--- mcelog-0.9~pre+1git543dbb~/dmi.h	2009-06-23 10:26:54.000000000 +0200
++++ mcelog-0.9~pre+1git543dbb/dmi.h	2009-07-24 08:53:00.962533896 +0200
+@@ -62,10 +62,10 @@
+ }  __attribute__((packed));
+ 
+ int opendmi(void);
+-void dmi_decodeaddr(unsigned long addr);
++void dmi_decodeaddr(unsigned long long addr);
+ int dmi_sanity_check(void);
+ unsigned dmi_dimm_size(unsigned short size, char *unit);
+-struct dmi_memdev **dmi_find_addr(unsigned long addr);
++struct dmi_memdev **dmi_find_addr(unsigned long long addr);
+ void dmi_set_verbosity(int v);
+ 
+ char *dmi_getstring(struct dmi_entry *e, unsigned number);
+diff -urNad mcelog-0.9~pre+1git543dbb~/mcelog.c mcelog-0.9~pre+1git543dbb/mcelog.c
+--- mcelog-0.9~pre+1git543dbb~/mcelog.c	2009-06-23 10:26:54.000000000 +0200
++++ mcelog-0.9~pre+1git543dbb/mcelog.c	2009-07-24 08:55:06.424926677 +0200
+@@ -107,7 +107,7 @@
+ 	}
+ } 
+ 
+-static void resolveaddr(unsigned long addr)
++static void resolveaddr(unsigned long long addr)
+ {
+ 	if (addr && do_dmi)
+ 		dmi_decodeaddr(addr);
--- mcelog-0.9~pre+1git543dbb.orig/debian/patches/00list
+++ mcelog-0.9~pre+1git543dbb/debian/patches/00list
@@ -0,0 +1,2 @@
+01_64bit_mem_addr
+03_memory_errors
--- mcelog-0.9~pre+1git543dbb.orig/debian/patches/03_memory_errors.dpatch
+++ mcelog-0.9~pre+1git543dbb/debian/patches/03_memory_errors.dpatch
@@ -0,0 +1,38 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 03_memory_errors.dpatch by  <jblache@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Move memory errors database to /var/lib/mcelog.
+
+@DPATCH@
+diff -urNad mcelog-0.9~pre+1git543dbb~/mcelog.8 mcelog-0.9~pre+1git543dbb/mcelog.8
+--- mcelog-0.9~pre+1git543dbb~/mcelog.8	2009-06-23 10:26:54.000000000 +0200
++++ mcelog-0.9~pre+1git543dbb/mcelog.8	2009-07-24 08:59:49.095739125 +0200
+@@ -197,7 +197,7 @@
+ 
+ .\".B \-\-database filename
+ .\"specifies the memory module error database file. Default is
+-.\"/var/lib/memory-errors.  It is only used together with DMI decoding.
++.\"/var/lib/mcelog/memory-errors.  It is only used together with DMI decoding.
+ .\"
+ .\"
+ .\".B \-\-error\-trigger=cmd,thresh
+@@ -264,7 +264,7 @@
+ 
+ /sys/devices/system/machinecheck/machinecheck0/trigger
+ 
+-.\"/var/lib/memory-errors
++.\"/var/lib/mcelog/memory-errors
+ .SH SEE ALSO
+ AMD x86-64 architecture programmer's manual, Volume 2, System programming
+ 
+diff -urNad mcelog-0.9~pre+1git543dbb~/paths.h mcelog-0.9~pre+1git543dbb/paths.h
+--- mcelog-0.9~pre+1git543dbb~/paths.h	2009-06-23 10:26:54.000000000 +0200
++++ mcelog-0.9~pre+1git543dbb/paths.h	2009-07-24 08:58:49.525638570 +0200
+@@ -1,5 +1,5 @@
+ #define PREFIX ""
+ 
+ #define LOG_DEV_FILENAME "/dev/mcelog"
+-#define DIMM_DB_FILENAME PREFIX "/var/lib/memory-errors"
++#define DIMM_DB_FILENAME PREFIX "/var/lib/mcelog/memory-errors"
+ #define CONFIG_FILENAME PREFIX "/etc/mcelog.conf"
