EXTVERSION = @POSTGIS_LIB_VERSION@
MINORVERSION = @POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
GREP = @GREP@
-PERL=@PERL@
+PERL = @PERL@
+
+MICRO_NUMBER = $(shell echo $(EXTVERSION) | \
+ $(PERL) -pe 's/\d.\d.(\d+)[a-zA-Z]*\d*/$1/'
-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/" | \
+ $(PERL) -pe 's/\d\.\d\.(.*)/\1/' | \
$(GREP) "[a-zA-Z]" | \
- sed "s/[0-9][a-zA-Z]\([0-9]*\)[a-zA-Z]*/\1/")
+ $(PERL) -pe 's/\d+[a-zA-Z]+(\d+)/\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/" | \
+ $(PERL) -pe 's/\d\.\d\.(.*)/\1/' | \
$(GREP) "[a-zA-Z]" | \
- sed "s/\([0-9][a-zA-Z]*\)[0-9]*/\1/")
+ $(PERL) -pe 's/(\d+[a-zA-Z]+)\d*/\1/'
DATA = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
#strip BEGIN/COMMIT since these are not allowed in extensions
sql_bits/spatial_ref_sys.sql: ../../spatial_ref_sys.sql
- sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' $< > $@
+ $(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g' $< > $@
#strip BEGIN/COMMIT since these are not allowed in extensions
sql_bits/postgis.sql: ../../postgis/postgis.sql
mkdir -p sql_bits/
- sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' $< > $@
+ $(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g' $< > $@
../../doc/postgis_comments.sql:
$(MAKE) -C ../../doc comments
#strip BEGIN/COMMIT since these are not allowed in extensions
sql_bits/rtpostgis.sql: ../../raster/rt_pg/rtpostgis.sql
- sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' $< > $@
+ $(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g' $< > $@
sql_bits/spatial_ref_sys_config_dump.sql: ../../spatial_ref_sys.sql ../../utils/create_spatial_ref_sys_config_dump.pl
../../utils/create_spatial_ref_sys_config_dump.pl $< > $@
sql_bits/rtpostgis_upgrade.sql: ../../raster/rt_pg/rtpostgis_upgrade.sql
- sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \
- -e "s/^\(DROP .*\);/SELECT postgis_extension_drop_if_exists('${EXTENSION}', '\1');\n\1;/" \
- $< > $@
+ $(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@
sql_bits/postgis_upgrade.sql: ../../postgis/postgis_upgrade.sql
- sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \
- -e "s/^\(DROP .*\);/SELECT postgis_extension_drop_if_exists('${EXTENSION}', '\1');\n\1;/" \
- $< > $@
+ $(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@
../../doc/raster_comments.sql:
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
-PERL=@PERL@
+PERL = @PERL@