[Pkg-postgresql-public] Bug#706849: libpq5: enable multi-arch

Helmut Grohne helmut at subdivi.de
Sun May 5 13:17:23 UTC 2013


Package: libpq5
Version: 9.1.9-1
Severity: wishlist

The libpq5 package has a fairly large number of reverse dependencies
(around 200). Some of them are already multi-arch capable, but cannot
exercise this due to the lack of support from libpq5. So libpq5
currently locks a fairly large number of otherwise unrelated packages to
the same architecture.

I tried to come up with a patch for this, but apparently this is not
totally trivial. One step required for gaining multi-arch is to change
--libdir to /usr/lib/<triplet>. This also changes
/usr/lib/postgresl/$(MAJORVER)/lib to
/usr/lib/<triplet>/postgresl/$(MAJORVER)/lib, but leaves
/usr/lib/postgresql/$(MAJORVER)/bin unchanged. I cannot tell whether
such a setup continues to work, but it is ugly to say the least. Also
moving anything from /usr/lib/postgresql/$(MAJORVER) to a multi-arch
path would cause breakage in postgresql-common, because it expects
non-multiarch paths in certain scripts. As it stands I am not convinced,
that changing --libdir is the route to success here and the only package
that really benefits from multi-arch is libpq5.

You can find a broken patch attached, that changes --libdir and adapts a
few other things, but ultimately ftbfs, because of the changed paths.

For general information on how to convert a package to multi-arch, see
http://wiki.debian.org/Multiarch/Implementation. If you have further
questions on multi-arch, feel free to ask me.

Helmut
-------------- next part --------------
diff -Nru postgresql-9.1-9.1.9/debian/changelog postgresql-9.1-9.1.9/debian/changelog
--- postgresql-9.1-9.1.9/debian/changelog	2013-04-02 10:27:35.000000000 +0200
+++ postgresql-9.1-9.1.9/debian/changelog	2013-05-05 14:23:47.000000000 +0200
@@ -1,3 +1,14 @@
+postgresql-9.1 (9.1.9-1.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Connvert to Multi-Arch.
+    + Build-Depend on debhelper (>= 8.1.3~).
+    + Change libdir to /usr/lib/<triplet>/ and adapt .install files.
+    + Add ${misc:Pre-Depends}.
+    + Mark libpq5, libecpg6, libecpg-compat3 and libpgtypes3 as M-A:same.
+
+ -- Helmut Grohne <helmut at subdivi.de>  Sun, 05 May 2013 12:56:34 +0200
+
 postgresql-9.1 (9.1.9-1) unstable; urgency=high
 
   * Urgency high because of critical remote data destruction vulnerability.
diff -Nru postgresql-9.1-9.1.9/debian/control postgresql-9.1-9.1.9/debian/control
--- postgresql-9.1-9.1.9/debian/control	2013-04-02 10:27:35.000000000 +0200
+++ postgresql-9.1-9.1.9/debian/control	2013-05-05 14:23:26.000000000 +0200
@@ -4,7 +4,7 @@
 Maintainer: Debian PostgreSQL Maintainers <pkg-postgresql-public at lists.alioth.debian.org>
 Uploaders: Martin Pitt <mpitt at debian.org>, Peter Eisentraut <petere at debian.org>, Christoph Berg <myon at debian.org>
 Standards-Version: 3.9.4
-Build-Depends: debhelper (>= 8~),
+Build-Depends: debhelper (>= 8.1.3~),
  dpkg-dev (>= 1.16.1~) | hardening-wrapper,
  perl (>= 5.8),
  libperl-dev,
@@ -57,6 +57,8 @@
 Architecture: any
 Section: libs
 Depends: ${misc:Depends}, ${shlibs:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
 Description: PostgreSQL C client library
  libpq is a C library that enables user programs to communicate with
  the PostgreSQL database server.  The server can be on another machine
@@ -72,6 +74,8 @@
 Architecture: any
 Section: libs
 Depends: ${misc:Depends}, ${shlibs:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
 Description: run-time library for ECPG programs
  The libecpg shared library is used by programs built with ECPG
  (Embedded PostgreSQL for C).
@@ -102,6 +106,8 @@
 Architecture: any
 Section: libs
 Depends: ${misc:Depends}, ${shlibs:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
 Description: older version of run-time library for ECPG programs
  The libecpg_compat shared library is used by programs built with ecpg.
  (Embedded PostgreSQL for C).
@@ -112,6 +118,8 @@
 Architecture: any
 Section: libs
 Depends: ${misc:Depends}, ${shlibs:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
 Description: shared library libpgtypes for PostgreSQL 9.1
  The libpgtypes shared library is used by programs built with ecpg.
  (Embedded PostgreSQL for C).
diff -Nru postgresql-9.1-9.1.9/debian/libecpg-compat3.install postgresql-9.1-9.1.9/debian/libecpg-compat3.install
--- postgresql-9.1-9.1.9/debian/libecpg-compat3.install	2013-04-02 10:27:35.000000000 +0200
+++ postgresql-9.1-9.1.9/debian/libecpg-compat3.install	2013-05-05 13:51:44.000000000 +0200
@@ -1 +1 @@
-usr/lib/libecpg_compat.so.3*
+usr/lib/*/libecpg_compat.so.3*
diff -Nru postgresql-9.1-9.1.9/debian/libecpg-dev.install postgresql-9.1-9.1.9/debian/libecpg-dev.install
--- postgresql-9.1-9.1.9/debian/libecpg-dev.install	2013-04-02 10:27:35.000000000 +0200
+++ postgresql-9.1-9.1.9/debian/libecpg-dev.install	2013-05-05 12:59:59.000000000 +0200
@@ -5,10 +5,10 @@
 usr/include/postgresql/sqlca.h
 usr/include/postgresql/sqlda*.h
 usr/lib/postgresql/9.1/bin/ecpg usr/bin
-usr/lib/libecpg.so
-usr/lib/libecpg_compat.so
-usr/lib/libpgtypes.so
-usr/lib/libecpg.a
-usr/lib/libecpg_compat.a
-usr/lib/libpgtypes.a
+usr/lib/*/libecpg.so
+usr/lib/*/libecpg_compat.so
+usr/lib/*/libpgtypes.so
+usr/lib/*/libecpg.a
+usr/lib/*/libecpg_compat.a
+usr/lib/*/libpgtypes.a
 usr/share/postgresql/9.1/man/man1/ecpg.1.gz /usr/share/man/man1
diff -Nru postgresql-9.1-9.1.9/debian/libecpg6.install postgresql-9.1-9.1.9/debian/libecpg6.install
--- postgresql-9.1-9.1.9/debian/libecpg6.install	2013-04-02 10:27:35.000000000 +0200
+++ postgresql-9.1-9.1.9/debian/libecpg6.install	2013-05-05 13:00:11.000000000 +0200
@@ -1,2 +1,2 @@
-usr/lib/libecpg.so.6*
+usr/lib/*/libecpg.so.6*
 /usr/share/locale/*/*/ecpg*.mo
diff -Nru postgresql-9.1-9.1.9/debian/libpgtypes3.install postgresql-9.1-9.1.9/debian/libpgtypes3.install
--- postgresql-9.1-9.1.9/debian/libpgtypes3.install	2013-04-02 10:27:35.000000000 +0200
+++ postgresql-9.1-9.1.9/debian/libpgtypes3.install	2013-05-05 14:22:39.000000000 +0200
@@ -1 +1 @@
-usr/lib/libpgtypes.so.3*
+usr/lib/*/libpgtypes.so.3*
diff -Nru postgresql-9.1-9.1.9/debian/libpq-dev.install postgresql-9.1-9.1.9/debian/libpq-dev.install
--- postgresql-9.1-9.1.9/debian/libpq-dev.install	2013-04-02 10:27:35.000000000 +0200
+++ postgresql-9.1-9.1.9/debian/libpq-dev.install	2013-05-05 12:59:31.000000000 +0200
@@ -20,9 +20,9 @@
 usr/include/postgresql/9.1/server/postgres_fe.h /usr/include/postgresql/
 usr/include/postgresql/9.1/server/postgres_ext.h /usr/include/postgresql/
 usr/include/postgresql/9.1/server/mb/pg_wchar.h /usr/include/postgresql/mb
-usr/lib/libpgport.a
-usr/lib/libpq.a
-usr/lib/libpq.so
+usr/lib/*/libpgport.a
+usr/lib/*/libpq.a
+usr/lib/*/libpq.so
 usr/lib/postgresql/9.1/bin/pg_config usr/bin
 usr/share/locale/*/LC_MESSAGES/pg_config-9.1.mo
 usr/share/postgresql/9.1/man/man1/pg_config.1.gz /usr/share/man/man1
diff -Nru postgresql-9.1-9.1.9/debian/libpq5.install postgresql-9.1-9.1.9/debian/libpq5.install
--- postgresql-9.1-9.1.9/debian/libpq5.install	2013-04-02 10:27:35.000000000 +0200
+++ postgresql-9.1-9.1.9/debian/libpq5.install	2013-05-05 13:00:27.000000000 +0200
@@ -1,2 +1,2 @@
-usr/lib/libpq.so.5*
+usr/lib/*/libpq.so.5*
 usr/share/locale/*/LC_MESSAGES/libpq*.mo
diff -Nru postgresql-9.1-9.1.9/debian/rules postgresql-9.1-9.1.9/debian/rules
--- postgresql-9.1-9.1.9/debian/rules	2013-04-02 10:27:35.000000000 +0200
+++ postgresql-9.1-9.1.9/debian/rules	2013-05-05 12:55:21.000000000 +0200
@@ -2,6 +2,8 @@
 TCL_VER := 8.5
 MAJOR_VER := 9.1
 
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) 
+
 # support both hardening-wrapper (for backports) and dpkg-buildflags
 export DEB_BUILD_HARDENING = 1
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie
@@ -31,7 +33,7 @@
   --datarootdir=/usr/share/ \
   --datadir=/usr/share/postgresql/$(MAJOR_VER) \
   --bindir=/usr/lib/postgresql/$(MAJOR_VER)/bin \
-  --libdir=/usr/lib/ \
+  --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/ \
   --libexecdir=/usr/lib/postgresql/ \
   --includedir=/usr/include/postgresql/ \
   --enable-nls \


More information about the Pkg-postgresql-public mailing list