Permalink
Browse files

Simplify the Makefile for 9.1.

Distribute a file to migrate from unpackaged, rather than copy it.
  • Loading branch information...
1 parent f60ff04 commit 2054894eb627329d740a851268f8d27c3b6c40da @theory committed Apr 30, 2011
Showing with 22 additions and 28 deletions.
  1. +3 −0 Changes
  2. +1 −1 META.json
  3. +17 −26 Makefile
  4. +1 −1 README.md
  5. 0 sql/{pair--unpackaged.sql → pair--unpackaged--0.1.2.sql}
View
@@ -1,5 +1,8 @@
Revision history for PostgreSQL extension pair.
+0.1.3
+ - Simplified the `CREATE EXTENSION` support in the `Makefile`.
+
0.1.2 2011-04-20T23:43:33
- Properly updated version number in all relevant files.
- Added abstract and doc file to the `provides` section of `META.json`.
View
@@ -2,7 +2,7 @@
"name": "pair",
"abstract": "A key/value pair data type",
"description": "This library contains a single PostgreSQL extension, a key/value pair data type called “pair”, along with a convenience function for constructing key/value pairs.",
- "version": "0.1.2",
+ "version": "0.1.3",
"maintainer": [
"David E. Wheeler <david@justatheory.com>"
],
View
@@ -1,33 +1,24 @@
-EXTENSION =pair
-EXTVERSION = $(shell grep default_version $(EXTENSION).control | \
- sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
-
-DATA = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
-DOCS = $(wildcard doc/*.txt)
-TESTS = $(wildcard test/sql/*.sql)
-REGRESS = $(patsubst test/sql/%.sql,%,$(TESTS))
-REGRESS_OPTS = --inputdir=test
-MODULES = $(patsubst %.c,%,$(wildcard src/*.c))
-
-PG_CONFIG = pg_config
-
-VERSION = $(shell $(PG_CONFIG) --version | awk '{print $$2}')
-PGVER_MAJOR = $(shell echo $(VERSION) | awk -F. '{ print ($$1 + 0) }')
-PGVER_MINOR = $(shell echo $(VERSION) | awk -F. '{ print ($$2 + 0) }')
-
-ifeq ($(PGVER_MAJOR), 9)
-ifneq ($(PGVER_MINOR), 0)
-all: sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql
+EXTENSION = pair
+EXTVERSION = $(shell grep default_version $(EXTENSION).control | \
+ sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
+
+DATA = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
+DOCS = $(wildcard doc/*.txt)
+TESTS = $(wildcard test/sql/*.sql)
+REGRESS = $(patsubst test/sql/%.sql,%,$(TESTS))
+REGRESS_OPTS = --inputdir=test --load-language=plpgsql
+MODULES = $(patsubst %.c,%,$(wildcard src/*.c))
+PG_CONFIG = pg_config
+PG91 = $(shell $(PG_CONFIG) --version | grep -qE " 8\.| 9\.0" && echo no || echo yes)
+
+ifeq ($(PG91),yes)
+all: sql/$(EXTENSION)--$(EXTVERSION).sql
sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql
cp $< $@
-sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: sql/$(EXTENSION)--unpackaged.sql
- cp $< $@
-
-DATA = $(filter-out sql/$(EXTENSION)--unpackaged.sql,$(wildcard sql/*--*.sql)) sql/$(EXTENSION)--$(EXTVERSION).sql
-EXTRA_CLEAN = sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql
-endif
+DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql
+EXTRA_CLEAN = sql/$(EXTENSION)--$(EXTVERSION).sql
endif
PGXS := $(shell $(PG_CONFIG) --pgxs)
View
@@ -1,4 +1,4 @@
-pair 0.1.2
+pair 0.1.3
==========
This library contains a single PostgreSQL extension, a key/value pair data
File renamed without changes.

0 comments on commit 2054894

Please sign in to comment.