Skip to content
Snippets Groups Projects
Commit 3b17f6b6 authored by Christoph Berg's avatar Christoph Berg 📡
Browse files

server/postgresql.mk: Allow setting MAJOR_PKG for custom server packages.

When building server packages that have a suffix on the package names, use this
debian/rules file:

MAJOR_VER := 14
override MAJOR_PKG := 14ee
include /usr/share/postgresql-common/server/postgresql.mk
parent 0dc1c741
Branches
Tags
No related merge requests found
postgresql-common (248) UNRELEASED; urgency=medium
* Update ro debconf translation, mulțumesc Remus-Gabriel Chelu!
* server/postgresql.mk: Allow setting MAJOR_PKG for custom server packages.
-- Christoph Berg <myon@debian.org> Sun, 12 Feb 2023 23:09:49 +0100
......
......@@ -2,9 +2,12 @@
# The PostgreSQL server packages include this in their debian/rules file.
# MAJOR_VER is used in path names (15 for /usr/lib/postgresql/15)
ifndef MAJOR_VER
$(error MAJOR_VER must be defined before including this file)
endif
# MAJOR_PKG is used in package names (15 for postgresql-15)
MAJOR_PKG = $(MAJOR_VER)
# path to auxiliary build files
AUX_MK_DIR = /usr/share/postgresql-common/server
......@@ -162,8 +165,8 @@ override_dh_auto_install-arch:
$(MAKE) -C build/config install DESTDIR=$(CURDIR)/debian/tmp
$(MAKE) -C build/contrib install DESTDIR=$(CURDIR)/debian/tmp
# move SPI examples into server package (they wouldn't be in the doc package in an -A build)
mkdir -p debian/postgresql-$(MAJOR_VER)/usr/share/doc/postgresql-$(MAJOR_VER)
mv debian/tmp/usr/share/doc/postgresql-doc-$(MAJOR_VER)/extension debian/postgresql-$(MAJOR_VER)/usr/share/doc/postgresql-$(MAJOR_VER)/examples
mkdir -p debian/postgresql-$(MAJOR_PKG)/usr/share/doc/postgresql-$(MAJOR_VER)
mv debian/tmp/usr/share/doc/postgresql-doc-$(MAJOR_VER)/extension debian/postgresql-$(MAJOR_PKG)/usr/share/doc/postgresql-$(MAJOR_VER)/examples
ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
override_dh_auto_install-indep:
......@@ -188,36 +191,36 @@ override_dh_install-arch:
dh_install -a
# link README.Debian.gz to postgresql-common
mkdir -p debian/postgresql-$(MAJOR_VER)/usr/share/doc/postgresql-$(MAJOR_VER)
ln -s ../postgresql-common/README.Debian.gz debian/postgresql-$(MAJOR_VER)/usr/share/doc/postgresql-$(MAJOR_VER)/README.Debian.gz
mkdir -p debian/postgresql-$(MAJOR_PKG)/usr/share/doc/postgresql-$(MAJOR_VER)
ln -s ../postgresql-common/README.Debian.gz debian/postgresql-$(MAJOR_PKG)/usr/share/doc/postgresql-$(MAJOR_VER)/README.Debian.gz
# assemble perl version of pg_config in libpq-dev
sed -ne '1,/__DATA__/p' $(AUX_MK_DIR)/pg_config.pl > debian/libpq-dev/usr/bin/pg_config
LC_ALL=C debian/postgresql-client-$(MAJOR_VER)/usr/lib/postgresql/$(MAJOR_VER)/bin/pg_config | sed -e 's![^ ]*/debian/postgresql-client-$(MAJOR_VER)!!' >> debian/libpq-dev/usr/bin/pg_config
LC_ALL=C debian/postgresql-client-$(MAJOR_VER)/usr/lib/postgresql/$(MAJOR_VER)/bin/pg_config --help >> debian/libpq-dev/usr/bin/pg_config
LC_ALL=C debian/postgresql-client-$(MAJOR_PKG)/usr/lib/postgresql/$(MAJOR_VER)/bin/pg_config | sed -e 's![^ ]*/debian/postgresql-client-$(MAJOR_PKG)!!' >> debian/libpq-dev/usr/bin/pg_config
LC_ALL=C debian/postgresql-client-$(MAJOR_PKG)/usr/lib/postgresql/$(MAJOR_VER)/bin/pg_config --help >> debian/libpq-dev/usr/bin/pg_config
chmod 755 debian/libpq-dev/usr/bin/pg_config
[ "$$(debian/libpq-dev/usr/bin/pg_config --bindir)" = "/usr/lib/postgresql/$(MAJOR_VER)/bin" ]
# remove actual build path from Makefile.global for reproducibility
sed -i -e "s!^abs_top_builddir.*!abs_top_builddir = /build/postgresql-$(MAJOR_VER)/build!" \
-e "s!^abs_top_srcdir.*!abs_top_srcdir = /build/postgresql-$(MAJOR_VER)/build/..!" \
sed -i -e "s!^abs_top_builddir.*!abs_top_builddir = /build/postgresql-$(MAJOR_PKG)/build!" \
-e "s!^abs_top_srcdir.*!abs_top_srcdir = /build/postgresql-$(MAJOR_PKG)/build/..!" \
-e 's!-f\(debug\|file\)-prefix-map=[^ ]* !!g' \
debian/postgresql-client-$(MAJOR_VER)/usr/lib/postgresql/$(MAJOR_VER)/lib/pgxs/src/Makefile.global
debian/postgresql-client-$(MAJOR_PKG)/usr/lib/postgresql/$(MAJOR_VER)/lib/pgxs/src/Makefile.global
# these are shipped in the pl packages
bash -c "rm -v debian/postgresql-$(MAJOR_VER)/usr/share/postgresql/$(MAJOR_VER)/extension/{plperl,plpython,pltcl,*_pl}*"
bash -c "rm -v debian/postgresql-$(MAJOR_VER)/usr/lib/postgresql/$(MAJOR_VER)/lib/{plperl,plpython,pltcl,*_pl}*"
bash -c "rm -rfv debian/postgresql-$(MAJOR_VER)/usr/lib/postgresql/$(MAJOR_VER)/lib/bitcode/*{plperl,plpython,pltcl}*"
bash -c "rm -v debian/postgresql-$(MAJOR_PKG)/usr/share/postgresql/$(MAJOR_VER)/extension/{plperl,plpython,pltcl,*_pl}*"
bash -c "rm -v debian/postgresql-$(MAJOR_PKG)/usr/lib/postgresql/$(MAJOR_VER)/lib/{plperl,plpython,pltcl,*_pl}*"
bash -c "rm -rfv debian/postgresql-$(MAJOR_PKG)/usr/lib/postgresql/$(MAJOR_VER)/lib/bitcode/*{plperl,plpython,pltcl}*"
# record catversion in a file
echo $(CATVERSION) > debian/postgresql-$(MAJOR_VER)/usr/share/postgresql/$(MAJOR_VER)/catalog_version
echo $(CATVERSION) > debian/postgresql-$(MAJOR_PKG)/usr/share/postgresql/$(MAJOR_VER)/catalog_version
override_dh_install-indep:
dh_install -i
if [ -d debian/postgresql-doc-$(MAJOR_VER) ]; then set -e; \
install -d debian/postgresql-doc-$(MAJOR_VER)/usr/share/doc/postgresql-doc-$(MAJOR_VER)/tutorial; \
install src/tutorial/*.c src/tutorial/*.source src/tutorial/Makefile src/tutorial/README debian/postgresql-doc-$(MAJOR_VER)/usr/share/doc/postgresql-doc-$(MAJOR_VER)/tutorial; \
if [ -d debian/postgresql-doc-$(MAJOR_PKG) ]; then set -e; \
install -d debian/postgresql-doc-$(MAJOR_PKG)/usr/share/doc/postgresql-doc-$(MAJOR_VER)/tutorial; \
install src/tutorial/*.c src/tutorial/*.source src/tutorial/Makefile src/tutorial/README debian/postgresql-doc-$(MAJOR_PKG)/usr/share/doc/postgresql-doc-$(MAJOR_VER)/tutorial; \
fi
override_dh_auto_test-indep:
......@@ -251,7 +254,7 @@ endif
override_dh_installdeb-arch:
dh_installdeb
# record catversion in preinst
sed -i -e 's/@CATVERSION@/$(CATVERSION)/' debian/postgresql-$(MAJOR_VER)/DEBIAN/preinst
sed -i -e 's/@CATVERSION@/$(CATVERSION)/' debian/postgresql-$(MAJOR_PKG)/DEBIAN/preinst
override_dh_gencontrol:
# record catversion in .deb control file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment