Add support for building as a 9.1 extension.
authorDavid E. Wheeler <david@justatheory.com>
Sat, 25 Feb 2012 21:34:01 +0000 (13:34 -0800)
committerDavid E. Wheeler <david@justatheory.com>
Sat, 25 Feb 2012 21:34:01 +0000 (13:34 -0800)
Makefile
plproxy.control [new file with mode: 0644]

index 6eef67c99183f8b5ce6f985876c6e681856b04ea..9348983208d310db183308c9a40532021a62c39b 100644 (file)
--- 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 (file)
index 0000000..e66b524
--- /dev/null
@@ -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