#! /bin/sh -e
## 
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description. 

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi  
case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
		exit 1;;
esac            

exit 0
@DPATCH@
--- mgetty-1.1.28.old/frontends/X11/viewfax/Makefile	2002-08-03 17:26:26.000000000 -0400
+++ mgetty-1.1.28/frontends/X11/viewfax/Makefile	2002-08-03 17:30:26.000000000 -0400
@@ -21,15 +21,16 @@
 
 ####### Site-specific definitions #######
 # Destination directories and installation program for make install
-BINDIR = /usr/local/bin
-LIBDIR = /usr/local/lib
-MANDIR	= /usr/local/man/man1
+BINDIR = $(DESTDIR)/usr/bin
+LIBDIR = $(DESTDIR)/usr/lib
+DOCDIR = $(DESTDIR)/usr/share/doc/mgetty-viewfax
+MANDIR = $(DESTDIR)/usr/share/man/man1
 INSTALL = /usr/bin/install
 RM = rm -f
 # Location of help file
-HELP = \"$(LIBDIR)/viewfax.tif\"
+HELP = \"$(DOCDIR)/viewfax.tif\"
 # optimisation level, debug etc
-OPT = -g -O2 -Wno-uninitialized -ansi -pedantic
+OPT = -O2 -Wno-uninitialized -ansi -pedantic
 # C compiler and libraries
 # vanilla sysv
 #CC = cc
@@ -48,7 +49,7 @@
 #LIBS =
 # linux
 CC = gcc
-CFLAGS = $(OPT) -DHELPFILE=$(HELP)
+CFLAGS = -Wall $(OPT) -DHELPFILE=$(HELP) -I/usr/openwin/include
 LDFLAGS = $(OPT) -L/usr/X11R6/lib
 LIBS =
 
@@ -63,7 +64,7 @@
 install: viewfax
 	$(INSTALL) -s -m 755 viewfax $(BINDIR)
 	$(INSTALL) -m 644 viewfax.man $(MANDIR)/viewfax.1
-	$(INSTALL) -m 644 viewfax.tif $(LIBDIR)
+	$(INSTALL) -m 644 viewfax.tif $(DOCDIR)/
 
 D = viewfax-$(VERS)
 FILES = $D/README $D/COPYING $D/ChangeLog $D/Imakefile $D/Makefile \
@@ -82,7 +83,7 @@
 
 shar:;	(cd ..; shar -a -n$D -M -sfdc@cliwe.ping.de -c -o $D/part -l64 $(FILES))
 
-clean:;	$(RM) *.o *~ core
+clean:;	$(RM) *.o *~ core viewfax
 
 viewfax.o:	faxexpand.h
 faxinput.o:	faxexpand.h
