[postgis-tickets] r17345 - Avoid installing unneeded raster scripts in contrib dir

Sandro Santilli strk at kbt.io
Mon Mar 18 12:45:51 PDT 2019


Author: strk
Date: 2019-03-18 12:45:51 -0700 (Mon, 18 Mar 2019)
New Revision: 17345

Modified:
   trunk/.gitignore
   trunk/extensions/postgis_raster/Makefile.in
   trunk/raster/rt_pg/Makefile.in
Log:
Avoid installing unneeded raster scripts in contrib dir

Also stop building extension in non-extension things

Modified: trunk/.gitignore
===================================================================
--- trunk/.gitignore	2019-03-18 19:35:43 UTC (rev 17344)
+++ trunk/.gitignore	2019-03-18 19:45:51 UTC (rev 17345)
@@ -109,9 +109,6 @@
 postgis/legacy.sql
 postgis/postgis.sql
 postgis/postgis_proc_set_search_path.sql
-postgis/postgis_for_extension.sql
-postgis/postgis_upgrade_for_extension.sql
-postgis/postgis_upgrade_for_extension.sql.in
 postgis/postgis_upgrade.sql*
 postgis/sfcgal_upgrade.sql*
 postgis/sqldefines.h
@@ -130,8 +127,6 @@
 raster/rt_pg/rtpostgis_legacy.sql
 raster/rt_pg/rtpostgis_proc_set_search_path.sql
 raster/rt_pg/rtpostgis_upgrade.sql.in
-raster/rt_pg/rtpostgis_for_extension.sql
-raster/rt_pg/rtpostgis_upgrade_for_extension.sql.in
 raster/rt_pg/rtpostgis_upgrade*.sql
 raster/rt_pg/uninstall_rtpostgis.sql
 raster/scripts/Makefile

Modified: trunk/extensions/postgis_raster/Makefile.in
===================================================================
--- trunk/extensions/postgis_raster/Makefile.in	2019-03-18 19:35:43 UTC (rev 17344)
+++ trunk/extensions/postgis_raster/Makefile.in	2019-03-18 19:45:51 UTC (rev 17345)
@@ -10,6 +10,9 @@
 endif
 GREP = @GREP@
 
+# SQL preprocessor
+SQLPP = @SQLPP@
+
 MICRO_NUMBER  = $(shell echo $(EXTVERSION) | \
 						$(PERL) -pe 's/\d.\d.(\d+)[a-zA-Z]*\d*/$1/'
 
@@ -86,12 +89,27 @@
 		> $@
 
 #strip BEGIN/COMMIT since these are not allowed in extensions
-sql/rtpostgis.sql: ../../raster/rt_pg/rtpostgis_for_extension.sql | sql
+sql/rtpostgis.sql: sql/rtpostgis_for_extension.sql | sql
 	$(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g' $< > $@
 
-sql/rtpostgis_upgrade.sql: ../../raster/rt_pg/rtpostgis_upgrade_for_extension.sql | sql
+sql/rtpostgis_for_extension.sql: ../../raster/rt_pg/rtpostgis.sql.in | sql
+	$(SQLPP) -I../../postgis/ -I../../ $< | grep -v '^#' | \
+	$(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g" > $@
+
+sql/rtpostgis_upgrade.sql: sql/rtpostgis_upgrade_for_extension.sql | sql
 	$(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@
 
+#this keeps the @extschema at . in place since extension machinery will replace during install
+sql/rtpostgis_upgrade_for_extension.sql: ../../raster/rt_pg/rtpostgis_upgrade_cleanup.sql sql/rtpostgis_upgrade_for_extension.sql.in ../../raster/rt_pg/rtpostgis_drop.sql | sql
+	echo 'BEGIN;' > $@
+	cat $^ | sed -e 's/^BEGIN;$$//' -e 's/^COMMIT;$$//' >> $@
+	echo 'COMMIT;' >> $@
+
+
+sql/rtpostgis_upgrade_for_extension.sql.in: sql/rtpostgis_for_extension.sql ../../utils/postgis_proc_upgrade.pl | sql
+	$(PERL) ../../utils/postgis_proc_upgrade.pl $< UNUSED > $@
+
+
 ../../doc/raster_comments.sql:
 	$(MAKE) -C ../../doc comments
 

Modified: trunk/raster/rt_pg/Makefile.in
===================================================================
--- trunk/raster/rt_pg/Makefile.in	2019-03-18 19:35:43 UTC (rev 17344)
+++ trunk/raster/rt_pg/Makefile.in	2019-03-18 19:45:51 UTC (rev 17345)
@@ -29,7 +29,7 @@
 endif
 
 # Files to be copied to the contrib/ directory
-DATA_built=rtpostgis.sql rtpostgis_for_extension.sql rtpostgis_upgrade_for_extension.sql rtpostgis_upgrade.sql rtpostgis_proc_set_search_path.sql uninstall_rtpostgis.sql rtpostgis_legacy.sql
+DATA_built=rtpostgis.sql rtpostgis_upgrade.sql rtpostgis_proc_set_search_path.sql uninstall_rtpostgis.sql rtpostgis_legacy.sql
 DATA=
 
 # SQL preprocessor
@@ -77,7 +77,7 @@
 SHLIB_LINK_F = ../rt_core/librtcore.a $(LIBLWGEOM_LDFLAGS) $(LIBPGCOMMON_LDFLAGS) $(LIBGDAL_LDFLAGS) @SHLIB_LINK@
 
 # Extra files to remove during 'make clean'
-EXTRA_CLEAN=$(SQL_OBJS) $(DATA_built) rtpostgis_upgrade.sql.in rtpostgis_upgrade_for_extension.sql.in
+EXTRA_CLEAN=$(SQL_OBJS) $(DATA_built) rtpostgis_upgrade.sql.in
 
 # PGXS information
 PG_CONFIG := @PG_CONFIG@
@@ -114,10 +114,6 @@
 	$(SQLPP) -I../../postgis/ -I../../ $< | grep -v '^#' | \
 	$(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g;s'@extschema@\.''g" > $@
 
-rtpostgis_for_extension.sql: rtpostgis.sql.in
-	$(SQLPP) -I../../postgis/ -I../../ $< | grep -v '^#' | \
-	$(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g" > $@
-
 ../../liblwgeom/.libs/liblwgeom.a:
 	$(MAKE) -C ../../liblwgeom
 
@@ -139,9 +135,6 @@
 rtpostgis_upgrade.sql.in: rtpostgis.sql ../../utils/postgis_proc_upgrade.pl
 	$(PERL) ../../utils/postgis_proc_upgrade.pl $< UNUSED > $@
 
-rtpostgis_upgrade_for_extension.sql.in: rtpostgis_for_extension.sql ../../utils/postgis_proc_upgrade.pl
-	$(PERL) ../../utils/postgis_proc_upgrade.pl $< UNUSED > $@
-
 rtpostgis_proc_set_search_path.sql: rtpostgis.sql ../../utils/postgis_proc_set_search_path.pl
 	$(PERL) ../../utils/postgis_proc_set_search_path.pl $< UNUSED > $@
 
@@ -150,12 +143,6 @@
 	cat $^ | sed -e 's/^BEGIN;$$//' -e 's/^COMMIT;$$//' >> $@
 	echo 'COMMIT;' >> $@
 
-#this keeps the @extschema at . in place since extension machinery will replace during install
-rtpostgis_upgrade_for_extension.sql: rtpostgis_upgrade_cleanup.sql rtpostgis_upgrade_for_extension.sql.in rtpostgis_drop.sql
-	echo 'BEGIN;' > $@
-	cat $^ | sed -e 's/^BEGIN;$$//' -e 's/^COMMIT;$$//' >> $@
-	echo 'COMMIT;' >> $@
-
 uninstall_rtpostgis.sql: rtpostgis.sql ../../utils/create_undef.pl
 	$(PERL) ../../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
 



More information about the postgis-tickets mailing list