From da6790429a57911114f61642cc17dc4634c9d52d Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Sat, 25 Feb 2012 13:34:01 -0800 Subject: [PATCH] Add support for building as a 9.1 extension. --- Makefile | 20 ++++++++++++++++---- plproxy.control | 7 +++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 plproxy.control diff --git a/Makefile b/Makefile index 6eef67c..9348983 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ - -# PL/Proxy version -PLPROXY_VERSION = 2.3 +EXTENSION = plproxy +EXTVERSION = $(shell grep default_version $(EXTENSION).control | \ + sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/") # set to 1 to disallow functions containing SELECT NO_SELECT = 0 @@ -13,6 +13,7 @@ PQLIB = $(shell $(PG_CONFIG) --libdir) # PostgreSQL version PGVER = $(shell $(PG_CONFIG) --version | sed 's/PostgreSQL //') SQLMED = $(shell test $(PGVER) "<" "8.4" && echo "false" || echo "true") +PG91 = $(shell test $(PGVER) "<" "9.1" && echo "false" || echo "true") # module setup MODULE_big = plproxy @@ -24,7 +25,7 @@ EXTRA_CLEAN = src/scanner.[ch] src/parser.tab.[ch] sql/plproxy.sql PG_CPPFLAGS = -I$(PQINC) -DNO_SELECT=$(NO_SELECT) SHLIB_LINK = -L$(PQLIB) -lpq -TARNAME = plproxy-$(PLPROXY_VERSION) +TARNAME = plproxy-$(EXTVERSION) DIST_DIRS = src sql expected config doc debian DIST_FILES = Makefile src/plproxy.h src/rowstamp.h src/scanner.l src/parser.y \ $(foreach t,$(REGRESS),test/sql/$(t).sql test/expected/$(t).out) \ @@ -48,6 +49,17 @@ REGRESS += plproxy_sqlmed PLPROXY_SQL += sql/plproxy_fdw.sql endif +# Extensions available, rename files as appropriate. +ifeq ($(PG91),true) +all: sql/$(EXTENSION)--$(EXTVERSION).sql + +sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql + cp $< $@ + +DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql +EXTRA_CLEAN += sql/$(EXTENSION)--$(EXTVERSION).sql +endif + REGRESS_OPTS = --dbname=regression --inputdir=test diff --git a/plproxy.control b/plproxy.control new file mode 100644 index 0000000..e66b524 --- /dev/null +++ b/plproxy.control @@ -0,0 +1,7 @@ +# plproxy extension +comment = 'Database partitioning implemented as procedural language' +default_version = '2.3.0' +module_pathname = '$libdir/plproxy' +relocatable = false +# schema = pg_catalog +superuser = false -- 2.39.5