--- mairix-0.11.orig/Makefile
+++ mairix-0.11/Makefile
@@ -23,6 +23,9 @@
 #
 # =======================================================================
 
+## Edited for Debian GNU/Linux
+DESTDIR=
+
 #########################################################################
 # Edit the following variables as required
 CC=gcc
@@ -30,12 +33,12 @@
 #CFLAGS=-O2 -pg
 CFLAGS=-Wall -g
 
-prefix=/usr/local
+prefix=$(DESTDIR)/usr
 bindir=$(prefix)/bin
-mandir=$(prefix)/man
+mandir=$(prefix)/share/man
 man1dir=$(mandir)/man1
-infodir=$(prefix)/info
-docdir=$(prefix)/docs
+infodir=$(prefix)/share/info
+docdir=$(prefix)/share/doc/mairix
 
 #########################################################################
 # Things below this point shouldn't need to be edited.
--- mairix-0.11.orig/debian/menu
+++ mairix-0.11/debian/menu
@@ -0,0 +1,2 @@
+?package(mairix):needs=text|vc|wm section=Apps/Net\
+  title="mairix" command="/usr/bin/mairix"
--- mairix-0.11.orig/debian/watch
+++ mairix-0.11/debian/watch
@@ -0,0 +1,5 @@
+# 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.
+version=2
+http://www.rrbcurnow.freeuk.com/mairix/mairix-(.*)\.tar\.gz	uupdate
--- mairix-0.11.orig/debian/rules
+++ mairix-0.11/debian/rules
@@ -0,0 +1,98 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatibility version to use.
+export DH_COMPAT=3
+
+
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+
+	touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE)
+	$(MAKE) docs
+
+	touch build-stamp
+
+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/mairix.
+	$(MAKE) install DESTDIR=$(CURDIR)/debian/mairix
+	$(MAKE) install_docs DESTDIR=$(CURDIR)/debian/mairix
+	mkdir -p $(CURDIR)/debian/mairix/usr/share/doc/mairix/examples
+	install -o root -g root -m u+rw,o+r dotmairixrc.eg \
+		$(CURDIR)/debian/mairix/usr/share/doc/mairix/examples/mairix.eg
+
+
+# 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_installdebconf	
+	dh_installdocs
+	dh_installexamples
+	dh_installmenu
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+#	dh_installinit
+	dh_installcron
+	dh_installman mairix.1
+	dh_installinfo
+#	dh_undocumented
+	dh_installchangelogs 
+	dh_link
+	dh_strip
+	dh_compress -X.pdf
+	dh_fixperms
+#	dh_makeshlibs
+	dh_installdeb
+#	dh_perl
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
--- mairix-0.11.orig/debian/doc-base
+++ mairix-0.11/debian/doc-base
@@ -0,0 +1,17 @@
+Document: mairix
+Title: The mairix program
+Abstract: This is a copy of mairix info page.
+Section: Apps/Net
+
+Format: PDF
+Files: /usr/doc/mairix/mairix.pdf
+
+Format: dvi
+Files: /usr/doc/mairix/mairix.dvi.gz
+
+Format: text
+Files: /usr/doc/mairix/mairix.txt.gz
+
+Format: HTML
+Index: /usr/doc/mairix/mairix.html
+Files: /usr/doc/mairix/mairix.html
--- mairix-0.11.orig/debian/changelog
+++ mairix-0.11/debian/changelog
@@ -0,0 +1,13 @@
+mairix (0.11-2) unstable; urgency=low
+
+  * Manpage was not installed.
+
+ -- Matej Cepl <matej@ceplovi.cz>  Sun, 27 Jul 2003 19:33:00 +0200
+
+mairix (0.11-1) unstable; urgency=low
+
+  * Initial Release.
+  * Adjusted Makefile for $DESTDIR use.
+
+ -- Matej Cepl <matej@ceplovi.cz>  Sun, 27 Jul 2003 18:10:36 +0200
+
--- mairix-0.11.orig/debian/docs
+++ mairix-0.11/debian/docs
@@ -0,0 +1,4 @@
+mairix.txt
+NEWS
+README
+BUGS.Debian
--- mairix-0.11.orig/debian/copyright
+++ mairix-0.11/debian/copyright
@@ -0,0 +1,16 @@
+This package was debianized by Matej Cepl <matej@ceplovi.cz> on
+Sun, 27 Jul 2003 18:10:36 +0200.
+
+It was downloaded from
+http://www.rrbcurnow.freeuk.com/mairix/mairix-0.11.tar.gz.
+
+Upstream Author(s): Richard P. Curnow <rc@rc0.org.uk>
+
+Copyright:
+
+This software is copyright (C) Richard P. Curnow, 2002
+
+You are free to distribute this software
+under the terms of the GNU General Public License.
+On Debian systems, the complete text of the GNU General Public
+License can be found in /usr/share/common-licenses/GPL file.
--- mairix-0.11.orig/debian/control
+++ mairix-0.11/debian/control
@@ -0,0 +1,16 @@
+Source: mairix
+Section: mail
+Priority: optional
+Maintainer: Matej Cepl <matej@ceplovi.cz>
+Build-Depends: debhelper (>> 3.0.0)
+Standards-Version: 3.5.2
+
+Package: mairix
+Architecture: any
+Depends: ${shlibs:Depends}
+Recommends: info
+Description: Program for indexing and searching email messages.
+ Mairix is a program for indexing and searching email messages
+ stored in Maildir or MH folders. It is able to create vfolders
+ from the found messages. The real evolution for your work with
+ mails :-)!
--- mairix-0.11.orig/datescan.c
+++ mairix-0.11/datescan.c
@@ -0,0 +1,88 @@
+#include "dates.h"
+enum DATESCAN_TYPE datescan_exitval[] = {
+DS_FAILURE, /* State 0 */
+DS_FAILURE, /* State 1 */
+DS_D, /* State 2 */
+DS_D, /* State 3 */
+DS_D, /* State 4 */
+DS_FAILURE, /* State 5 */
+DS_Y, /* State 6 */
+DS_SCALED, /* State 7 */
+DS_D, /* State 8 */
+DS_SCALED, /* State 9 */
+DS_Y, /* State 10 */
+DS_FAILURE, /* State 11 */
+DS_FAILURE, /* State 12 */
+DS_SCALED, /* State 13 */
+DS_FAILURE, /* State 14 */
+DS_FAILURE, /* State 15 */
+DS_M, /* State 16 */
+DS_FAILURE, /* State 17 */
+DS_FAILURE, /* State 18 */
+DS_Y, /* State 19 */
+DS_DM, /* State 20 */
+DS_FAILURE, /* State 21 */
+DS_MD, /* State 22 */
+DS_MD, /* State 23 */
+DS_MD, /* State 24 */
+DS_FAILURE, /* State 25 */
+DS_YM, /* State 26 */
+DS_FAILURE, /* State 27 */
+DS_FAILURE, /* State 28 */
+DS_FAILURE, /* State 29 */
+DS_FAILURE, /* State 30 */
+DS_MY, /* State 31 */
+DS_MD, /* State 32 */
+DS_MY, /* State 33 */
+DS_YYMMDD, /* State 34 */
+DS_YMD, /* State 35 */
+DS_YMD, /* State 36 */
+DS_YMD, /* State 37 */
+DS_DMY, /* State 38 */
+DS_FAILURE, /* State 39 */
+DS_DMY, /* State 40 */
+DS_FAILURE, /* State 41 */
+DS_YYMMDD, /* State 42 */
+DS_FAILURE  /* State 43 */
+};
+
+static short datescan_trans[] = {
+     1,    2,    2,    3,    4,    5,    6,    6,
+     6,    6,    6,    7,    8,    8,    8,    8,
+     8,    9,    8,    8,   10,   10,   10,    9,
+    10,   10,   10,   10,   10,    9,   -1,   -1,
+    -1,   -1,   -1,   11,   12,   12,   12,   12,
+    12,   13,   -1,   -1,   -1,   -1,   -1,   -1,
+    14,   14,   14,   14,   14,    9,   -1,   -1,
+    -1,   -1,   -1,   15,   14,   14,   14,   14,
+    14,   13,   -1,   -1,   -1,   -1,   -1,   16,
+    17,   17,   17,   17,   17,    7,   -1,   -1,
+    -1,   -1,   -1,   18,   19,   19,   19,   19,
+    19,    7,   -1,   -1,   -1,   -1,   -1,   20,
+    21,   22,   22,   23,   24,   -1,   25,   25,
+    25,   25,   25,    7,   -1,   -1,   -1,   -1,
+    -1,   26,   25,   25,   25,   25,   25,   13,
+    27,   28,   28,   29,   30,   -1,   31,   31,
+    31,   31,   31,   -1,   32,   32,   32,   32,
+    32,   -1,   32,   32,   33,   33,   33,   -1,
+    33,   33,   33,   33,   33,   -1,   34,   34,
+    34,   34,   34,    7,   -1,   35,   35,   36,
+    37,   -1,   38,   38,   38,   38,   38,   -1,
+    39,   39,   39,   39,   39,   -1,   39,   39,
+    40,   40,   40,   -1,   40,   40,   40,   40,
+    40,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+    21,   21,   21,   21,   21,   -1,   21,   21,
+    21,   21,   21,   -1,   41,   41,   41,   41,
+    41,    7,   37,   37,   37,   37,   37,   -1,
+    37,   37,   -1,   -1,   -1,   -1,   -1,   -1,
+    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+    -1,   -1,   27,   27,   27,   27,   27,   -1,
+    27,   27,   27,   27,   27,   -1,   42,   42,
+    42,   42,   42,    7,   43,   43,   43,   43,
+    43,    7,   43,   43,   43,   43,   43,    7
+};
+
+int datescan_next_state(int current_state, int next_token) {
+  if (next_token < 0 || next_token >= 6) return -1;
+  return datescan_trans[6*current_state + next_token];
+}
--- mairix-0.11.orig/mairix.1
+++ mairix-0.11/mairix.1
@@ -0,0 +1,56 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH MAIRIX 1 "červenec 27, 2003"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+mairix \- program for indexing and searching email messages in
+Maildir and MH folders.
+.SH SYNOPSIS
+.B mairix
+.RI [ options ] " files" ...
+.br
+.B bar
+.RI [ options ] " files" ...
+.SH DESCRIPTION
+This manual page documents briefly the
+.B mairix
+command.
+This manual page was written for the Debian distribution
+because the original program does not have a manual page.
+Instead, it has documentation in the GNU Info format; see below.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+\fBmairix\fP is a program that...
+.SH OPTIONS
+These programs follow the usual GNU command line syntax, with long
+options starting with two dashes (`-').
+A summary of options is included below.
+For a complete description, see the Info files.
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-v, \-\-version
+Show version of program.
+.SH SEE ALSO
+The program is documented fully by
+.IR mairix
+info page available via the Info system.
+.SH AUTHOR
+This manual page was written by Matej Cepl <matej@ceplovi.cz>,
+for the Debian GNU/Linux system (but may be used by others).
--- mairix-0.11.orig/BUGS.Debian
+++ mairix-0.11/BUGS.Debian
@@ -0,0 +1 @@
+* Finish manpage.

