From 8eb93bebb03aa287e48885e28214c97599ebfbf0 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Mon, 18 Mar 2019 19:45:51 +0000 Subject: [PATCH] Avoid installing unneeded raster scripts in contrib dir Also stop building extension in non-extension things git-svn-id: http://svn.osgeo.org/postgis/trunk@17345 b70326c6-7e19-0410-871a-916f4a2858ee --- .gitignore | 5 ----- extensions/postgis_raster/Makefile.in | 22 ++++++++++++++++++++-- raster/rt_pg/Makefile.in | 17 ++--------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 116308c58..d9393ef7e 100644 --- a/.gitignore +++ b/.gitignore @@ -109,9 +109,6 @@ postgis/legacy_minimal.sql 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_drop.sql 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 diff --git a/extensions/postgis_raster/Makefile.in b/extensions/postgis_raster/Makefile.in index 410948992..ed50c172f 100644 --- a/extensions/postgis_raster/Makefile.in +++ b/extensions/postgis_raster/Makefile.in @@ -10,6 +10,9 @@ MODULEPATH=$$libdir/$(EXTENSION)-$(MINORVERSION) 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 @@ unpackaged_check.sql: unpackaged_check.sql.in Makefile > $@ #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@. 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 diff --git a/raster/rt_pg/Makefile.in b/raster/rt_pg/Makefile.in index 1cbb7718f..e96480a2c 100644 --- a/raster/rt_pg/Makefile.in +++ b/raster/rt_pg/Makefile.in @@ -29,7 +29,7 @@ MODULE_big=rtpostgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@ 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 @@ PG_CPPFLAGS+= $(LIBLWGEOM_CFLAGS) @CPPFLAGS@ @CFLAGS@ $(LIBGDAL_CFLAGS) $(LIBPGC 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 @@ endif $(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 @@ $(SQL_OBJS): ../../postgis/sqldefines.h ../../postgis_svn_revision.h 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 @@ rtpostgis_upgrade.sql: rtpostgis_upgrade_cleanup.sql rtpostgis_upgrade.sql.in rt cat $^ | sed -e 's/^BEGIN;$$//' -e 's/^COMMIT;$$//' >> $@ echo 'COMMIT;' >> $@ -#this keeps the @extschema@. 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) > $@ -- 2.40.0