WIP2: Python3 + PG12

This commit is contained in:
Raúl Marín
2019-12-19 16:30:23 +01:00
parent dfdbacfb30
commit 6d50c125f9
12 changed files with 45 additions and 35 deletions
+23 -6
View File
@@ -4,7 +4,7 @@ include ../../Makefile.global
#
# * install generates the control & script files into src/pg/
# and installs then into the PostgreSQL extensions directory;
# requires sudo. In additionof the current development version
# requires sudo. In addition of the current development version
# named 'dev', an alias 'current' is generating for ease of
# update (upgrade to 'current', then to 'dev').
# * test runs the tests for the currently generated Development
@@ -20,21 +20,27 @@ SOURCES_DATA_DIR = sql
SOURCES_DATA = $(wildcard $(SOURCES_DATA_DIR)/*.sql)
REPLACEMENTS = -e 's/@@VERSION@@/$(EXTVERSION)/g'
ifneq ($(PYTHON3), true)
REPLACEMENTS = -e 's/@@VERSION@@/$(EXTVERSION)/g' -e
endif
$(DATA): $(SOURCES_DATA)
$(SED) $(REPLACEMENTS) $(SOURCES_DATA_DIR)/*.sql > $@
ifeq ($(PG_PARALLEL), 0)
ifneq ($(PG_PARALLEL), true)
$(eval TMPFILE := $(shell mktemp /tmp/$@.XXXXXXXXXX))
$(SED) -e 's/PARALLEL \= [A-Z]*,/''/g' -e 's/PARALLEL [A-Z]*/''/g' $@ > $(TMPFILE);
mv $(TMPFILE) $@
endif
ifneq ($(PYTHON3), true)
$(eval TMPFILE := $(shell mktemp /tmp/$@.XXXXXXXXXX))
$(SED) -e 's/plpython3u/plpythonu/g' $$n > $(TMPFILE);
mv $(TMPFILE) $@
endif
TEST_DIR = test
REGRESS = $(sort $(notdir $(basename $(wildcard $(TEST_DIR)/sql/*test.sql))))
REGRESS_OPTS = --inputdir='$(TEST_DIR)' --outputdir='$(TEST_DIR)'
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
@@ -58,7 +64,7 @@ release: ../../release/$(EXTENSION).control $(SOURCES_DATA)
# If needed remove PARALLEL tags from the release files
release_remove_parallel_deploy:
ifeq ($(PG_PARALLEL), 0)
ifneq ($(PG_PARALLEL), true)
for n in $(wildcard ../../release/*.sql); do \
$(eval TMPFILE := $(shell mktemp /tmp/XXXXXXXXXX)) \
$(SED) -e 's/PARALLEL \= [A-Z]*,/''/g' -e 's/PARALLEL [A-Z]*/''/g' $$n > $(TMPFILE); \
@@ -66,8 +72,19 @@ ifeq ($(PG_PARALLEL), 0)
done
endif
release_adapt_plpython:
ifneq ($(PYTHON3), true)
for n in $(wildcard ../../release/*.sql); do \
$(eval TMPFILE := $(shell mktemp /tmp/XXXXXXXXXX)) \
$(SED) -e 's/plpython3u/plpythonu/g' $$n > $(TMPFILE); \
mv $(TMPFILE) $$n; \
done
endif
# Install the current release into the PostgreSQL extensions directory
deploy: release_remove_parallel_deploy
# We execute these 3 tasks to modify release files in place so they are compatible with
# the PG and python releases available during deployment, and not release
deploy: release_remove_parallel_deploy release_adapt_plpython ../../release/$(EXTENSION).control
$(INSTALL_DATA) ../../release/$(EXTENSION).control '$(DESTDIR)$(datadir)/extension/'
$(INSTALL_DATA) ../../release/*.sql '$(DESTDIR)$(datadir)/extension/'