Permalink
Browse files

Dropped version in the setup script name for PG before 9.1

This drops the need to handle the version number in any file and simplifies
the test suite setup.
  • Loading branch information...
dvarrazzo committed Apr 4, 2011
1 parent d0e82d0 commit 7935a2dd6f358c982409d923bc961ff9b0629a09
Showing with 12 additions and 13 deletions.
  1. +1 −1 .gitignore
  2. +10 −10 Makefile
  3. +1 −2 sql/{setup-pre91.sql.ver → setup-pre91.sql}
View
@@ -1,8 +1,8 @@
data
tags
pgmp.so
+pgmp.sql
pgmp--*.sql
-sql/setup-pre91.sql
results/*.out
regression.diffs
regression.out
View
@@ -38,27 +38,27 @@ OBJS = src/pgmp.o \
src/pmpz_roots.o src/pmpz_theor.o src/pmpz_bits.o src/pmpz_rand.o \
src/pmpq.o src/pmpq_io.o src/pmpq_arith.o src/pmpq_agg.o
-# Files containing the extension version number
-VERSIONED = sql/setup-pre91.sql
+ifeq ($(PG91),91)
+INSTALLSCRIPT=pgmp--$(PGMP_VERSION).sql
+DATA = $(INSTALLSCRIPT)
+else
+INSTALLSCRIPT=pgmp.sql
+DATA = $(INSTALLSCRIPT) uninstall_pgmp.sql
+endif
-DATA = pgmp--$(PGMP_VERSION).sql uninstall_pgmp.sql
REGRESS = setup-$(PG91) mpz mpq
-EXTRA_CLEAN = pgmp--$(PGMP_VERSION).sql $(VERSIONED)
+EXTRA_CLEAN = $(INSTALLSCRIPT)
DOCS=$(wildcard docs/*.rst) docs/conf.py docs/Makefile docs/_static/pgmp.css
-# replace the version number in the many files needing it
-%.sql: %.sql.ver
- sed -e 's/\$$VERSION\$$/$(PGMP_VERSION)/' < $< > $@
-
USE_PGXS=1
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
# added to the targets defined in pgxs
-all: pgmp--$(PGMP_VERSION).sql $(VERSIONED)
+all: $(INSTALLSCRIPT)
-pgmp--$(PGMP_VERSION).sql: pgmp.pysql
+$(INSTALLSCRIPT): pgmp.pysql
tools/unmix.py < $< > $@
docs:
@@ -5,8 +5,7 @@ SET client_min_messages = warning;
-- Setup the extension on PostgreSQL before 9.1
-
-\i pgmp--$VERSION$.sql
+\i pgmp.sql
\set ECHO all
RESET client_min_messages;

0 comments on commit 7935a2d

Please sign in to comment.