From b5a205c8f26b2822969f830cce754974ac04a349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Wed, 25 Apr 2018 18:31:12 +0200 Subject: [PATCH] Make pointcloud and pointcloud_postgis versions match Previously the version of pointcloud was 1.1.0 while the version of pointcloud_postgis was 1.0.0. With this commit we ensure that the versions are the same. This commit also adds a PC_PostGIS_Version function that returns the version of the pointcloud_postgis extension. --- .gitignore | 2 ++ pgsql_postgis/Makefile | 12 +++++++++++- ...postgis.control => pointcloud_postgis.control.in} | 2 +- ...ud_postgis--1.0.sql => pointcloud_postgis.sql.in} | 7 +++++++ 4 files changed, 21 insertions(+), 2 deletions(-) rename pgsql_postgis/{pointcloud_postgis.control => pointcloud_postgis.control.in} (82%) rename pgsql_postgis/{pointcloud_postgis--1.0.sql => pointcloud_postgis.sql.in} (88%) diff --git a/.gitignore b/.gitignore index d71adf6..24e6c22 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ Makefile */*/Makefile pgsql/pointcloud.control pgsql/pointcloud--* +pgsql_postgis/pointcloud_postgis.control +pgsql_postgis/pointcloud_postgis--* diff --git a/pgsql_postgis/Makefile b/pgsql_postgis/Makefile index 8f17bf9..605262b 100644 --- a/pgsql_postgis/Makefile +++ b/pgsql_postgis/Makefile @@ -4,8 +4,12 @@ include ../config.mk #MODULE_big = pointcloud_postgis #OBJS = +SED = sed EXTENSION = pointcloud_postgis -DATA = $(EXTENSION)--1.0.sql +EXTVERSION=$(shell cat ../Version.config) +DATA_built = \ + $(EXTENSION).control \ + $(EXTENSION)--$(EXTVERSION).sql #REGRESS = pointcloud @@ -15,3 +19,9 @@ DATA = $(EXTENSION)--1.0.sql # We are going to use PGXS for sure include $(PGXS) + +$(EXTENSION).control: $(EXTENSION).control.in Makefile + $(SED) -e 's/@POINTCLOUD_VERSION@/$(EXTVERSION)/' $< > $@ + +$(EXTENSION)--$(EXTVERSION).sql: $(EXTENSION).sql.in Makefile + $(SED) -e 's/@POINTCLOUD_VERSION@/$(EXTVERSION)/' $< > $@ diff --git a/pgsql_postgis/pointcloud_postgis.control b/pgsql_postgis/pointcloud_postgis.control.in similarity index 82% rename from pgsql_postgis/pointcloud_postgis.control rename to pgsql_postgis/pointcloud_postgis.control.in index 01431da..25771d0 100644 --- a/pgsql_postgis/pointcloud_postgis.control +++ b/pgsql_postgis/pointcloud_postgis.control.in @@ -1,6 +1,6 @@ # pointcloud postgis integration extension comment = 'integration for pointcloud LIDAR data and PostGIS geometry data' -default_version = '1.0' +default_version = '@POINTCLOUD_VERSION@' relocatable = true superuser = false requires = 'postgis, pointcloud' diff --git a/pgsql_postgis/pointcloud_postgis--1.0.sql b/pgsql_postgis/pointcloud_postgis.sql.in similarity index 88% rename from pgsql_postgis/pointcloud_postgis--1.0.sql rename to pgsql_postgis/pointcloud_postgis.sql.in index 27b1ecd..408c45b 100644 --- a/pgsql_postgis/pointcloud_postgis--1.0.sql +++ b/pgsql_postgis/pointcloud_postgis.sql.in @@ -72,3 +72,10 @@ CREATE OR REPLACE FUNCTION PC_BoundingDiagonalGeometry(pcpatch) SELECT ST_GeomFromEWKB(PC_BoundingDiagonalAsBinary($1)) $$ LANGUAGE 'sql'; + +----------------------------------------------------------------------------- +-- Function returning the version number +-- +CREATE OR REPLACE FUNCTION PC_PostGIS_Version() + RETURNS text AS $$ SELECT '@POINTCLOUD_VERSION@'::text $$ + LANGUAGE 'sql' IMMUTABLE STRICT;