summaryrefslogtreecommitdiffstats
path: root/debian/patches/50-per-version-dirs.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:15:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:15:08 +0000
commitc8f4a18517306b8e4f0c467df5c021593c47e550 (patch)
treea485b32d21dc418a66ef7fc9ef93ca29fed61573 /debian/patches/50-per-version-dirs.patch
parentAdding upstream version 14.5. (diff)
downloadpostgresql-14-c8f4a18517306b8e4f0c467df5c021593c47e550.tar.xz
postgresql-14-c8f4a18517306b8e4f0c467df5c021593c47e550.zip
Adding debian version 14.5-3.debian/14.5-3debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/50-per-version-dirs.patch')
-rw-r--r--debian/patches/50-per-version-dirs.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/debian/patches/50-per-version-dirs.patch b/debian/patches/50-per-version-dirs.patch
new file mode 100644
index 0000000..7819df3
--- /dev/null
+++ b/debian/patches/50-per-version-dirs.patch
@@ -0,0 +1,69 @@
+Author: Martin Pitt <mpitt@debian.org>
+Description: Use version specific installation directories so that several major versions can be installed in parallel.
+Forwarded: No, Debian specific packaging with postgresql-common
+
+ * Install lib files into /usr/lib/postgresql/<version>/lib/
+ * Install server related header files into /usr/include/postgresql/<version>/server/
+ * Disable PostgreSQL's automagic path mangling and fix libdir for pg_config,
+ so that pg_config in /usr/bin and /usr/lib/postgresql/<version>/bin behave
+ identically.
+
+Bug-Debian: http://bugs.debian.org/462037
+
+--- a/src/Makefile.global.in
++++ b/src/Makefile.global.in
+@@ -119,7 +119,7 @@ libdir := @libdir@
+ pkglibdir = $(libdir)
+ ifeq "$(findstring pgsql, $(pkglibdir))" ""
+ ifeq "$(findstring postgres, $(pkglibdir))" ""
+-override pkglibdir := $(pkglibdir)/postgresql
++override pkglibdir := /usr/lib/postgresql/@PG_MAJORVERSION@/lib
+ endif
+ endif
+
+@@ -167,7 +167,7 @@ endif # PGXS
+
+ # These derived path variables aren't separately configurable.
+
+-includedir_server = $(pkgincludedir)/server
++includedir_server = $(pkgincludedir)/@PG_MAJORVERSION@/server
+ includedir_internal = $(pkgincludedir)/internal
+ pgxsdir = $(pkglibdir)/pgxs
+ bitcodedir = $(pkglibdir)/bitcode
+--- a/src/bin/pg_config/pg_config.c
++++ b/src/bin/pg_config/pg_config.c
+@@ -27,6 +27,8 @@
+ #include "common/config_info.h"
+ #include "port.h"
+
++#include "../port/pg_config_paths.h"
++
+ static const char *progname;
+
+ /*
+@@ -149,11 +151,7 @@ main(int argc, char **argv)
+ }
+ }
+
+- if (find_my_exec(argv[0], my_exec_path) < 0)
+- {
+- fprintf(stderr, _("%s: could not find own program executable\n"), progname);
+- exit(1);
+- }
++ snprintf(my_exec_path, sizeof(my_exec_path), "%s/%s", PGBINDIR, progname);
+
+ configdata = get_configdata(my_exec_path, &configdata_len);
+ /* no arguments -> print everything */
+--- a/src/test/perl/TestLib.pm
++++ b/src/test/perl/TestLib.pm
+@@ -591,6 +591,10 @@ sub check_pg_config
+ or die "could not execute pg_config";
+ chomp($stdout);
+ $stdout =~ s/\r$//;
++ # Debian's pg_config is not relocatable, manually check for correct location
++ if (-d "../../../build/tmp_install/usr/include/postgresql") {
++ $stdout = "../../../build/tmp_install/usr/include/postgresql";
++ }
+
+ open my $pg_config_h, '<', "$stdout/pg_config.h" or die "$!";
+ my $match = (grep { /^$regexp/ } <$pg_config_h>);