Source: postgresql-debversion
Version: 1.0.7-3
Severity: wishlist
Tags: patch

Hi,

the attached patch makes postgresql-debversion use pg_buildext to
dynamically build for the list of supported PostgreSQL versions.

I would like to properly have debversion on apt.postgresql supported
for all PostgreSQL versions (modulo 8.4 where it doesn't compile atm),
but this patch will also ease transitioning to new PostgreSQL versions
in unstable. (Moving to 9.3 is due as 9.1 will be removed shortly
there.)

Thanks for considering,
Christoph
-- 
c...@df7cb.de | http://www.df7cb.de/
diff --git a/debian/control b/debian/control
index 9873a85..2ac7e7e 100644
--- a/debian/control
+++ b/debian/control
@@ -3,14 +3,14 @@ Section: database
 Priority: extra
 Maintainer: Debian buildd-tools Developers <buildd-tools-de...@lists.alioth.debian.org>
 Uploaders: Michael Banck <mba...@debian.org>, Roger Leigh <rle...@debian.org>, Francesco Paolo Lovergine <fran...@debian.org>
-Build-Depends: debhelper (>= 9), autotools-dev, libapt-pkg-dev, postgresql-server-dev-9.1, postgresql-server-dev-9.2
+Build-Depends: debhelper (>= 9), autotools-dev, libapt-pkg-dev, postgresql-server-dev-all
 Standards-Version: 3.9.3
 Vcs-Browser: http://git.debian.org/?p=buildd-tools/postgresql-debversion.git
 Vcs-Git: git://git.debian.org/git/buildd-tools/postgresql-debversion
 
-Package: postgresql-9.2-debversion
+Package: postgresql-9.3-debversion
 Architecture: any
-Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-9.2
+Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-9.3
 Description: Debian version number type for PostgreSQL
  Debian version numbers, used to version Debian binary and source
  packages, have a defined format, including specifications for how
@@ -34,28 +34,3 @@ Description: Debian version number type for PostgreSQL
   * Operator classes for btree and hash indexes
   * The aggregate functions min() and max()
 
-Package: postgresql-9.1-debversion
-Architecture: any
-Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-9.1
-Description: Debian version number type for PostgreSQL
- Debian version numbers, used to version Debian binary and source
- packages, have a defined format, including specifications for how
- versions should be compared in order to sort them.  This package
- implements a "debversion" type to represent Debian version numbers
- within the PostgreSQL database.  This also includes operators for
- version comparison and index operator classes for creating indexes on
- the debversion type.
- .
- Version comparison uses the algorithm used by the Debian package
- manager, dpkg, using the implementation from libapt-pkg.  This means
- that columns in tables using the debversion type may be sorted and
- compared correctly using the same logic as "dpkg --compare-versions".
- It is also possible to create indexes on these columns.
- .
- postgresql-debversion implements the following features:
- .
-  * The "debversion" type (internally derived from the "text" type)
-  * A full set of operators for version comparison (< <= = <> >= >)
-    including commutator and negator optimisation hints
-  * Operator classes for btree and hash indexes
-  * The aggregate functions min() and max()
diff --git a/debian/control.in b/debian/control.in
new file mode 100644
index 0000000..61d3d41
--- /dev/null
+++ b/debian/control.in
@@ -0,0 +1,35 @@
+Source: postgresql-debversion
+Section: database
+Priority: extra
+Maintainer: Debian buildd-tools Developers <buildd-tools-de...@lists.alioth.debian.org>
+Uploaders: Michael Banck <mba...@debian.org>, Roger Leigh <rle...@debian.org>, Francesco Paolo Lovergine <fran...@debian.org>
+Build-Depends: debhelper (>= 9), autotools-dev, libapt-pkg-dev, postgresql-server-dev-all
+Standards-Version: 3.9.3
+Vcs-Browser: http://git.debian.org/?p=buildd-tools/postgresql-debversion.git
+Vcs-Git: git://git.debian.org/git/buildd-tools/postgresql-debversion
+
+Package: postgresql-PGVERSION-debversion
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-PGVERSION
+Description: Debian version number type for PostgreSQL
+ Debian version numbers, used to version Debian binary and source
+ packages, have a defined format, including specifications for how
+ versions should be compared in order to sort them.  This package
+ implements a "debversion" type to represent Debian version numbers
+ within the PostgreSQL database.  This also includes operators for
+ version comparison and index operator classes for creating indexes on
+ the debversion type.
+ .
+ Version comparison uses the algorithm used by the Debian package
+ manager, dpkg, using the implementation from libapt-pkg.  This means
+ that columns in tables using the debversion type may be sorted and
+ compared correctly using the same logic as "dpkg --compare-versions".
+ It is also possible to create indexes on these columns.
+ .
+ postgresql-debversion implements the following features:
+ .
+  * The "debversion" type (internally derived from the "text" type)
+  * A full set of operators for version comparison (< <= = <> >= >)
+    including commutator and negator optimisation hints
+  * Operator classes for btree and hash indexes
+  * The aggregate functions min() and max()
diff --git a/debian/pgversions b/debian/pgversions
new file mode 100644
index 0000000..69176fd
--- /dev/null
+++ b/debian/pgversions
@@ -0,0 +1,3 @@
+# 8.4 doesn't compile
+# we include 9.0 here even if it doesn't have extensions, the .sql file is still present in the packages
+9.0+
diff --git a/debian/postgresql-9.1-debversion.docs b/debian/postgresql-9.1-debversion.docs
deleted file mode 100644
index 8913f46..0000000
--- a/debian/postgresql-9.1-debversion.docs
+++ /dev/null
@@ -1,2 +0,0 @@
-NEWS
-README.md
diff --git a/debian/postgresql-9.1-debversion.install b/debian/postgresql-9.1-debversion.install
deleted file mode 100644
index e44b8f9..0000000
--- a/debian/postgresql-9.1-debversion.install
+++ /dev/null
@@ -1,2 +0,0 @@
-debian/install-9.1/usr/lib/postgresql/9.1/lib/debversion.so  usr/lib/postgresql/9.1/lib
-debian/install-9.1/usr/share/postgresql                      usr/share
diff --git a/debian/postgresql-9.2-debversion.docs b/debian/postgresql-9.2-debversion.docs
deleted file mode 100644
index 8913f46..0000000
--- a/debian/postgresql-9.2-debversion.docs
+++ /dev/null
@@ -1,2 +0,0 @@
-NEWS
-README.md
diff --git a/debian/postgresql-9.2-debversion.install b/debian/postgresql-9.2-debversion.install
deleted file mode 100644
index 4e2f545..0000000
--- a/debian/postgresql-9.2-debversion.install
+++ /dev/null
@@ -1,2 +0,0 @@
-debian/install-9.2/usr/lib/postgresql/9.2/lib/debversion.so  usr/lib/postgresql/9.2/lib
-debian/install-9.2/usr/share/postgresql                      usr/share
diff --git a/debian/rules b/debian/rules
index 9ad5cc7..c1409e8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,5 +1,13 @@
 #!/usr/bin/make -f
 
+# Rebuild debian/control from debian/control.in
+SRCDIR = $(CURDIR)
+include /usr/share/postgresql-common/pgxs_debian_control.mk
+clean: debian/control
+.PHONY: debian/control
+
+SUPPORTED_VERSIONS = $(shell pg_buildext supported-versions)
+
 DH_OPTIONS = --with autotools_dev
 
 DH_INSTALL_FILES = $(basename $(wildcard debian/*.install.in))
@@ -8,35 +16,34 @@ DH_INSTALL_FILES = $(basename $(wildcard debian/*.install.in))
 %:
 	dh $@ $(DH_OPTIONS)
 
-override_dh_auto_configure: debian/build-9.1/config.status debian/build-9.2/config.status
-
-debian/build-9.1/config.status: configure
-	dh_auto_configure --builddirectory=debian/build-9.1 -- \
-	  --enable-extension \
-	  PG_CONFIG=/usr/lib/postgresql/9.1/bin/pg_config
-	dh_testdir
-
-debian/build-9.2/config.status: configure
-	dh_auto_configure --builddirectory=debian/build-9.2 -- \
-	  --enable-extension \
-	  PG_CONFIG=/usr/lib/postgresql/9.2/bin/pg_config
-	dh_testdir
+override_dh_auto_configure: configure
+	set -e; for v in $(SUPPORTED_VERSIONS); do \
+	  dh_auto_configure --builddirectory=debian/build-$$v -- \
+	    --enable-extension \
+	    PG_CONFIG=/usr/lib/postgresql/$$v/bin/pg_config; \
+	done
 
 override_dh_auto_build:
-	$(MAKE) -C debian/build-9.1 all
-	$(MAKE) -C debian/build-9.2 all
+	set -e; for v in $(SUPPORTED_VERSIONS); do \
+	  $(MAKE) -C debian/build-$$v all; \
+	done
 
 override_dh_auto_clean:
-	dh_auto_clean --builddirectory=debian/build-9.1
-	dh_auto_clean --builddirectory=debian/build-9.2
-	rm -rf debian/install-9.1
-	rm -rf debian/install-9.2
+	set -e; for v in $(SUPPORTED_VERSIONS); do \
+	  dh_auto_clean --builddirectory=debian/build-$$v; \
+	  rm -rf debian/install-$$v; \
+	done
 
 override_dh_auto_install:
-	$(MAKE) -C debian/build-9.1 DESTDIR=$(CURDIR)/debian/install-9.1 install
-	$(MAKE) -C debian/build-9.2 DESTDIR=$(CURDIR)/debian/install-9.2 install
+	set -e; for v in $(SUPPORTED_VERSIONS); do \
+	  $(MAKE) -C debian/build-$$v DESTDIR=$(CURDIR)/debian/postgresql-$$v-debversion install; \
+	  find $(CURDIR)/debian/postgresql-$$v-debversion -name \*.la | xargs -r rm; \
+	done
 
 override_dh_installchangelogs:
 	dh_installchangelogs ChangeLog
 
-.PHONY: override_dh_auto_configure override_dh_auto_clean override_dh_auto_build override_dh_auto_install override_dh_installchangelogs
+override_dh_installdocs:
+	dh_installdocs --all NEWS README.md
+
+.PHONY: override_dh_auto_configure override_dh_auto_clean override_dh_auto_build override_dh_auto_install override_dh_installchangelogs override_dh_installdocs

Attachment: signature.asc
Description: Digital signature

Reply via email to