From cd2ef3c505829ac9f9b6eebe4e8ce7c019e799de Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Tue, 10 Jan 2012 21:51:21 +0000 Subject: [PATCH] Bring the extensions into the autoconf environment git-svn-id: http://svn.osgeo.org/postgis/trunk@8753 b70326c6-7e19-0410-871a-916f4a2858ee --- configure.ac | 23 +++++++--- extensions/postgis/{Makefile => Makefile.in} | 43 +++++++++++++------ extensions/postgis/postgis.control | 5 --- extensions/postgis/postgis.control.in | 5 +++ .../{Makefile => Makefile.in} | 16 ++++++- .../postgis_topology/postgis_topology.control | 6 --- .../postgis_topology.control.in | 6 +++ 7 files changed, 74 insertions(+), 30 deletions(-) rename extensions/postgis/{Makefile => Makefile.in} (78%) delete mode 100644 extensions/postgis/postgis.control create mode 100644 extensions/postgis/postgis.control.in rename extensions/postgis_topology/{Makefile => Makefile.in} (77%) delete mode 100644 extensions/postgis_topology/postgis_topology.control create mode 100644 extensions/postgis_topology/postgis_topology.control.in diff --git a/configure.ac b/configure.ac index bdb5f4ff5..b3c721a56 100644 --- a/configure.ac +++ b/configure.ac @@ -950,11 +950,24 @@ fi dnl # } 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 diff --git a/extensions/postgis/Makefile b/extensions/postgis/Makefile.in similarity index 78% rename from extensions/postgis/Makefile rename to extensions/postgis/Makefile.in index 86d777817..297bb8581 100644 --- a/extensions/postgis/Makefile +++ b/extensions/postgis/Makefile.in @@ -1,6 +1,19 @@ -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)) @@ -15,7 +28,7 @@ EXTRA_CLEAN += sql/$(EXTENSION).sql ${SQL_BITS} 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 $< $@ @@ -71,15 +84,6 @@ sql_bits/raster_comments.sql: ../../doc/raster_comments.sql 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' \ @@ -115,6 +119,19 @@ sql_bits/postgis--unpackaged.sql: ../../postgis/postgis.sql -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 diff --git a/extensions/postgis/postgis.control b/extensions/postgis/postgis.control deleted file mode 100644 index 9700c4add..000000000 --- a/extensions/postgis/postgis.control +++ /dev/null @@ -1,5 +0,0 @@ -# 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 diff --git a/extensions/postgis/postgis.control.in b/extensions/postgis/postgis.control.in new file mode 100644 index 000000000..a5dd676e9 --- /dev/null +++ b/extensions/postgis/postgis.control.in @@ -0,0 +1,5 @@ +# 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 diff --git a/extensions/postgis_topology/Makefile b/extensions/postgis_topology/Makefile.in similarity index 77% rename from extensions/postgis_topology/Makefile rename to extensions/postgis_topology/Makefile.in index 7fa416219..3ee96fd79 100644 --- a/extensions/postgis_topology/Makefile +++ b/extensions/postgis_topology/Makefile.in @@ -1,5 +1,19 @@ 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)) diff --git a/extensions/postgis_topology/postgis_topology.control b/extensions/postgis_topology/postgis_topology.control deleted file mode 100644 index 2cd1c3f42..000000000 --- a/extensions/postgis_topology/postgis_topology.control +++ /dev/null @@ -1,6 +0,0 @@ -# postgis topology extension -comment = 'postgis topology spatial types and functions' -default_version = '2.0.0a14' -relocatable = false -schema = topology -requires = postgis diff --git a/extensions/postgis_topology/postgis_topology.control.in b/extensions/postgis_topology/postgis_topology.control.in new file mode 100644 index 000000000..f5091e091 --- /dev/null +++ b/extensions/postgis_topology/postgis_topology.control.in @@ -0,0 +1,6 @@ +# postgis topology extension +comment = 'PostGIS topology spatial types and functions' +default_version = '@POSTGIS_LIB_VERSION@' +relocatable = false +schema = topology +requires = postgis -- 2.40.0