[postgis-tickets] r16269 - Generate control file from Makefile rather than ./configure

Sandro Santilli strk at kbt.io
Fri Jan 12 04:39:37 PST 2018


Author: strk
Date: 2018-01-12 04:39:37 -0800 (Fri, 12 Jan 2018)
New Revision: 16269

Modified:
   trunk/configure.ac
   trunk/extensions/address_standardizer/Makefile.in
   trunk/extensions/address_standardizer/address_standardizer.control.in
   trunk/extensions/address_standardizer/address_standardizer_data_us.control.in
   trunk/extensions/postgis_tiger_geocoder/Makefile.in
   trunk/extensions/postgis_tiger_geocoder/postgis_tiger_geocoder.control.in
Log:
Generate control file from Makefile rather than ./configure

Simplifies code to be more localized, fixed distclean and clean
to drop those generated files

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2018-01-12 10:29:34 UTC (rev 16268)
+++ trunk/configure.ac	2018-01-12 12:39:37 UTC (rev 16269)
@@ -1443,8 +1443,6 @@
    extensions/postgis_tiger_geocoder/Makefile
    extensions/postgis_tiger_geocoder/postgis_tiger_geocoder.control
    extensions/address_standardizer/Makefile
-   extensions/address_standardizer/address_standardizer.control
-   extensions/address_standardizer/address_standardizer_data_us.control
    liblwgeom/Makefile
    liblwgeom/cunit/Makefile
    liblwgeom/liblwgeom.h

Modified: trunk/extensions/address_standardizer/Makefile.in
===================================================================
--- trunk/extensions/address_standardizer/Makefile.in	2018-01-12 10:29:34 UTC (rev 16268)
+++ trunk/extensions/address_standardizer/Makefile.in	2018-01-12 12:39:37 UTC (rev 16269)
@@ -36,6 +36,11 @@
 EXTENSION = address_standardizer
 DATA = address_standardizer_data_us.control sql/$(EXTENSION).sql sql/$(EXTENSION)_data_us.sql
 
+DATA_built = \
+	$(EXTENSION).control \
+	$(EXTENSION)_data_us.control \
+	$(NULL)
+
 all:  sql/address_standardizer.sql sql/address_standardizer--1.0--$(EXTVERSION).sql sql/address_standardizer--$(EXTVERSION).sql sql/address_standardizer--$(EXTVERSION)--$(EXTVERSION)next.sql sql/address_standardizer--$(EXTVERSION)next--$(EXTVERSION).sql \
  sql/$(EXTENSION)_data_us.sql sql/address_standardizer-- at POSTGIS_LIB_VERSION@.sql sql/$(EXTENSION)_data_us-- at POSTGIS_LIB_VERSION@.sql  sql/$(EXTENSION)_data_us--$(EXTVERSION)--$(EXTVERSION)next.sql \
 sql/$(EXTENSION)_data_us--$(EXTVERSION)next--$(EXTVERSION).sql \
@@ -68,6 +73,11 @@
 	$(SQLPP) -I../libpgcommon $< | grep -v '^#' | \
 	$(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/${EXTENSION}'g" > $@
 
+%.control: %.control.in Makefile
+	cat $< \
+		| sed -e 's|@EXTVERSION@|$(EXTVERSION)|g' \
+		> $@
+
 sql/address_standardizer-- at POSTGIS_LIB_VERSION@.sql: sql/address_standardizer_types.sql \
     sql/address_standardizer_functions.sql
 	cat $^ > $@
@@ -169,6 +179,8 @@
 EXTRA_CLEAN += sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql
 EXTRA_CLEAN += sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql *.a *.so *.dll
 
+EXTRA_CLEAN += Makefile
+
 PGXS := @PGXS@
 include $(PGXS)
 PERL = @PERL@

Modified: trunk/extensions/address_standardizer/address_standardizer.control.in
===================================================================
--- trunk/extensions/address_standardizer/address_standardizer.control.in	2018-01-12 10:29:34 UTC (rev 16268)
+++ trunk/extensions/address_standardizer/address_standardizer.control.in	2018-01-12 12:39:37 UTC (rev 16269)
@@ -1,4 +1,4 @@
 # address_standardizer extension
 comment = 'Used to parse an address into constituent elements. Generally used to support geocoding address normalization step.'
-default_version = '@POSTGIS_LIB_VERSION@'
+default_version = '@EXTVERSION@'
 relocatable = true

Modified: trunk/extensions/address_standardizer/address_standardizer_data_us.control.in
===================================================================
--- trunk/extensions/address_standardizer/address_standardizer_data_us.control.in	2018-01-12 10:29:34 UTC (rev 16268)
+++ trunk/extensions/address_standardizer/address_standardizer_data_us.control.in	2018-01-12 12:39:37 UTC (rev 16269)
@@ -1,4 +1,4 @@
 # address standardizer us dataset
 comment = 'Address Standardizer US dataset example'
-default_version = '@POSTGIS_LIB_VERSION@'
+default_version = '@EXTVERSION@'
 relocatable = true

Modified: trunk/extensions/postgis_tiger_geocoder/Makefile.in
===================================================================
--- trunk/extensions/postgis_tiger_geocoder/Makefile.in	2018-01-12 10:29:34 UTC (rev 16268)
+++ trunk/extensions/postgis_tiger_geocoder/Makefile.in	2018-01-12 12:39:37 UTC (rev 16269)
@@ -23,6 +23,11 @@
                         $(PERL) -pe 's/(\d+[a-zA-Z]+)\d*/\1/'
 
 DATA         = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
+
+DATA_built = \
+	$(EXTENSION).control \
+	$(NULL)
+
 REGRESS = test-normalize_address test-upgrade
 REGRESS_OPTS = --load-extension=fuzzystrmatch --load-extension=postgis --load-extension=$(EXTENSION)
 
@@ -62,6 +67,11 @@
 sql/test-upgrade.sql: | sql
 	echo 'ALTER EXTENSION ${EXTENSION} UPDATE TO "$(EXTVERSION)next"' > $@
 
+%.control: %.control.in Makefile
+	cat $< \
+		| sed -e 's|@EXTVERSION@|$(EXTVERSION)|g' \
+		> $@
+
 expected/test-upgrade.out: sql/test-upgrade.sql | expected
 	cp $< $@
 

Modified: trunk/extensions/postgis_tiger_geocoder/postgis_tiger_geocoder.control.in
===================================================================
--- trunk/extensions/postgis_tiger_geocoder/postgis_tiger_geocoder.control.in	2018-01-12 10:29:34 UTC (rev 16268)
+++ trunk/extensions/postgis_tiger_geocoder/postgis_tiger_geocoder.control.in	2018-01-12 12:39:37 UTC (rev 16269)
@@ -1,6 +1,6 @@
-# postgis tiger geocoder extension
-comment = 'PostGIS tiger geocoder and reverse geocoder'
-default_version = '@POSTGIS_LIB_VERSION@'
-relocatable = false
-schema = tiger
-requires = 'postgis,fuzzystrmatch'
+# postgis tiger geocoder extension
+comment = 'PostGIS tiger geocoder and reverse geocoder'
+default_version = '@EXTVERSION@'
+relocatable = false
+schema = tiger
+requires = 'postgis,fuzzystrmatch'



More information about the postgis-tickets mailing list