Build with a private libpq

Related: #1905584
This commit is contained in:
Honza Horak 2021-02-03 23:01:46 +01:00
parent 3ccb5d848e
commit 0eaa9ce333
2 changed files with 49 additions and 3 deletions

View File

@ -0,0 +1,12 @@
diff -up postgresql-13.1/src/interfaces/Makefile.patch10 postgresql-13.1/src/interfaces/Makefile
--- postgresql-13.1/src/interfaces/Makefile.patch10 2021-02-02 21:33:23.235292305 +0100
+++ postgresql-13.1/src/interfaces/Makefile 2021-02-02 21:33:30.281365440 +0100
@@ -12,7 +12,7 @@ subdir = src/interfaces
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
-SUBDIRS = libpq ecpg
+SUBDIRS = libpq
$(recurse)

View File

@ -33,6 +33,7 @@
%{!?test:%global test 1}
%{!?llvmjit:%global llvmjit 1}
%{!?external_libpq:%global external_libpq 0}
%{!?upgrade:%global upgrade 1}
%{!?plpython3:%global plpython3 1}
%{!?pltcl:%global pltcl 1}
@ -60,7 +61,7 @@ Summary: PostgreSQL client programs
Name: postgresql
%global majorversion 13
Version: %{majorversion}.3
Release: 2%{?dist}
Release: 3%{?dist}
# The PostgreSQL license is very similar to other MIT licenses, but the OSI
# recognizes it as an independent license, so we do as well.
@ -111,6 +112,7 @@ Patch9: postgresql-server-pg_config.patch
# rhbz#1940964
Patch10: postgresql-datalayout-mismatch-on-s390.patch
Patch11: postgresql-subtransaction-test.patch
Patch12: postgresql-no-libecpg.patch
BuildRequires: make
BuildRequires: gcc
@ -123,7 +125,9 @@ BuildRequires: perl-generators
BuildRequires: readline-devel zlib-devel
BuildRequires: systemd systemd-devel util-linux
BuildRequires: multilib-rpm-config
%if %external_libpq
BuildRequires: libpq-devel >= %version
%endif
BuildRequires: docbook-style-xsl
# postgresql-setup build requires
@ -377,7 +381,11 @@ goal of accelerating analytics queries.
%patch1 -p1
%patch2 -p1
%patch5 -p1
%if %external_libpq
%patch8 -p1
%else
%patch12 -p1
%endif
%patch9 -p1
%patch10 -p1
%patch11 -p1
@ -387,9 +395,20 @@ goal of accelerating analytics queries.
cp -p %{SOURCE1} .
%if ! %external_libpq
%global private_soname private%{majorversion}
find . -type f -name Makefile -exec sed -i -e "s/SO_MAJOR_VERSION=\s\?\([0-9]\+\)/SO_MAJOR_VERSION= %{private_soname}-\1/" {} \;
%endif
%if %upgrade
tar xfj %{SOURCE3}
# libpq from this upgrade-only build is dropped and the libpq from the main
# version is used. Use the same major hack therefore.
%if ! %external_libpq
find . -type f -name Makefile -exec sed -i -e "s/SO_MAJOR_VERSION=\s\?\([0-9]\+\)/SO_MAJOR_VERSION= %{private_soname}-\1/" {} \;
%endif
# apply once SOURCE3 is extracted
%endif
@ -619,6 +638,13 @@ rm $RPM_BUILD_ROOT/%_includedir/pg_config*.h
rm $RPM_BUILD_ROOT/%_includedir/libpq/libpq-fs.h
rm $RPM_BUILD_ROOT/%_includedir/postgres_ext.h
rm -r $RPM_BUILD_ROOT/%_includedir/pgsql/internal/
%if ! %external_libpq
rm $RPM_BUILD_ROOT/%_includedir/libpq-events.h
rm $RPM_BUILD_ROOT/%_includedir/libpq-fe.h
rm $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/*.pc
rm $RPM_BUILD_ROOT/%{_libdir}/libpq.so
rm $RPM_BUILD_ROOT/%{_libdir}/libpq.a
%endif
# make sure these directories exist even if we suppressed all contrib modules
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/pgsql/contrib
@ -760,7 +786,10 @@ find_lang_bins server.lst \
find_lang_bins contrib.lst \
pg_archivecleanup pg_test_fsync pg_test_timing pg_waldump
find_lang_bins main.lst \
pg_dump pg_upgrade pgscripts psql
pg_dump pg_upgrade pgscripts psql \
%if ! %external_libpq
libpq%{private_soname}-5
%endif
%if %plperl
find_lang_bins plperl.lst plperl
%endif
@ -831,7 +860,9 @@ make -C postgresql-setup-%{setup_version} check
# so that extensions can use this dir.
%dir %{_libdir}/pgsql/bitcode
%endif
%if ! %external_libpq
%{_libdir}/libpq.so.*
%endif
%files docs
%doc *-US.pdf
@ -1129,6 +1160,9 @@ make -C postgresql-setup-%{setup_version} check
%changelog
* Fri Jun 04 2021 Honza Horak <hhorak@redhat.com> - 13.3-3
- Build with a private libpq
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 13.3-2
- Rebuilt for Python 3.10