Index: postgis/Makefile.in
===================================================================
--- postgis/Makefile.in	(revision 5039)
+++ postgis/Makefile.in	(working copy)
@@ -78,6 +78,10 @@
 PGXS := @PGXS@
 include $(PGXS)
 
+# We actually want data files to be stored under DATADIR/contrib/postgis-X.Y
+# so as a hack we override datadir as set by PGXS
+datadir:=$(DESTDIR)$(datadir)/contrib/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
+
 # If REGRESS=1 passed as a parameter, change the default install paths
 # so that no prefix is included. This allows us to relocate to a temporary
 # directory for regression testing.

