--- dict-devil-1.0.orig/debian/devil2dict
+++ dict-devil-1.0/debian/devil2dict
@@ -0,0 +1,104 @@
+#!/usr/bin/perl -w
+
+=head1 NAME
+
+devil2dict - preprocess The Devil's Dictionary for dictfmt(1)
+
+=head1 SYNOPSIS
+
+B<devil2dict> [I<INPUT_FILE>... [I<OUTPUT_BASENAME>]]
+
+=head1 DESCRIPTION
+
+B<devil2dict> converts the Internet Wiretap edition of The Devil's
+Dictionary to CIA World Factbook format suitable for input to
+L<dictfmt(1)>.  If you specify I<OUTPUT_BASENAME>, output is directly
+piped into B<dictfmt>.
+
+=head1 AUTHOR
+
+Matej Vela <vela@debian.org>.  In the public domain.
+
+=cut
+
+use strict;
+
+my $fmt_base = pop if @ARGV > 1;
+open STDOUT, '|-', 'dictfmt', '-c5',
+	     '--without-headword', # Necessary for multiple headwords.
+	     '--headword-separator', ', ',
+	     '-u', 'http://wiretap.area.com/Gopher/Library/Classic/devils.txt',
+	     '-s', 'The Devil\'s Dictionary (1881-1906)',
+	     $fmt_base
+    or die "$0: can't open pipe to dictfmt: $!\n"
+    if defined $fmt_base;
+
+# Entries with multiple headwords, listed explicitly because they all
+# use differing punctuation.
+my %multi = (BABE      => 'BABE, BABY',
+	     CONFIDANT => 'CONFIDANT, CONFIDANTE',
+	     TZETZE    => 'TZETZE FLY, TSETSE FLY',
+	     # LAUREL refers to LAUREATE with _Vide supra._
+	     LAUREATE => 'LAUREATE, LAUREL');
+
+# Hyperlinks, also listed explicitly due to a number of exceptions
+# (e.g. LUNARIAN in the entry for EXECUTIVE).
+my %link = (ACADEME         => '{ACADEME}',
+	    HUSBAND         => '{HUSBAND}',
+	    EPITAPH         => '{EPITAPH}',
+	    LAUREATE        => '{LAUREATE}',
+	     _Molecule_      => '{MOLECULE}',
+	    LOGIC           => '{LOGIC}');
+
+my $check = 0;
+my $blank = 0;
+
+while (<>) {
+    # Expect headwords only after blank lines and lines beginning with
+    # whitespace (cf. MEERSCHAUM).  This fixes several false positives
+    # (for example, "II., De Clem._, ...").
+    if (/^\s/) {
+	$check = 1;
+
+	# Leave blank lines for later.
+	$blank++, next	if /^$/;
+
+	# Strip letter headings, and the decoration at the end; no
+	# point in having them in the previous entry.
+	next		if /^\s+(?:[A-Z]|-\)\(-)$/;
+    } elsif ($check) {
+	$check = 0;
+
+	# Check for headwords.  Characteristic examples:
+	#
+	#     I is the first letter of ...
+	#     R.I.P.  A careless abbrev...  (dot included!)
+	#     HABEAS CORPUS.  A writ by...  (dot left out!)
+	#
+	# The /g flag updates pos() for the hyperlink code below.
+	if (/^([A-Z]+\b(?:\.[A-Z.]+|[- \'A-Z]+[A-Z])?)/g) {
+	    $blank = 0;
+	    print "\n_____\n\n", exists $multi{$1} ? $multi{$1} : $1, "\n";
+	}
+    }
+
+    # Restore blank lines within entries.
+    $blank--, print "\n" while $blank;
+
+    # Search for hyperlinks; candidates are upper-case words and
+    # underscored text.  s///g would look nicer, but it would
+    # substitute headwords as well because it starts from the
+    # beginning rather than the current pos().
+     while (/([A-Z]{2,}|_.+?_)/g) {
+         pos = $-[0] + length(substr($_, $-[0], $+[0] - $-[0]) = $link{$1})
+             if exists $link{$1};
+     }
+     
+    print;
+}
+
+print "\n";
+
+close STDOUT
+    or die "$0: can't close pipe to dictfmt: $!\n"
+    if defined $fmt_base;
--- dict-devil-1.0.orig/debian/postinst
+++ dict-devil-1.0/debian/postinst
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+set -e
+
+if [ "$1" = "configure" ]; then
+    if [ -x /usr/sbin/dictdconfig ]; then dictdconfig -w ;fi
+    if [ -x /etc/init.d/dictd ]; then invoke-rc.d dictd restart ;fi
+fi	
+
+#DEBHELPER#
--- dict-devil-1.0.orig/debian/compat
+++ dict-devil-1.0/debian/compat
@@ -0,0 +1 @@
+7
--- dict-devil-1.0.orig/debian/watch
+++ dict-devil-1.0/debian/watch
@@ -0,0 +1,4 @@
+# There will likely never be new upstream versions of the
+# Devil's Dictionary, its author passed away in 1914.
+# Unless someone finds an electronic copy of the
+# Enlarged Devil's Dictionary, that could replace the current one.
--- dict-devil-1.0.orig/debian/postrm
+++ dict-devil-1.0/debian/postrm
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+set -e
+
+if [ "$1" = "remove" ]; then
+    if [ -x /usr/sbin/dictdconfig ]; then dictdconfig -w ;fi
+    if [ -x /etc/init.d/dictd ]; then invoke-rc.d dictd restart; fi
+fi
+
+#DEBHELPER#
--- dict-devil-1.0.orig/debian/rules
+++ dict-devil-1.0/debian/rules
@@ -0,0 +1,36 @@
+#! /usr/bin/make -f
+
+# export DH_VERBOSE=1
+
+all build: build-stamp
+build-stamp:
+	dh_testdir
+	dh_prep
+	chmod a+x debian/devil2dict
+	debian/devil2dict devils.txt devil
+	dictzip devil.dict
+	touch $@
+
+clean:
+	dh_testdir
+	dh_clean
+
+binary: binary-indep binary-arch
+
+binary-indep: build
+	dh_testdir
+	dh_testroot
+	dh_installdocs
+	dh_installchangelogs
+	dh_install
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary-arch:
+# Nothing to do here.
+
+.PHONY: build clean binary binary-arch binary-indep
--- dict-devil-1.0.orig/debian/copyright
+++ dict-devil-1.0/debian/copyright
@@ -0,0 +1,34 @@
+This is the Debian GNU/Linux prepackaged version of The Devil's
+Dictionary by Ambose Bierce, for use by The DICT Development Group's
+client sever software.
+
+This package was originally constructed by Robert D. Hilliard
+<hilliard@debian.org> from sources obtained from
+http://wiretap.area.com/Gopher/Library/Classic/devils.txt.
+It is currently maintained by Sven Joachim <svenjoac@gmx.de>.
+
+Matej Vela <vela@debian.org> contributed a script to preprocess
+the dictionary to a format suitable for dictfmt.
+
+Copyright:
+
+The Devil's Dictionary is in the public domain, its copyright has 
+expired.  It is distributed with the following header:
+
+            The Internet Wiretap 1st Online Edition of
+
+
+                      THE DEVIL'S DICTIONARY
+
+                                by 
+
+                          AMBROSE BIERCE
+
+
+           Copyright 1911 by Albert and Charles Boni, Inc.
+               A Public Domain Text, Copyright Expired
+
+                       Released April 15 1993
+
+                 Entered by Aloysius of &tSftDotIotE
+                     aloysius@west.darkside.com
--- dict-devil-1.0.orig/debian/control
+++ dict-devil-1.0/debian/control
@@ -0,0 +1,18 @@
+Source: dict-devil
+Section: text
+Priority: optional
+Maintainer: Sven Joachim <svenjoac@gmx.de>
+Build-Depends: debhelper (>= 7)
+Build-Depends-Indep: dictfmt, dictzip
+Standards-Version: 3.8.2
+Vcs-Browser: http://git.debian.org/?p=users/joachim-guest/dict-devil.git
+Vcs-Git: git://git.debian.org/users/joachim-guest/dict-devil.git
+
+Package: dict-devil
+Architecture: all 
+Description: The Devil's Dictionary by Ambrose Bierce
+ This package contains The Devil's Dictionary, a satirical, cynical
+ and irreverent dictionary of common words, formatted for use by the
+ dictionary server in the dictd package.
+Depends: dictd | dict-server
+Provides: dictd-dictionary
--- dict-devil-1.0.orig/debian/changelog
+++ dict-devil-1.0/debian/changelog
@@ -0,0 +1,131 @@
+dict-devil (1.0-11) unstable; urgency=low
+
+  * New maintainer (Closes: #436116).
+  * Fix typos in the dictionary (Closes: #283796, 314607, #458207).
+    Incorporate further corrections from the Project Gutenberg version.
+  * Redo debian/rules from scratch using debhelper commands.
+  * Bump Standards-Version to 3.8.2, no changes needed.
+  * Clean up maintainer scripts:
+    - Don't restart dictd when dict-devil is purged.
+  * Don't mention copyright and license of the dict software in
+    debian/copyright anymore.
+  * debian/control:
+    - Remove alternate build-dependency on ancient dicd version,
+      add debhelper build-dependency.
+    - Slightly reword the long description, don't mention that
+      the dictionary is in 7-bit ascii.
+    - Remove duplicate Section and Priority fields.
+    - Add Vcs-Browser and Vcs-Git fields.
+
+ -- Sven Joachim <svenjoac@gmx.de>  Wed, 29 Jul 2009 08:50:11 +0200
+
+dict-devil (1.0-10) unstable; urgency=medium
+
+  * QA Upload.
+  * Make debian/devil2dict executable to get some content into
+    the binary package (Closes: #498829).
+
+ -- Sven Joachim <svenjoac@gmx.de>  Sat, 13 Sep 2008 18:17:27 +0200
+
+dict-devil (1.0-9) unstable; urgency=low
+
+  * QA Upload
+    + change maintainer to QA group
+  * Call invoke-rc.d instead of init script directly in maintainer
+    scripts. Closes: #275792
+  * Provide dictd-dictionary. Closes: #466206
+
+ -- Frank Lichtenheld <djpig@debian.org>  Thu, 24 Apr 2008 04:13:38 +0200
+
+dict-devil (1.0-8) unstable; urgency=low
+
+  * Edited devils.txt:
+
+    under LAUREL s/_vide supra_/LAUREATE/ (vide supra
+      is not appropraite when only one entry is displayed by dict).
+
+    The following correct typos in the original:
+      under FRYING-PAN s/broiling in/broiling is/
+      under I s/clearer the/clearer to the/
+      under K s/pums/puns/
+      under PRE-ADAMITE s/race of antedated/race that antedated/
+      under RICE-WATER s/fat which/fat witch/
+
+  * Used modified devil2dict from Matej Vela <vela@debian.org> instead of
+    my sedscript for pre-processing devils.txt.  This indexes multi-word,
+    hyphenated, and apostrophized headwords. Closes: #222494.  This includes
+    the fix provided by Grant Hollingworth <grant@antiflux.org> in Bug
+    #221190.  Closes: #221190.  Thanks, Grant and Matej,
+
+ -- Bob Hilliard <hilliard@debian.org>  Fri, 26 Dec 2003 17:52:12 -0500
+
+
+dict-devil (1.0-7) unstable; urgency=low
+
+  * Corrected format of Build-Depends-Indep: Closes: #218707
+
+ -- Bob Hilliard <hilliard@debian.org>  Sun, 02 Nov 2003 12:04:21 -0500
+
+
+dict-devil (1.0-6) unstable; urgency=low
+
+  * Fixed typo in entry for woman - s/Greeland/Greenland/ - Closes: #204618
+    (At first I thought this might be deliberate - Bierce was fond of
+    invented proper names and fanciful expressions, and this line contains
+    three apparent typos.  I obtained a hard-copy of the Devil's
+    Dictionary, and verified that this was a typo in the e-text.)  (All
+    copies of the Devil's Dictionary that I could find on line are based n
+    the same e-test as this package.)
+
+ -- Bob Hilliard <hilliard@debian.org>  Sun, 21 Sep 2003 15:48:30 -0400
+
+
+dict-devil (1.0-5) unstable; urgency=low
+
+  * There are no substantive changes from 1.0-5 that would be visible to
+    the user.
+
+  * Removed /usr/doc/symlinks.
+
+  * removed workaround for dictfmt bug that has ben fixed (duplicated last
+    index entry).
+
+ -- Bob Hilliard <hilliard@debian.org>  Mon, 12 May 2003 16:06:18 -0400
+
+
+dict-devil (1.0-4) unstable; urgency=low
+  * There are no substantive changes from 1.0-3 that would be visible to
+    the user.
+
+  * Corrected spelling in Suggests:
+
+ -- Bob Hilliard <hilliard@debian.org>  Thu, 21 Feb 2002 14:21:33 -0500
+
+
+dict-devil (1.0-3) unstable; urgency=low
+  * There are no substantive changes from 1.8-2 that would be visible to
+    the user.
+
+  * Added dictd to Build-Depends-Indep.
+
+ -- Bob Hilliard <hilliard@debian.org>  Wed, 20 Feb 2002 18:13:18 -0500
+
+dict-devil (1.0-2) unstable; urgency=low
+
+  * Added Build-Depends-Indep
+
+ -- Bob Hilliard <hilliard@debian.org>  Mon,  1 Jan 2001 18:03:00 -0500
+
+
+dict-devil (1.0-1) unstable; urgency=low
+
+  * Downloaded devils/txt from http://wiretap.area.com/Gopher/
+    Library/Classic/devils.txt
+
+  * Prepared debian/rules to build the package using
+  /usr/bin/.dictfmt, and wrote necessary debian files.  There is no
+  upstream changelog
+
+  * Closes :#79995
+
+ -- Bob Hilliard <hilliard@debian.org>  Mon,  1 Jan 2001 17:16:14 -0500
--- dict-devil-1.0.orig/debian/dict-devil.install
+++ dict-devil-1.0/debian/dict-devil.install
@@ -0,0 +1,2 @@
+devil.dict.dz usr/share/dictd
+devil.index usr/share/dictd
--- dict-devil-1.0.orig/debian/clean
+++ dict-devil-1.0/debian/clean
@@ -0,0 +1,2 @@
+devil.dict.dz
+devil.index
