--- ./Imakefile.orig	Mon Sep  5 01:01:30 2005
+++ ./Imakefile	Sun Apr 29 00:59:16 2007
@@ -13,8 +13,8 @@
       CCOPTIONS = -Aa -D_HPUX_SOURCE
 #endif
 
-JPEG_INCLUDES = 
-JPEG_LDFLAGS = 
+JPEG_INCLUDES = -I${LOCALBASE}/include
+JPEG_LDFLAGS = -L${LOCALBASE}/lib
 
 PNG_INCLUDES = 
 PNG_LDFLAGS = 
@@ -23,7 +23,7 @@
 DEPLIBS = $(DEPXLIB)
 LOCAL_LIBRARIES = $(XLIB) $(JPEG_LDFLAGS) $(PNG_LDFLAGS) -ljpeg -lpng -lz
 SYS_LIBRARIES = -lm
-DEFINES = -DHAS_MEMCPY
+DEFINES = -DHAS_MEMCPY -DHAVE_GUNZIP -DHAVE_BUNZIP2
 EXTRA_INCLUDES = $(JPEG_INCLUDES) $(PNG_INCLUDES)
 
 SRCS1 = bright.c clip.c cmuwmrast.c compress.c dither.c faces.c fbm.c fill.c  g3.c gif.c halftone.c imagetypes.c img.c mac.c mcidas.c mc_tables.c merge.c misc.c new.c options.c path.c pbm.c pcx.c reduce.c jpeg.c rle.c rlelib.c root.c rotate.c send.c smooth.c sunraster.c  value.c window.c xbitmap.c xli.c xpixmap.c xwd.c zio.c zoom.c ddxli.c tga.c bmp.c pcd.c png.c
@@ -36,21 +36,21 @@
 ComplexProgramTarget_1(xli,$(DEFINES) $(LOCAL_LIBRARIES),)
 ComplexProgramTarget_2(xlito,,)
 
-install:: $(SYSPATHFILE)
-	$(RM) $(BINDIR)/xview $(BINDIR)/xsetbg
-	$(LN) $(BINDIR)/xli $(BINDIR)/xview
-	$(LN) $(BINDIR)/xli $(BINDIR)/xsetbg
+install:: $(DESTDIR)$(SYSPATHFILE)
+	$(RM) $(DESTDIR)$(BINDIR)/xview $(DESTDIR)$(BINDIR)/xsetbg
+	$(LN) $(DESTDIR)$(BINDIR)/xli $(DESTDIR)$(BINDIR)/xview
+	$(LN) $(DESTDIR)$(BINDIR)/xli $(DESTDIR)$(BINDIR)/xsetbg
 
-$(SYSPATHFILE):
+$(DESTDIR)$(SYSPATHFILE):
 	@echo "*** Creating default $(SYSPATHFILE) since you"
 	@echo "*** don't have one. This file is used to set up default places"
 	@echo "*** and names to look for images.  You probably want to edit"
 	@echo "*** it for your site.  See the xloadimage manual page for"
 	@echo "*** details on the contents of this file."
-	cp /dev/null $(SYSPATHFILE)
-	echo "path=$(INCDIR)/bitmaps $(INCDIR)/images" \
-		>> $(SYSPATHFILE)
+	mkdir -p $(DESTDIR)/usr/local/lib/X11/app-defaults; cp /dev/null $(DESTDIR)$(SYSPATHFILE)
+	echo "path=$(INCDIR)/X11/bitmaps $(INCDIR)/X11/pixmaps" \
+		>> $(DESTDIR)$(SYSPATHFILE)
 	echo "extension=.gif .jpg .rle .csun .msun .sun .face .xbm .bm" \
-		>>$(SYSPATHFILE)
-	chmod a+r $(SYSPATHFILE)
+		>> $(DESTDIR)$(SYSPATHFILE)
+	chmod a+r $(DESTDIR)$(SYSPATHFILE)
 
