dnl Output the relevant files
AC_OUTPUT([GNUmakefile
- liblwgeom/Makefile liblwgeom/cunit/Makefile liblwgeom/liblwgeom.h
- libpgcommon/Makefile libpgcommon/cunit/Makefile postgis/Makefile
- postgis/sqldefines.h loader/Makefile loader/cunit/Makefile
- topology/Makefile regress/Makefile doc/Makefile doc/Makefile.comments
- doc/html/image_src/Makefile $RT_MAKEFILE_LIST])
+ extensions/postgis/Makefile
+ extensions/postgis/postgis.control
+ extensions/postgis_topology/Makefile
+ extensions/postgis_topology/postgis_topology.control
+ liblwgeom/Makefile
+ liblwgeom/cunit/Makefile
+ liblwgeom/liblwgeom.h
+ libpgcommon/Makefile
+ libpgcommon/cunit/Makefile
+ postgis/Makefile
+ postgis/sqldefines.h
+ loader/Makefile loader/cunit/Makefile
+ topology/Makefile
+ regress/Makefile
+ doc/Makefile
+ doc/Makefile.comments
+ doc/html/image_src/Makefile
+ $RT_MAKEFILE_LIST])
dnl ===========================================================================
dnl Display the configuration status information
-EXTENSION = postgis
-EXTVERSION = $(shell grep default_version $(EXTENSION).control | \
- sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
+EXTENSION = postgis
+EXTVERSION = @POSTGIS_LIB_VERSION@
+MINORVERSION = @POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
+
+MICRO_NUMBER = $(shell echo $(EXTVERSION) | sed "s/[0-9]\.[0-9]\.\([0-9]*\)[a-zA-Z]*[0-9]*/\1/")
+PREREL_NUMBER = $(shell echo $(EXTVERSION) | \
+ sed "s/[0-9]\.[0-9]\.\(.*\)/\1/" | \
+ grep "[a-zA-Z]" | \
+ sed "s/[0-9][a-zA-Z]\([0-9]*\)[a-zA-Z]*/\1/")
+MICRO_PREV = $(shell if test "$(MICRO_NUMBER)x" != "x"; then expr $(MICRO_NUMBER) - 1; fi)
+PREREL_PREV = $(shell if test "$(PREREL_NUMBER)x" != "x"; then expr $(PREREL_NUMBER) - 1; fi)
+
+PREREL_PREFIX = $(shell echo $(EXTVERSION) | \
+ sed "s/[0-9]\.[0-9]\.\(.*\)/\1/" | \
+ grep "[a-zA-Z]" | \
+ sed "s/\([0-9][a-zA-Z]*\)[0-9]*/\1/")
DATA = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
ifeq ($(PG91),yes)
sql/$(EXTENSION).sql: sql_bits/postgis.sql sql_bits/postgis_comments.sql sql_bits/rtpostgis.sql sql_bits/raster_comments.sql sql_bits/spatial_ref_sys.sql
cat $^ > $@
-all: sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--2.0.0a12--$(EXTVERSION).sql sql/$(EXTENSION)--2.0.0a13--$(EXTVERSION).sql
+all: sql/$(EXTENSION)--$(EXTVERSION).sql sql_minor_upgrade
sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql
cp $< $@
sql_bits/postgis_raster_upgrade_minor.sql: ../postgis_extension_helper.sql sql_bits/remove_from_extension.sql.in ../../postgis/postgis_drop_before.sql.in.c sql_bits/postgis_upgrade_minor.sql sql_bits/rtpostgis_upgrade_20_minor.sql ../../doc/raster_comments.sql ../../doc/postgis_comments.sql ../postgis_extension_helper_uninstall.sql
cat $^ > $@
-sql/$(EXTENSION)--2.0.0a11--$(EXTVERSION).sql: sql_bits/postgis_raster_upgrade_minor.sql
- cp $< $@
-
-sql/$(EXTENSION)--2.0.0a12--$(EXTVERSION).sql: sql_bits/postgis_raster_upgrade_minor.sql
- cp $< $@
-
-sql/$(EXTENSION)--2.0.0a13--$(EXTVERSION).sql: sql_bits/postgis_raster_upgrade_minor.sql
- cp $< $@
-
# sql_bits/rtpostgis--unpackaged.sql: ../../raster/rt_pg/rtpostgis.sql
# sed -e 's/^[\t]*//' \
# -e :a -e '$!N; s/,\n/,/; ta' \
-e 's/\\(;/;/' \
-e 's/;;/;/g' $< > $@
+sql_minor_upgrade: sql_bits/postgis_upgrade_minor.sql
+ if test "$(PREREL_NUMBER)x" != "x"; then \
+ for v in {$(PREREL_PREV)..1}; do \
+ cp -v $< sql/$(EXTENSION)--$(MINORVERSION).$(PREREL_PREFIX)$$v--$(EXTVERSION).sql; \
+ done; \
+ else \
+ if test $(MICRO_NUMBER) -gt 0; then \
+ for v in {0..$(MICRO_PREV)}; do \
+ cp -v $< sql/$(EXTENSION)--$(MINORVERSION).$$v--$(EXTVERSION).sql; \
+ done; \
+ fi; \
+ fi
+
DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql
EXTRA_CLEAN += sql/$(EXTENSION)--$(EXTVERSION).sql
endif
+++ /dev/null
-# postgis extension
-comment = 'postgis geometry,geography, and raster spatial types and functions'
-default_version = '2.0.0a14'
-module_pathname = '$libdir/postgis-2.0'
-relocatable = true
--- /dev/null
+# postgis extension
+comment = 'PostGIS geometry, geography, and raster spatial types and functions'
+default_version = '@POSTGIS_LIB_VERSION@'
+module_pathname = '$libdir/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@'
+relocatable = true
EXTENSION = postgis_topology
-EXTVERSION = $(shell grep default_version $(EXTENSION).control | sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
+EXTVERSION = @POSTGIS_LIB_VERSION@
+MINORVERSION = @POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
+
+MICRO_NUMBER = $(shell echo $(EXTVERSION) | sed "s/[0-9]\.[0-9]\.\([0-9]*\)[a-zA-Z]*[0-9]*/\1/")
+PREREL_NUMBER = $(shell echo $(EXTVERSION) | \
+ sed "s/[0-9]\.[0-9]\.\(.*\)/\1/" | \
+ grep "[a-zA-Z]" | \
+ sed "s/[0-9][a-zA-Z]\([0-9]*\)[a-zA-Z]*/\1/")
+MICRO_PREV = $(shell if test "$(MICRO_NUMBER)x" != "x"; then expr $(MICRO_NUMBER) - 1; fi)
+PREREL_PREV = $(shell if test "$(PREREL_NUMBER)x" != "x"; then expr $(PREREL_NUMBER) - 1; fi)
+
+PREREL_PREFIX = $(shell echo $(EXTVERSION) | \
+ sed "s/[0-9]\.[0-9]\.\(.*\)/\1/" | \
+ grep "[a-zA-Z]" | \
+ sed "s/\([0-9][a-zA-Z]*\)[0-9]*/\1/")
DATA = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
+++ /dev/null
-# postgis topology extension
-comment = 'postgis topology spatial types and functions'
-default_version = '2.0.0a14'
-relocatable = false
-schema = topology
-requires = postgis
--- /dev/null
+# postgis topology extension
+comment = 'PostGIS topology spatial types and functions'
+default_version = '@POSTGIS_LIB_VERSION@'
+relocatable = false
+schema = topology
+requires = postgis