From 1009688d7d4b43c394722d2fd94a658c90772448 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Wed, 27 Jul 2011 17:21:48 +0200 Subject: [PATCH] Rework packaging with dh_helper 7, fixing it for 9.1 compat --- .gitignore | 5 ++ Makefile | 53 ++++++--------------- debian/changelog | 6 +++ debian/control.in | 2 +- debian/postgresql-8.4-pgfincore.docs | 2 +- debian/postgresql-8.4-pgfincore.install | 4 +- debian/postgresql-9.0-pgfincore.docs | 2 +- debian/postgresql-9.0-pgfincore.install | 4 +- debian/postgresql-9.1-pgfincore.dirs | 2 +- debian/postgresql-9.1-pgfincore.docs | 2 +- debian/postgresql-9.1-pgfincore.install | 5 +- debian/rules | 62 +++++++++++-------------- debian/source/format | 1 + debian/source/include-binaries | 0 14 files changed, 63 insertions(+), 87 deletions(-) create mode 100644 .gitignore create mode 100644 debian/source/format create mode 100644 debian/source/include-binaries diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dd17d6a --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.pc +debian/control +debian/files +debian/pgfincore-* +debian/postgresql-* diff --git a/Makefile b/Makefile index c4fcfb5..975acd7 100644 --- 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 diff --git a/debian/changelog b/debian/changelog index e1941e3..c22b69c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +pgfincore (1.0-1) unstable; urgency=low + + * New upstream release + + -- Dimitri Fontaine Wed, 27 Jul 2011 16:21:48 +0200 + pgfincore (0.4-1) unstable; urgency=low * Initial packaging diff --git a/debian/control.in b/debian/control.in index 5518fc8..3c97268 100644 --- a/debian/control.in +++ b/debian/control.in @@ -2,7 +2,7 @@ Source: pgfincore Section: database Priority: extra Maintainer: Dimitri Fontaine -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 diff --git a/debian/postgresql-8.4-pgfincore.docs b/debian/postgresql-8.4-pgfincore.docs index c6ec405..a4a525c 100644 --- a/debian/postgresql-8.4-pgfincore.docs +++ b/debian/postgresql-8.4-pgfincore.docs @@ -1 +1 @@ -README.pgfincore +doc/README.pgfincore.rst diff --git a/debian/postgresql-8.4-pgfincore.install b/debian/postgresql-8.4-pgfincore.install index 853ea04..de17558 100644 --- a/debian/postgresql-8.4-pgfincore.install +++ b/debian/postgresql-8.4-pgfincore.install @@ -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 diff --git a/debian/postgresql-9.0-pgfincore.docs b/debian/postgresql-9.0-pgfincore.docs index c6ec405..a4a525c 100644 --- a/debian/postgresql-9.0-pgfincore.docs +++ b/debian/postgresql-9.0-pgfincore.docs @@ -1 +1 @@ -README.pgfincore +doc/README.pgfincore.rst diff --git a/debian/postgresql-9.0-pgfincore.install b/debian/postgresql-9.0-pgfincore.install index 3086a75..15dc5c7 100644 --- a/debian/postgresql-9.0-pgfincore.install +++ b/debian/postgresql-9.0-pgfincore.install @@ -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 diff --git a/debian/postgresql-9.1-pgfincore.dirs b/debian/postgresql-9.1-pgfincore.dirs index 78504c8..e96fc14 100644 --- a/debian/postgresql-9.1-pgfincore.dirs +++ b/debian/postgresql-9.1-pgfincore.dirs @@ -1,2 +1,2 @@ usr/lib/postgresql/9.1/lib -usr/share/postgresql/9.1/contrib +usr/share/postgresql/9.1/extension diff --git a/debian/postgresql-9.1-pgfincore.docs b/debian/postgresql-9.1-pgfincore.docs index c6ec405..a4a525c 100644 --- a/debian/postgresql-9.1-pgfincore.docs +++ b/debian/postgresql-9.1-pgfincore.docs @@ -1 +1 @@ -README.pgfincore +doc/README.pgfincore.rst diff --git a/debian/postgresql-9.1-pgfincore.install b/debian/postgresql-9.1-pgfincore.install index e375918..19bdbee 100644 --- a/debian/postgresql-9.1-pgfincore.install +++ b/debian/postgresql-9.1-pgfincore.install @@ -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 + diff --git a/debian/rules b/debian/rules index 81df2f1..d460495 100755 --- a/debian/rules +++ b/debian/rules @@ -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 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/include-binaries b/debian/source/include-binaries new file mode 100644 index 0000000..e69de29 -- 2.39.5