--- wmf-1.0.5.orig/doc/wmfrc.5
+++ wmf-1.0.5/doc/wmfrc.5
@@ -0,0 +1,200 @@
+.TH wmfrc 5 "December 1997"
+.UC 4
+
+.SH NAME
+wmfrc \- Configuration file for wmf.
+
+.SH DESCRIPTION
+Use the configuration file for all configurational features of wmf.
+Wmf is looking for .wmfrc as default if nothing else defined.
+
+.SH COMMANDS
+Available command line options are the following:
+.TP
+AboutLink = <Text>
+If this link presents it will be placed to the index section.
+.TP
+AuthorCaseSort = 0n|Off
+Sorting the author index case senitive
+.TP
+AuthorEmailSort = 0n|Off
+Sorting the author index by email address.
+.TP
+BodyHtmlConvert = 0n|Off
+Turning html convert of the mail-body on/off.
+.TP
+BodyLinkEmail = 0n|Off
+Turning email detecting in the mail-body on/off.
+.TP
+BodyLinkUrl = 0n|Off
+Turning url detecting in the mail-body on/off.
+.TP
+BodyReplyChars = <Text>
+Defining characters who indicate the begin of reply text. As example ">".
+.TP
+DayLimit = <Number>
+Mails older then <Number> days won't be listed in the indexes.
+0 = no limit (default=0).
+.TP
+DebugLevel = <Number>
+Debug level (Bit0=Functions Bit1=Information Bit2=Fileoperations)
+.TP
+Directory = <Text>
+Where all the files write to (default ./)
+.TP
+DocEndFile = <Text>
+Includefile for the end of the document
+.TP
+DocStartFile = <Text>
+Includefile for the begin of the document
+.TP
+Extension = <Text>
+Define the file extension (default=".html").
+.TP
+FaceDirectory = <Text>
+Directory where to store the face files. Attention: This directory is
+RELATIVE to the html directory.
+.TP
+FaceNoData = <Text>
+What to include, if there are no face datas.
+.TP
+FaceSupport = 0n|Off
+Turn face support on/off.
+.TP
+FilePermission = <Number>
+Set file permission after creation. Numeric mode only like chown (1)
+.TP
+FolderName = <Text>
+Name of the mail folder.
+.TP
+FrameNameIndex = <Text>
+Name of the frame where the index is.
+.TP
+FrameNameText = <Text>
+Name of the frame where the mailtext is.
+.TP
+FrameNameTitle = <Text>
+Name of the frame where the title is.
+.TP
+FrameSupport = 0n|Off
+Turn frame support on/off.
+.TP
+HtmlBodyStart = <Text>
+Replacement for <BODY>
+.TP
+HtmlBodyEnd = <Text>
+Replacement for </BODY>
+.TP
+HtmlSeparator = <Text>
+Replacement for <HR>
+.TP
+HtmlReplyStart = <Text>
+If you want display the reply text italic put a <I> here.
+.TP
+HtmlReplyEnd = <Text>
+If you want display the reply text italic put a </I> here.
+.TP
+IndexAuthor = 0n|Off
+Turning indexing by author (author.html) on/off.
+.TP
+IndexDate = 0n|Off
+Turning indexing by date (date.html) on/off.
+.TP
+IndexSubject = 0n|Off
+Turning indexing by subject (subject.html) on/off.
+.TP
+IndexThread = 0n|Off
+Turning indexing by thread (thread.html) on/off.
+.TP
+LineSize = <Number>
+Lines greater then the defined limit will be breaked at the last
+space. If there wasn't any space the search continues to the next after the
+limit. If there isn't ANY space in the whole line, no breakes.
+.TP
+MailboxFile = <Text>
+Name of the mailbox file, - is used for stdin.
+.TP
+MailCommand = <Text>
+Mail-command (default MAILTO:)
+.TP
+MessageCount = 0n|Off
+Print the amount of messages in the first page of every index file.
+.TP
+NewSubjectThread = 0n|Off 
+Make a new Thread if the Subject changes in a reply.
+.TP
+PageSize = <Number>
+Lines / page index. 0 = only one page (default 0).
+Threads won't be brocken.
+.TP
+SortOrder = NewFirst|NewLast
+Define sorting
+.TP
+Statistics = 0n|Off
+Turn statistic on/off.
+.TP
+SubjectCaseSort = 0n|Off
+Sorting the subject index case senitive
+.TP
+ThreadCaseSort = 0n|Off
+Sorting the thread index case senitive
+.TP
+WriteMode = <Number>
+Write-mode (0=indexing 1=overwrite 2=append 3=append no index).
+.B Mode 0:
+If you made changes manual or anything went wrong until indexing.
+.B Mode 1:
+If you want to start from scratch witch one big mbox file.
+.I Warning: All files in the directory will be deleted !!!
+.B Mode 2:
+If you want to extend an existing archive.
+.B Mode 3:
+Specialy made if you need to convert emails stored in single files. After
+converting all files you can call WMF again in Mode 0 for indexing.
+
+.SH AUTHOR
+.NF
+Norbert Kuemin <norbert.kuemin@gmx.net>
+.FI
+
+.LP
+.SH FILES
+.NF
+~/.wmfrc
+.FI
+
+.LP
+.SH SEE ALSO
+.NF
+wmf (1)
+.FI
+
+.SH NOTES
+.NF
+Thanks to all the people, who sent emails with bug-reports and suggestions.
+.FI
+
+.SH BUGS
+.NF
+There will always rest one bug (Murphys law). If you find it, so please
+report it to Norbert.Kuemin@gmx.net
+.FI
+
+.SH COPYRIGHT
+.NF
+Copyright 1996, 1997 by Norbert Kuemin.
+
+This program 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; either version 2 of the License, or
+(at your option) any later version.
+
+This program 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 program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+.FI
--- wmf-1.0.5.orig/doc/changelog
+++ wmf-1.0.5/doc/changelog
@@ -0,0 +1,244 @@
+1999/02/04 NoK 1.0.5
+code correction for mime.
+code correction for multiple receipients.
+-----
+1999/01/23 NoK 1.0.4
+Custom file extension. See man wmfrc.
+Add mimetype graphic/x-xbitmap.
+Remove a bug in the statistics.
+Doc including now alsofor the index and stats
+-----
+1999/01/16 NoK 1.0.4
+Bug hunting
+Memory allocation cleanup
+-----
+1998/04/02 NoK 1.0.3
+Make ChangeLog ready for year 2000 :-)
+Bugfix for Mailaddresses und Names. <klasson@mbox301.swipnet.se>
+-----
+1998/03/16 NoK 1.0.2
+Thread bug in empty subject fixed. <rose@mailbag.com>
+-----
+1998/03/07 NoK 1.0.2
+Date bugfix. <seawood@very.priv.at>
+-----
+1998/02/20 NoK 1.0.1
+Frame bugfix.
+-----
+1998/02/07 NoK 1.0
+Frame support. See man wmfrc.
+Statistic page. See man wmfrc.
+-----
+1998/01/03 NoK 0.94
+Remove a bug in config.c HtmlBodyEnd. <Andre.tenBohmer@goliath.sls.wau.nl>
+-----
+1998/01/02 NoK 0.94
+Message counter. See man wmfrc.
+-----
+1997/12/31 NoK 0.94
+New directory structure.
+"No Subjects" wont be threaded.
+Breaking lines greater than x chars (LineSize = x  in the config file).
+-----
+1997/08/03 NoK 0.93
+Remove a bug in index.c
+5 more config features. See man wmfrc.
+-----
+1997/08/01 Nok 0.93
+Speedup AppendFile in file.c <exco@bat710.univ-lyon1.fr>
+manfile for wmfrc
+More config features. See man wmfrc.
+-----
+1997/07/06 NoK 0.91
+Remove a bug in GetName <schwarz@monet.m.isar.de>
+-----
+1997/06/29 NoK 0.91
+Addition work for Bug removed in threading (changing subject in a thread)
+-----
+1997/06/27 NoK 0.91
+Bug removed in reading the mail header data from html
+Marking the end of the mail header data with <!-- EmailData="End" -->
+Bug removed in threading (changing subject in a thread)
+-----
+1997/06/07 NoK 0.91
+Patch "#include <fcntl.h>"
+Patch for dmalloc <th@ant.han.de>
+Bugs removed in mime.c, file.c and mail.c <th@ant.han.de>
+New html-link to wmf
+-----
+1997/05/11 NoK 0.9
+Configuration file summary
+- MailCommand
+- FilePermission
+- DayLimit
+- PageSize
+- SortOrder
+- WriteMode
+- NoFaceFile -> FaceNoData
+- FaceSupport
+- FaceDirectory
+Now use " insteed of * in warnings
+-----
+1997/05/08 NoK 0.9
+Configuration file summary
+- ReplyChars -> BodyReplyChars
+- BodyHtmlConvert
+- BodyLinkUrl
+- BodyLinkEmail
+Start for new mime type decoding text/enriched
+-----
+1997/05/02 NoK 0.9
+Configuration file summary
+- AboutLink
+- Directory
+- MailboxFile
+- FolderName
+- DebugLevel
+-----
+1997/04/26 NoK 0.9
+Now it works also with SCO Mail <develop@flbeach.com>
+-----
+1997/04/13 NoK 0.9
+Configuration file summary
+ - HtmlBodyStart,HtmlBodyEnd
+ - HtmlSeparator (HR)
+ - ReplyChars,ReplyStart,ReplyEnd 
+ - NoFaceFile
+-----
+1997/04/02 NoK 0.9
+Begin with configuration file reading
+Another Thread bug found (Space after Subject)
+-----
+1997/03/29 NoK 0.9
+Mailheader mime decoding
+Mailheader html convert
+Thread improvement <Martin.Kraemer@mch.sni.de>
+-----
+1997/03/29 NoK 0.9
+Uudecoding with/without mime
+-----
+1997/03/19 NoK 0.9
+Bug removed (empty Mail) <admiral@panix.com>
+-----
+1997/03/17 NoK 0.9
+If a filename (mime multipart) exist, save as file and make a href
+Base64 Decoding
+GIF implementation (currently hardcoded)
+Bug redetected in thread. If there was a mail without a MessageID = wrong thread
+Add an example how I think a configurationfile should look like
+-----
+1997/03/15 NoK 0.9
+Check Directory where the html's should be write to.
+-----
+1997/03/12 NoK 0.9
+Bug removed (empty mbox-file) <manfred@Idefix.lom.camcom.it>
+Cleanups for Solaris <suter@dnrc.bell-labs.com>
+Ignore leading tabs in head datas
+-----
+1997/03/11 NoK 0.8
+additional mime, octetstream -> save as file linked by a hyperlink
+-----
+1997/03/07 NoK 0.8
+New switch -a for about-hyperlink
+Handel < and > correctly in the senders name
+use <> instead of () at from: and to: to hold the email
+Clean html in the mailbody
+line break in quoted befor a "=\n"
+-----
+1997/03/03 NoK 0.8
+LSM added to the doc
+Removing bugs from date.c (getutc) and index.c (ReadHtmlHeader)
+-----
+1997/03/02 NoK 0.8
+Hyperlinking Names with Email in thread,subject and date index
+-----
+1997/02/27 NoK 0.8
+HomePageLink to the Sender name or if not exist append the url
+-----
+1997/02/26 NoK 0.8
+write-mode 3 = append without indexing
+-----
+1997/02/25 NoK 0.8
+Bug detected in thread. If there was a mail without a MessageID = wrong thread
+Bug detected in index-files. "Page:" if there is only one
+Sorting (Author,Subject) new 
+Hyperlink email in author.html and date added
+better quoted-printable support
+start of mime support
+-----
+1997/02/23 NoK 0.7
+Detect email-addresses and make a hypelink
+threading level limitation
+Preparation for a new release (doc,cleanup)
+-----
+1997/02/22 NoK 0.7
+Handle To: fields with more than one address
+-----
+1997/02/20 NoK 0.7
+New switch -f for filepermissions
+Modify mail.c (checking for empty mails) <bbm@mh.nl>
+Exchange Append/Overwriting in doc and help
+DebugLevel default = 0
+-----
+1996/12/21 NoK 0.7
+Modify Makefile (MAILTO -> mailto) <jim@sm5323.mcclellan.af.mil>
+-----
+1996/12/13 NoK 0.7
+Modify config.c (null-string) <peter@geochange.er.usgs.gov>
+Update README
+-----
+1996/12/01 NoK 0.6
+writing README
+begin with html document
+add news to ToDo
+-----
+1996/11/23 NoK 0.6
+writing man
+little Makefile changes
+doc/LICENCE added
+-----
+1996/11/20 NoK 0.5
+compiler switch -Wall added
+cleanup done
+begin writing man
+-----
+1996/11/15 NoK 0.5
+Bug removed at AddData in mail.c
+face support implemented and tested
+new routine to handel malloc
+-----
+1996/10/19 NoK 0.4
+Bugs removed
+stdin tested
+face support started (linking compface)
+-----
+1996/10/14 NoK 0.3.0
+quoted text
+url hyperlinks
+-----
+1996/10/13 NoK 0.2.0
+Update ToDo
+Threaded index
+-----
+1996/10/12 NoK 0.2.0
+HomePage Hyperlink added
+Bug removed (empty lists)
+-----
+1996/10/10 NoK 0.2.0
+List-Datelimit
+Header-Cleanup
+-----
+1996/10/08 NoK 0.2.0
+Indexing (date,author,subject)
+Index can be splitted on more pages
+-----
+1996/09/28 NoK 0.1.0
+getutc(date.c) -> convert datestring to utc.
+CleanMailMem(mail.c) -> free allocated memory
+bug removed at addbody(mail.c)
+-----
+1996/09/28 NoK 0.1.0
+Starting ChangeLog,ToDo
+Status: - Converting mail -> html from a file
+        - Different modes (append,overwrite,indexing)
+-----
--- wmf-1.0.5.orig/examples/xfmail.sh
+++ wmf-1.0.5/examples/xfmail.sh
@@ -1,4 +1,4 @@
-#/bin/sh
+#!/bin/sh
 #
 # Converting a folder (xfmail) to html
 SRC_DIR="./mail"
--- wmf-1.0.5.orig/src/file.c
+++ wmf-1.0.5/src/file.c
@@ -29,7 +29,7 @@
        printf(".CheckHomeDir(%s)\n",Name);
     if (Name != NULL) {
         if (Name[0] == '~') {
-            newsize = strlen(Name)+strlen((char *)getenv("HOME")+1);
+            newsize = strlen(Name)+strlen((char *)getenv("HOME"));
             newname = newchar(newsize);
             strcpy(newname,(char *)getenv("HOME"));
             Name++;
@@ -49,12 +49,13 @@
 void NewFile(char *FileName, char *Text) {
     FILE *fd;
     
-    if ((config.DebugLevel != WMF_NOVALUE) && (config.DebugLevel & 4))
+    if ((config.DebugLevel != WMF_NOVALUE) && (config.DebugLevel & 4))  {
 	if (config.NewFilePerm != 0) {
 	    printf(".NewFile(%s) Perm=%o\n",FileName,(int) config.NewFilePerm);
 	} else {
 	    printf(".NewFile(%s)\n",FileName);
 	}
+    }
     fd = fopen(FileName,"w");
     if (fd != NULL) {
         fprintf(fd,"%s",Text);
--- wmf-1.0.5.orig/src/Makefile
+++ wmf-1.0.5/src/Makefile
@@ -4,8 +4,8 @@
 #
 
 # Configuration begins here
-BINDIR= /usr/local/bin
-MANDIR= /usr/local/man/man1
+BINDIR=$(DESTDIR)/usr/bin
+MANDIR=$(DESTDIR)/usr/share/man/man1
 CC=gcc
 LDFLAGS=
 COPTS=-O2
@@ -62,9 +62,9 @@
 install:
 		install -cs -m 0755 $(PROGRAM) $(BINDIR)
 		chmod 0644 ../doc/wmf.1
-		chmod 0644 ../doc/wmfrc.1
+		chmod 0644 ../doc/wmfrc.5
 		install -c -m 0644 ../doc/wmf.1 $(MANDIR)
-		install -c -m 0644 ../doc/wmfrc.1 $(MANDIR)
+		install -c -m 0644 ../doc/wmfrc.5 $(MANDIR)
 
 clean:
 		rm -f ./$(PROGRAM) *.o *~ core DEADJOE ../doc/*~ ../examples/*~ ../doc/DEADJOE
