--- PDFlib-Lite-7.0.2/bind/pdflib/tcl/Makefile.orig	2007-06-25 04:32:47.000000000 +0200
+++ PDFlib-Lite-7.0.2/bind/pdflib/tcl/Makefile	2007-06-25 04:34:12.000000000 +0200
@@ -50,16 +50,16 @@
 	../../../progs/pdi/pdfcheck -i ../java/starter.ref -o -
 
 install:: $(LIBNAME)
-	if test ! -d $(LANG_LIBDIR) ; then 	\
-	    mkdir -p $(LANG_LIBDIR);		\
-	    chmod 755 $(LANG_LIBDIR);		\
+	if test ! -d $(DESTDIR)$(LANG_LIBDIR) ; then 	\
+	    mkdir -p $(DESTDIR)$(LANG_LIBDIR);		\
+	    chmod 755 $(DESTDIR)$(LANG_LIBDIR);		\
 	fi
-	$(INSTALL_DATA) pkgIndex.tcl $(LANG_LIBDIR)
+	$(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(LANG_LIBDIR)
 	@-if test -f .libs/libpdflib_tcl.dylib; then			\
-	    $(INSTALL_DATA) .libs/pdflib_tcl.dylib $(LANG_LIBDIR);	\
+	    $(INSTALL_DATA) .libs/pdflib_tcl.dylib $(DESTDIR)$(LANG_LIBDIR);	\
 	else								\
 	    $(LIBTOOL) --mode=install $(INSTALL_DATA)			\
-		$(LIBNAME) $(LANG_LIBDIR);				\
+		$(LIBNAME) $(DESTDIR)$(LANG_LIBDIR);				\
 	fi
 
 uninstall::
--- PDFlib-Lite-7.0.2/bind/pdflib/java/Makefile.orig	2007-06-25 04:34:18.000000000 +0200
+++ PDFlib-Lite-7.0.2/bind/pdflib/java/Makefile	2007-06-25 04:36:38.000000000 +0200
@@ -90,10 +90,10 @@
 install:: $(LIBNAME) pdflib.jar
 	@-if test -f .libs/libpdf_java.jnilib; then		\
 	    $(LIBTOOL) --mode=install $(INSTALL_DATA)		\
-		.libs/libpdf_java.jnilib $(LANG_LIBDIR);	\
+		.libs/libpdf_java.jnilib $(DESTDIR)$(LANG_LIBDIR);	\
 	else							\
 	    $(LIBTOOL) --mode=install $(INSTALL_DATA)		\
-		$(LIBNAME) $(LANG_LIBDIR);			\
+		$(LIBNAME) $(DESTDIR)$(LANG_LIBDIR);			\
 	fi
 	@echo Copy pdflib.jar and javadoc to an appropriate directory,
 	@echo and include pdflib.jar in your CLASSPATH.
--- PDFlib-Lite-7.0.2/bind/pdflib/perl/Makefile.orig	2007-06-25 04:36:46.000000000 +0200
+++ PDFlib-Lite-7.0.2/bind/pdflib/perl/Makefile	2007-06-25 04:37:42.000000000 +0200
@@ -47,8 +47,8 @@
 
 install:: $(LIBNAME)
 	$(LIBTOOL) --mode=install \
-		$(INSTALL_DATA) $(LIBNAME) $(LANG_LIBDIR)
-	$(INSTALL_DATA) pdflib_pl.pm $(LANG_LIBDIR)
+		$(INSTALL_DATA) $(LIBNAME) $(DESTDIR)$(LANG_LIBDIR)
+	$(INSTALL_DATA) pdflib_pl.pm $(DESTDIR)$(LANG_LIBDIR)
 
 uninstall::
 	$(LIBTOOL) --mode=uninstall \
--- PDFlib-Lite-7.0.2/bind/pdflib/python/Makefile.orig	2007-06-25 04:37:50.000000000 +0200
+++ PDFlib-Lite-7.0.2/bind/pdflib/python/Makefile	2007-06-25 04:38:16.000000000 +0200
@@ -48,10 +48,10 @@
 
 install:: $(LIBNAME)
 	@-if test -f .libs/libpdflib_py.dylib; then		\
-	    $(INSTALL_DATA) .libs/pdflib_py.so $(LANG_LIBDIR);	\
+	    $(INSTALL_DATA) .libs/pdflib_py.so $(DESTDIR)$(LANG_LIBDIR);	\
 	else							\
 	    $(LIBTOOL) --mode=install $(INSTALL_DATA) 		\
-		$(LIBNAME) $(LANG_LIBDIR);			\
+		$(LIBNAME) $(DESTDIR)$(LANG_LIBDIR);			\
 	fi
 
 uninstall::
--- PDFlib-Lite-7.0.2/Makefile.orig	2007-06-25 04:38:40.000000000 +0200
+++ PDFlib-Lite-7.0.2/Makefile	2007-06-25 04:39:33.000000000 +0200
@@ -11,8 +11,8 @@
 
 # --------------------------- install ---------------------------------
 install:: .dummy
-	mkdir -p $(bindir)
-	$(INSTALL) pdflib-config $(bindir)
+	mkdir -p $(DESTDIR)$(bindir)
+	$(INSTALL) pdflib-config $(DESTDIR)$(bindir)
 
 # ----------------------- distclean ---------------------------------
 distclean:: .dummy
--- PDFlib-Lite-7.0.2/config/mkmainlib.inc.in.orig	2007-06-25 04:30:02.000000000 +0200
+++ PDFlib-Lite-7.0.2/config/mkmainlib.inc.in	2007-06-25 04:32:22.000000000 +0200
@@ -17,21 +17,21 @@
 	$(CC) $(CPPFLAGS) $(CFLAGS) -MM $(MAINSRC) | sed 's/^\(.*\)\.o:/$$(OO)\/\1$$(LO):/' >>Makefile
 
 install:: $(MAINLIBNAME)
-	if test ! -d $(libdir) ; then 	\
-	    mkdir -p $(libdir);		\
-	    chmod 755 $(libdir);	\
+	if test ! -d $(DESTDIR)$(libdir) ; then 	\
+	    mkdir -p $(DESTDIR)$(libdir);		\
+	    chmod 755 $(DESTDIR)$(libdir);	\
 	fi
-	if test ! -d $(includedir) ; then 	\
-	    mkdir -p $(includedir);		\
-	    chmod 755 $(includedir);		\
+	if test ! -d $(DESTDIR)$(includedir) ; then 	\
+	    mkdir -p $(DESTDIR)$(includedir);		\
+	    chmod 755 $(DESTDIR)$(includedir);		\
 	fi
-	$(INSTALL_DATA) $(MAININC) $(includedir)
+	$(INSTALL_DATA) $(MAININC) $(DESTDIR)$(includedir)
 	@-if test "$(WITH_SHARED)" = "no"; then	\
 	    cp .libs/$(MAINLIBNAME) .libs/$(MAINLIBNAME)i;\
 	fi
-	$(LIBTOOL) $(INSTALL_DATA) $(MAINLIBNAME) $(libdir);
+	$(LIBTOOL) $(INSTALL_DATA) $(MAINLIBNAME) $(DESTDIR)$(libdir);
 	@-if test "$(WITH_SHARED)" = "yes"; then	\
-	    $(LIBTOOL) -n --finish $(libdir);\
+	    $(LIBTOOL) -n --finish $(DESTDIR)$(libdir);\
 	else\
 	    rm -f .libs/$(MAINLIBNAME)i;\
 	fi
--- PDFlib-Lite-7.0.2/progs/pdflib/Makefile.orig	2007-08-13 12:52:48.000000000 +0200
+++ PDFlib-Lite-7.0.2/progs/pdflib/Makefile	2007-09-12 01:22:28.000000000 +0200
@@ -37,7 +37,7 @@
 	$(PROGS_LINK)
 
 install:: pdfimage text2pdf
-	mkdir -p $(bindir)
-	$(INSTALL) pdfimage text2pdf $(bindir)
+	mkdir -p $(DESTDIR)$(bindir)
+	$(INSTALL) pdfimage text2pdf $(DESTDIR)$(bindir)
 
 # Automatically generated dependencies
