Improve Makefile and debian/
authorCΓ©dric Villemain <cedric@2ndquadrant.fr>
Thu, 1 Dec 2011 13:41:50 +0000 (14:41 +0100)
committerCΓ©dric Villemain <cedric@2ndquadrant.fr>
Thu, 1 Dec 2011 13:41:50 +0000 (14:41 +0100)
Makefile and debian/rules are more standard and can be used for other
extensions.
Also add 9.2 to the postgresql possible build.

Makefile
debian/pgversions
debian/postgresql-9.1-pgfincore.install
debian/rules
debian/watch

index 16c8903b55a25805c46451a8dadb9f73a4c39f51..bc75ed88980223ffc3f2a6616de13ac311df36a5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,20 +2,20 @@ EXTENSION    = pgfincore
 EXTVERSION   = 1.1
 
 MODULES      = $(EXTENSION)
-DATA         = pgfincore.sql uninstall_pgfincore.sql
+DATA         = $(EXTENSION).sql uninstall_$(EXTENSION).sql
 DOCS         = README.rst
 REGRESS      = $(EXTENSION)
 
 PG_CONFIG    = pg_config
-PG91         = $(shell $(PG_CONFIG) --version | grep -qE "8\.|9\.0" && echo no || echo yes)
+BUILD_EXTENSION = $(shell $(PG_CONFIG) --version | grep -qE "8\.|9\.0" && echo no || echo yes)
 
-ifeq ($(PG91),yes)
-all: pgfincore--$(EXTVERSION).sql
+ifeq ($(BUILD_EXTENSION),yes)
+all: $(EXTENSION)--$(EXTVERSION).sql
 
-pgfincore--$(EXTVERSION).sql: pgfincore.sql
+$(EXTENSION)--$(EXTVERSION).sql: $(EXTENSION).sql
        cp $< $@
 
-DATA        = pgfincore--unpackaged--$(EXTVERSION).sql pgfincore--$(EXTVERSION).sql
+DATA        = $(EXTENSION)--unpackaged--$(EXTVERSION).sql $(EXTENSION)--$(EXTVERSION).sql
 REGRESS     = $(EXTENSION).ext
 EXTRA_CLEAN = $(EXTENSION)--$(EXTVERSION).sql
 endif
@@ -24,6 +24,7 @@ PGXS := $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
 
 deb:
+       make clean
        make -f debian/rules debian/control
        dh clean
        make -f debian/rules orig
index 80086582d4278684dabbba9f2dbd978434eb6b2e..bfd30e3b8ff9ddc77e12f49e3e0a581bb8fb6876 100644 (file)
@@ -1,3 +1,5 @@
+8.3
 8.4
 9.0
 9.1
+9.2
index 6d05787913aecdea481cf20cf5d69e042234c5aa..3e2e7c2cf6a8a9d3f5f925913c65a4226243e34b 100644 (file)
@@ -1,4 +1,4 @@
 debian/pgfincore-9.1/pgfincore.so usr/lib/postgresql/9.1/lib
 debian/pgfincore-9.1/pgfincore*.sql usr/share/postgresql/9.1/extension
 pgfincore--unpackaged--1.1.sql usr/share/postgresql/9.1/extension
-pgfincore.control /usr/share/postgresql/9.1/extension
+pgfincore.control usr/share/postgresql/9.1/extension
index 6453e3b5e70965932ef4a4e9e3af0cea1b5f221b..1bfea2f70ef0d7a6b050513ae854db4201429870 100755 (executable)
 # build-arch and build-indep targets  by Bill Allombert 2001
 
 # Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+# export DH_VERBOSE=1
 
 # This has to be exported to make some magic below work.
 export DH_OPTIONS
 
-export SRCDIR = $(CURDIR)
-TARGET = $(CURDIR)/debian/pgfincore-%v
+EXTNAME = pgfincore
 PKGVERS = $(shell dpkg-parsechangelog | awk -F '[:-]' '/^Version:/ { print substr($$2, 2) }')
 EXCLUDE = --exclude-vcs --exclude=debian
 
+export SRCDIR = $(CURDIR)
+TARGET = $(CURDIR)/debian/$(EXTNAME)-%v
+
 include /usr/share/postgresql-common/pgxs_debian_control.mk
-.PHONY: debian/control
 
 override_dh_auto_clean: debian/control
-       pg_buildext clean $(SRCDIR) $(TARGET) "$(CFLAGS)"
+       +pg_buildext clean $(SRCDIR) $(TARGET)
        dh_clean 
 
 override_dh_auto_build:
@@ -35,11 +36,14 @@ override_dh_auto_build:
 override_dh_auto_install: 
        # then install each of them
        for v in `pg_buildext supported-versions $(SRCDIR)`; do \
-               dh_install -ppostgresql-$$v-pgfincore ;\
+               ls;\
+               dh_install -ppostgresql-$$v-$(EXTNAME) ;\
        done
 
 orig: clean
-       cd .. && tar czf pgfincore_$(PKGVERS).orig.tar.gz $(EXCLUDE) pgfincore
+       cd .. && tar czf $(EXTNAME)_$(PKGVERS).orig.tar.gz $(EXCLUDE) $(EXTNAME)
 
 %:
        dh $@
+
+.PHONY: debian/control
index b16e7811bdb71b02f8ed186a41a8c2e29aba1ac2..f88771e77e1e10314fbe0f344878ed0617720501 100644 (file)
@@ -1,4 +1,2 @@
 version=3
-
 http://pgfoundry.org/frs/?group_id=1000444 /frs/download.php/[0-9]+/pgfincore-v([0-9.]+).tar.gz  debian  uupdate
-