--- /dev/null
+--- gdal-1.1.7/GNUmakefile.orig Wed Mar 27 22:41:45 2002
++++ gdal-1.1.7/GNUmakefile Mon Jun 17 22:45:44 2002
+@@ -114,10 +114,10 @@
+ install: lib install-actions
+
+ install-actions:
+- $(INSTALL_DIR) $(INST_BIN)
+- $(INSTALL_DIR) $(INST_DATA)
+- $(INSTALL_DIR) $(INST_LIB)
+- $(INSTALL_DIR) $(INST_INCLUDE)
++ $(INSTALL_DIR) $(DESTDIR)$(INST_BIN)
++ $(INSTALL_DIR) $(DESTDIR)$(INST_DATA)
++ $(INSTALL_DIR) $(DESTDIR)$(INST_LIB)
++ $(INSTALL_DIR) $(DESTDIR)$(INST_INCLUDE)
+ (cd port; $(MAKE) install)
+ (cd core; $(MAKE) install)
+ (cd frmts; $(MAKE) install)
+@@ -126,8 +126,8 @@
+ ifneq ($(PYTHON),no)
+ (cd pymod; $(MAKE) install)
+ endif
+- $(INSTALL) $(GDAL_LIB) $(INST_LIB)
++ $(INSTALL) $(GDAL_LIB) $(DESTDIR)$(INST_LIB)
+ ifeq ($(HAVE_LD_SHARED),yes)
+- $(INSTALL) $(GDAL_SLIB) $(INST_LIB)
++ $(INSTALL) $(GDAL_SLIB) $(DESTDIR)$(INST_LIB)
+ endif
+- for f in data/*.csv data/stateplane.txt ; do $(INSTALL) $$f $(INST_DATA) ; done
++ for f in data/*.csv data/stateplane.txt ; do $(INSTALL) $$f $(DESTDIR)$(INST_DATA) ; done
+--- gdal-1.1.7/ogr/GNUmakefile.orig Fri Mar 29 00:54:26 2002
++++ gdal-1.1.7/ogr/GNUmakefile Mon Jun 17 22:46:38 2002
+@@ -123,16 +123,16 @@
+
+ ifeq ($(OGR_ENABLED),yes)
+ install-full: ogrinfo ogr2ogr ogrtindex
+- $(INSTALL) ogr2ogr $(INST_BIN)
+- $(INSTALL) ogrinfo $(INST_BIN)
+- $(INSTALL) ogrtindex $(INST_BIN)
+- $(INSTALL) $(OGRFRMTS_LIB) $(INST_LIB)
++ $(INSTALL) ogr2ogr $(DESTDIR)$(INST_BIN)
++ $(INSTALL) ogrinfo $(DESTDIR)$(INST_BIN)
++ $(INSTALL) ogrtindex $(DESTDIR)$(INST_BIN)
++ $(INSTALL) $(OGRFRMTS_LIB) $(DESTDIR)$(INST_LIB)
+ else
+ install-full:
+ endif
+
+ install: $(OGR_LIB) install-full
+- for f in $(INST_H_FILES) ; do $(INSTALL) $$f $(INST_INCLUDE) ; done
+- $(INSTALL) $(OGR_LIB) $(INST_LIB)
++ for f in $(INST_H_FILES) ; do $(INSTALL) $$f $(DESTDIR)$(INST_INCLUDE) ; done
++ $(INSTALL) $(OGR_LIB) $(DESTDIR)$(INST_LIB)
+
+
+--- gdal-1.1.7/pymod/GNUmakefile.orig Sat Sep 15 04:51:29 2001
++++ gdal-1.1.7/pymod/GNUmakefile Mon Jun 17 22:48:07 2002
+@@ -30,5 +30,5 @@
+
+
+ install:
+- $(INSTALL_DIR) $(INST_PYMOD)
+- for f in *.py $(GDALMODULE) ; do $(INSTALL) $$f $(INST_PYMOD) ; done
++ $(INSTALL_DIR) $(DESTDIR)$(INST_PYMOD)
++ for f in *.py $(GDALMODULE) ; do $(INSTALL) $$f $(DESTDIR)$(INST_PYMOD) ; done
+--- gdal-1.1.7/port/GNUmakefile.orig Wed Jan 23 21:45:16 2002
++++ gdal-1.1.7/port/GNUmakefile Mon Jun 17 22:48:41 2002
+@@ -33,8 +33,8 @@
+ $(RANLIB) $(LIB)
+
+ install: $(LIB)
+- for f in *.h ; do $(INSTALL) $$f $(INST_INCLUDE) ; done
+- $(INSTALL) cpl.a $(INST_LIB)
++ for f in *.h ; do $(INSTALL) $$f $(DESTDIR)$(INST_INCLUDE) ; done
++ $(INSTALL) cpl.a $(DESTDIR)$(INST_LIB)
+
+ xmlreformat: xmlreformat.o $(LIB)
+- $(CXX) $(CXXFLAGS) xmlreformat.o $(LIB) -o xmlreformat
+\ No newline at end of file
++ $(CXX) $(CXXFLAGS) xmlreformat.o $(LIB) -o xmlreformat
+--- gdal-1.1.7/alg/GNUmakefile.orig Thu Mar 15 04:17:34 2001
++++ gdal-1.1.7/alg/GNUmakefile Mon Jun 17 22:49:24 2002
+@@ -19,4 +19,4 @@
+ $(CXX) -c $(GDAL_INCLUDE) $(CXXFLAGS) $*.cpp -o $*.o
+
+ install:
+- for f in *.h ; do $(INSTALL) $$f $(INST_INCLUDE) ; done
++ for f in *.h ; do $(INSTALL) $$f $(DESTDIR)$(INST_INCLUDE) ; done
+--- gdal-1.1.7/apps/GNUmakefile.orig Wed Nov 7 04:49:16 2001
++++ gdal-1.1.7/apps/GNUmakefile Mon Jun 17 22:50:06 2002
+@@ -86,6 +86,6 @@
+
+
+ install: default
+- for f in $(BIN_LIST) ; do $(INSTALL) $$f $(INST_BIN) ; done
+- $(INSTALL) gdal-config-inst $(INST_BIN)/gdal-config
++ for f in $(BIN_LIST) ; do $(INSTALL) $$f $(DESTDIR)$(INST_BIN) ; done
++ $(INSTALL) gdal-config-inst $(DESTDIR)$(INST_BIN)/gdal-config
+
+--- gdal-1.1.7/core/GNUmakefile.orig Wed Nov 21 04:16:47 2001
++++ gdal-1.1.7/core/GNUmakefile Mon Jun 17 22:50:30 2002
+@@ -26,4 +26,4 @@
+ $(CXX) -c $(GDAL_INCLUDE) $(CXXFLAGS) $*.cpp -o $*.o
+
+ install:
+- for f in *.h ; do $(INSTALL) $$f $(INST_INCLUDE) ; done
++ for f in *.h ; do $(INSTALL) $$f $(DESTDIR)$(INST_INCLUDE) ; done
--- /dev/null
+#
+# TODO:
+# separate -devel, python- etc.
+# more formats (CFITSIO, OGDI, GRASS)
+# link dynamically where possible
+%include /usr/lib/rpm/macros.python
+Summary: Geospatial Data Abstraction Library
+Summary(pl): Biblioteka abstrakcji danych dotycz±cych powierzchni Ziemi
+Name: gdal
+Version: 1.1.7
+Release: 0.1
+License: BSD-like
+Group: Libraries
+Source0: ftp://ftp.remotesensing.org/pub/gdal/%{name}-%{version}.tar.gz
+Patch0: %{name}-jpeg.patch
+Patch1: %{name}-acfix.patch
+Patch2: %{name}-pgsql.patch
+Patch3: %{name}-DESTDIR.patch
+URL: http://www.remotesensing.org/gdal/
+BuildRequires: autoconf
+BuildRequires: libjpeg-devel
+BuildRequires: libpng-devel
+#BuildRequires: libtiff-devel >= 3.6.0
+BuildRequires: libungif-devel
+BuildRequires: postgresql-devel
+BuildRequires: postgresql-backend-devel
+BuildRequires: python-devel
+BuildRequires: rpm-pythonprov
+BuildRequires: zlib-devel >= 1.1.4
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+GDAL is a translator library for raster geospatial data formats that
+is released under an Open Source license. As a library, it presents a
+single abstract data model to the calling application for all
+supported formats. The related OGR library (which lives within the
+GDAL source tree) provides a similar capability for simple features
+vector data.
+
+%description -l pl
+GDAL to biblioteka konwertuj±ca miêdzy formatami rastrowych danych
+dotycz±cych powierzchni Ziemi, udostêpniona na licencji Open Source.
+Jako biblioteka udostêpnia aplikacjom jeden abstrakcyjny model danych
+do wszystkich obs³ugiwanych formatów. Powi±zana z nia biblioteka OGR
+(której ¼ród³a s± do³±czone do drzewa ¼róde³ GDAL) daje podobne
+mo¿liwo¶ci dla danych wektorowych.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+
+%build
+%{__autoconf}
+%configure
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT
+
+%{__make} install DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc NEWS html/*.{html,gif,css}
+%attr(755,root,root) %{_bindir}/*
+%attr(755,root,root) %{_libdir}/lib*.so
+%{_libdir}/*.a
+%{_includedir}/*.h
+%attr(755,root,root) %{py_sitedir}/_gdalmodule.so
+%{py_sitedir}/*.py
+%{_datadir}/gdal