]> granicus.if.org Git - postgis/commitdiff
Bring the extensions into the autoconf environment
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 10 Jan 2012 21:51:21 +0000 (21:51 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 10 Jan 2012 21:51:21 +0000 (21:51 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8753 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac
extensions/postgis/Makefile.in [moved from extensions/postgis/Makefile with 78% similarity]
extensions/postgis/postgis.control [deleted file]
extensions/postgis/postgis.control.in [new file with mode: 0644]
extensions/postgis_topology/Makefile.in [moved from extensions/postgis_topology/Makefile with 77% similarity]
extensions/postgis_topology/postgis_topology.control [deleted file]
extensions/postgis_topology/postgis_topology.control.in [new file with mode: 0644]

index bdb5f4ff5c7d3061a2f58f40b081d105b9554aea..b3c721a56721224b50b79e604de075f89b8a11af 100644 (file)
@@ -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
similarity index 78%
rename from extensions/postgis/Makefile
rename to extensions/postgis/Makefile.in
index 86d77781732879cece1f8b3a119ebc2095a57b8e..297bb8581f6a3c769083e1b6babdb513e5d310a7 100644 (file)
@@ -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 (file)
index 9700c4a..0000000
+++ /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 (file)
index 0000000..a5dd676
--- /dev/null
@@ -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
similarity index 77%
rename from extensions/postgis_topology/Makefile
rename to extensions/postgis_topology/Makefile.in
index 7fa416219acd23598771f1fff9e2a7c7c92ccc92..3ee96fd79b7fe56dfc0f6d67c101dbc3a25ae39f 100644 (file)
@@ -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 (file)
index 2cd1c3f..0000000
+++ /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 (file)
index 0000000..f5091e0
--- /dev/null
@@ -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