Skip to content
Browse files

Rework packaging with dh_helper 7, fixing it for 9.1 compat

  • Loading branch information...
1 parent 1af2d88 commit 21e2339e6766c46ebb967aecc95ff861da0f85b7 @dimitri committed
View
5 .gitignore
@@ -0,0 +1,5 @@
+.pc
+debian/control
+debian/files
+debian/pgfincore-*
+debian/postgresql-*
View
53 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
View
6 debian/changelog
@@ -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
View
2 debian/control.in
@@ -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
View
2 debian/postgresql-8.4-pgfincore.docs
@@ -1 +1 @@
-README.pgfincore
+doc/README.pgfincore.rst
View
4 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
View
2 debian/postgresql-9.0-pgfincore.docs
@@ -1 +1 @@
-README.pgfincore
+doc/README.pgfincore.rst
View
4 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
View
2 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
View
2 debian/postgresql-9.1-pgfincore.docs
@@ -1 +1 @@
-README.pgfincore
+doc/README.pgfincore.rst
View
5 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
+
View
62 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 $@
View
1 debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
View
0 debian/source/include-binaries
No changes.

0 comments on commit 21e2339

Please sign in to comment.
Something went wrong with that request. Please try again.