Rework packaging with dh_helper 7, fixing it for 9.1 compat
authorDimitri Fontaine <dim@tapoueh.org>
Wed, 27 Jul 2011 15:21:48 +0000 (17:21 +0200)
committerDimitri Fontaine <dim@tapoueh.org>
Wed, 27 Jul 2011 15:21:48 +0000 (17:21 +0200)
14 files changed:
.gitignore [new file with mode: 0644]
Makefile
debian/changelog
debian/control.in
debian/postgresql-8.4-pgfincore.docs
debian/postgresql-8.4-pgfincore.install
debian/postgresql-9.0-pgfincore.docs
debian/postgresql-9.0-pgfincore.install
debian/postgresql-9.1-pgfincore.dirs
debian/postgresql-9.1-pgfincore.docs
debian/postgresql-9.1-pgfincore.install
debian/rules
debian/source/format [new file with mode: 0644]
debian/source/include-binaries [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..dd17d6a
--- /dev/null
@@ -0,0 +1,5 @@
+.pc
+debian/control
+debian/files
+debian/pgfincore-*
+debian/postgresql-*
index c4fcfb5e00ab2a47feb6241928079f537f707f22..975acd78bfbb43947da70132bbe1634422d69e7b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,25 +1,25 @@
-EXTENSION    = pgfincore
+ifndef VPATH
+SRCDIR = .
+else
+SRCDIR = $(VPATH)
+endif
 
-EXTVERSION   = $(shell grep default_version $(EXTENSION).control | \
+EXTENSION    = pgfincore
+EXTVERSION   = $(shell grep default_version $(SRCDIR)/$(EXTENSION).control | \
                sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
 
 MODULES      = $(EXTENSION)
 DATA         = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
 DOCS         = doc/README.$(EXTENSION).rst
-# TESTS        = $(wildcard test/sql/*.sql)
-# REGRESS      = $(patsubst test/sql/%.sql,%,$(TESTS))
-# REGRESS_OPTS = --inputdir=test --load-language=plpgsql
 
-ifndef PG_CONFIG
 PG_CONFIG    = pg_config
-endif
 
 PG91         = $(shell $(PG_CONFIG) --version | grep -qE "8\.|9\.0" && echo no || echo yes)
 
 ifeq ($(PG91),yes)
-all: sql/$(EXTENSION)--$(EXTVERSION).sql
+all: $(EXTENSION)--$(EXTVERSION).sql
 
-sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql
+$(EXTENSION)--$(EXTVERSION).sql: $(SRCDIR)/sql/$(EXTENSION).sql
        cp $< $@
 
 DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql
@@ -32,34 +32,7 @@ include $(PGXS)
 PKGNAME = $(EXTENSION)
 PKGVERS = $(shell dpkg-parsechangelog | awk -F '[:-]' '/^Version:/ { print substr($$2, 2) }')
 
-DEBDIR = /tmp/$(PKGNAME)
-EXPORT = $(DEBDIR)/export/$(PKGNAME)-$(PKGVERS)
-ORIG   = $(DEBDIR)/export/$(PKGNAME)_$(PKGVERS).orig.tar.gz
-ARCHIVE= $(DEBDIR)/export/$(PKGNAME)-$(PKGVERS).tar.gz
-DEBEXTS= {gz,changes,build,dsc}
-
-deb:   # working copy from where to make the .orig archive
-       rm -rf $(DEBDIR)
-       mkdir -p $(DEBDIR)/$(PKGNAME)-$(PKGVERS)
-       mkdir -p $(EXPORT)/sql $(EXPORT)/doc
-       cp Makefile  $(EXPORT)/
-       cp sql/*  $(EXPORT)/sql
-       cp $(DOCS)  $(EXPORT)/doc
-       cp $(MODULES).c  $(EXPORT)/
-       rsync -Ca debian $(EXPORT)/
-
-       # prepare the .orig without the debian/ packaging stuff
-       rsync -Ca $(EXPORT) $(DEBDIR)
-       rm -rf $(DEBDIR)/$(PKGNAME)-$(PKGVERS)/debian
-       (cd $(DEBDIR) && tar czf $(ORIG) $(PKGNAME)-$(PKGVERS))
-
-       # have a copy of the $$ORIG file named $$ARCHIVE for non-debian packagers
-       cp $(ORIG) $(ARCHIVE)
-
-       # build the debian package and copy them to ..
-       (cd $(EXPORT) && make -f debian/rules debian/control && debuild -us -uc)
-
-       cp $(EXPORT)/debian/control debian
-       find $(DEBDIR)/export -maxdepth 1 -type f -name "*$(PGGVERS)*" -exec cp {} .. \;
-
-.PHONY: deb
+deb:
+       dh clean
+       PKGVERS=$(PKGVERS) make -f debian/rules orig
+       debuild -us -uc -sa
index e1941e3e2edf4709ceb326cad39e522d0761aa2a..c22b69cc638b4890b92cbd6d4c8e29bef4b2dd03 100644 (file)
@@ -1,3 +1,9 @@
+pgfincore (1.0-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Dimitri Fontaine <dim@tapoueh.org>  Wed, 27 Jul 2011 16:21:48 +0200
+
 pgfincore (0.4-1) unstable; urgency=low
 
   * Initial packaging
index 5518fc85d9aa730a0739fc0665ec5cdcf2309adf..3c97268002aef109713915f1c3e556b878fd3610 100644 (file)
@@ -2,7 +2,7 @@ Source: pgfincore
 Section: database
 Priority: extra
 Maintainer: Dimitri Fontaine <dim@tapoueh.org>
-Build-Depends: debhelper (>= 7), postgresql-server-dev-all, postgresql-server-dev-8.4|postgresql-server-dev-9.0|postgresql-server-dev-9.1
+Build-Depends: debhelper (>= 7.0.50), postgresql-server-dev-all, postgresql-server-dev-8.4|postgresql-server-dev-9.0|postgresql-server-dev-9.1
 Standards-Version: 3.9.1
 Homepage: http://villemain.org/projects/pgfincore
 
index c6ec405f773097e852b9c5e7efc9ebb291e0faaa..a4a525c7b08a6353411893792f45e1638e6aaea1 100644 (file)
@@ -1 +1 @@
-README.pgfincore
+doc/README.pgfincore.rst
index 853ea04701892a6d7378c1a7b05301bde979a076..de17558bec5c5a24f17bf36ed2d7e57546a8815c 100644 (file)
@@ -1,3 +1,3 @@
 debian/pgfincore-8.4/pgfincore.so usr/lib/postgresql/8.4/lib
-debian/pgfincore-8.4/pgfincore.sql usr/share/postgresql/8.4/contrib
-debian/pgfincore-8.4/uninstall_pgfincore.sql usr/share/postgresql/8.4/contrib
+sql/pgfincore.sql usr/share/postgresql/8.4/contrib
+sql/uninstall_pgfincore.sql usr/share/postgresql/8.4/contrib
index c6ec405f773097e852b9c5e7efc9ebb291e0faaa..a4a525c7b08a6353411893792f45e1638e6aaea1 100644 (file)
@@ -1 +1 @@
-README.pgfincore
+doc/README.pgfincore.rst
index 3086a75c96d3efbd5774277cd157ae4bba3a62f0..15dc5c7aa2bba51b1118c1c7caf811593e91d3af 100644 (file)
@@ -1,3 +1,3 @@
 debian/pgfincore-9.0/pgfincore.so usr/lib/postgresql/9.0/lib
-debian/pgfincore-9.0/pgfincore.sql usr/share/postgresql/9.0/contrib
-debian/pgfincore-9.0/uninstall_pgfincore.sql usr/share/postgresql/9.0/contrib
+sql/pgfincore.sql usr/share/postgresql/9.0/contrib
+sql/uninstall_pgfincore.sql usr/share/postgresql/9.0/contrib
index 78504c87c49a2dabb6cbad0369b4cbcb0dcf6e69..e96fc1419c7738c8b0c99962154accf5fd812330 100644 (file)
@@ -1,2 +1,2 @@
 usr/lib/postgresql/9.1/lib
-usr/share/postgresql/9.1/contrib
+usr/share/postgresql/9.1/extension
index c6ec405f773097e852b9c5e7efc9ebb291e0faaa..a4a525c7b08a6353411893792f45e1638e6aaea1 100644 (file)
@@ -1 +1 @@
-README.pgfincore
+doc/README.pgfincore.rst
index e375918cfcc0bfd81ae9dd7143d328c568ae2125..19bdbeeb833f3fc8a1d64f1ee8a670ac6c4439a5 100644 (file)
@@ -1,3 +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/contrib
-debian/pgfincore-9.1/uninstall_pgfincore.sql usr/share/postgresql/9.1/contrib
+debian/pgfincore-9.1/pgfincore*.sql usr/share/postgresql/9.1/extension
+sql/pgfincore--unpackaged--1.0.sql usr/share/postgresql/9.1/extension
+
index 81df2f18d1b45192e13cb4f04b736ecb31e26d84..d460495df345d98f45164bbe7ba0059b1bc5561d 100755 (executable)
@@ -1,53 +1,43 @@
 #!/usr/bin/make -f
-
-include /usr/share/postgresql-common/pgxs_debian_control.mk
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0
-else
-       CFLAGS += -O2
-endif
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+#
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+#
+# Modified to make a template file for a multi-binary package with separated
+# build-arch and build-indep targets  by Bill Allombert 2001
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
 
 SRCDIR = $(CURDIR)
 TARGET = $(CURDIR)/debian/pgfincore-%v
+EXCLUDE = --exclude-vcs --exclude=debian
 
-build: debian/control
+include /usr/share/postgresql-common/pgxs_debian_control.mk
 
-clean:
-       dh_testdir
-       dh_testroot
+override_dh_auto_clean: debian/control
        pg_buildext clean $(SRCDIR) $(TARGET) "$(CFLAGS)"
        dh_clean 
 
-install: build
-       dh_testdir
-       dh_testroot
-       dh_prep 
-       dh_installdirs
-
+override_dh_auto_build:
        # build all supported version
        pg_buildext build $(SRCDIR) $(TARGET) "$(CFLAGS)"
 
+override_dh_auto_install: 
        # then install each of them
        for v in `pg_buildext supported-versions $(SRCDIR)`; do \
                dh_install -ppostgresql-$$v-pgfincore ;\
        done
 
-binary-indep: build install
-binary-arch: build install
-       dh_testdir
-       dh_testroot
-       dh_installchangelogs
-       dh_installdocs
-       dh_link
-       dh_strip
-       dh_compress
-       dh_fixperms
-       dh_installdeb
-       dh_shlibdeps
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install debian/control
+orig: clean
+       cd .. && tar czf pgfincore_$(PKGVERS).orig.tar.gz $(EXCLUDE) pgfincore
+
+%:
+       dh $@
diff --git a/debian/source/format b/debian/source/format
new file mode 100644 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/source/include-binaries b/debian/source/include-binaries
new file mode 100644 (file)
index 0000000..e69de29