diff --git a/add-loongarch-support.patch b/add-loongarch-support.patch index 053ba0932a5ac34d6a2ade2214b181fbb5b55d41..0ad1899e35efaca0e2f6240f2d6e87f5b1f05114 100644 --- a/add-loongarch-support.patch +++ b/add-loongarch-support.patch @@ -1,8 +1,8 @@ diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h -index 6b368a5..86e0e84 100644 +index 29ac6cd..aedf0fe 100644 --- a/src/include/storage/s_lock.h +++ b/src/include/storage/s_lock.h -@@ -696,6 +696,45 @@ do \ +@@ -525,6 +525,45 @@ do \ #endif /* __mips__ && !__sgi */ @@ -46,5 +46,5 @@ index 6b368a5..86e0e84 100644 +#endif /* __loongarch__ */ + - #if defined(__m32r__) && defined(HAVE_SYS_TAS_H) /* Renesas' M32R */ - #define HAS_TEST_AND_SET + #if defined(__hppa) || defined(__hppa__) /* HP PA-RISC */ + /* diff --git a/add-sw_64-support.patch b/add-sw_64-support.patch index caa0c666fd12ebac2898c8a7d3aa1e4b840a01ff..6001bbfea059783d09a318d14919e8210305078b 100644 --- a/add-sw_64-support.patch +++ b/add-sw_64-support.patch @@ -1,33 +1,19 @@ -From ed05d50b808df2bb0d11456515896a40e620389b Mon Sep 17 00:00:00 2001 -From: mahailiang -Date: Sat, 15 Mar 2025 11:46:26 +0800 +From 983bf80bb58101fd50fe5a7375abad61b9d50c8d Mon Sep 17 00:00:00 2001 +From: Funda Wang +Date: Fri, 15 Aug 2025 11:33:48 +0800 Subject: [PATCH] add sw_64 support --- - contrib/pgcrypto/crypt-blowfish.c | 2 +- - src/include/storage/s_lock.h | 43 +++++++++++++++++++++++++++++++ - 2 files changed, 44 insertions(+), 1 deletion(-) + src/include/storage/s_lock.h | 43 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) -diff --git a/contrib/pgcrypto/crypt-blowfish.c b/contrib/pgcrypto/crypt-blowfish.c -index a663852..e6d72b2 100644 ---- a/contrib/pgcrypto/crypt-blowfish.c -+++ b/contrib/pgcrypto/crypt-blowfish.c -@@ -41,7 +41,7 @@ - #ifdef __i386__ - #define BF_ASM 0 /* 1 */ - #define BF_SCALE 1 --#elif defined(__x86_64__) || defined(__alpha__) || defined(__hppa__) -+#elif defined(__x86_64__) || defined(__alpha__) || defined(__hppa__) || defined(__sw_64__) - #define BF_ASM 0 - #define BF_SCALE 1 - #else diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h -index 1ada0a8..3afd20e 100644 +index aedf0fe..7784e2c 100644 --- a/src/include/storage/s_lock.h +++ b/src/include/storage/s_lock.h -@@ -771,6 +771,49 @@ tas(volatile slock_t *lock) +@@ -765,6 +765,49 @@ spin_delay(void) - #endif /* __sh__ */ + #else /* !HAVE_SPINLOCKS */ +#if defined(__sw_64) || defined(__sw_64__) /* sw_64 */ +#define HAS_TEST_AND_SET @@ -73,8 +59,8 @@ index 1ada0a8..3afd20e 100644 +#endif /* __sw_64 || __sw_64__ */ + - /* These live in s_lock.c, but only for gcc */ - + /* + * Fake spinlock implementation using semaphores --- slow and prone -- -2.43.5 +2.47.1 diff --git a/libpq-10.3-var-run-socket.patch b/libpq-10.3-var-run-socket.patch index 4b130b0e0adca1c806190261db3d2c3391f6d54f..2c5c1282fd8aefe1b4118670cc3d038d76d132f0 100644 --- a/libpq-10.3-var-run-socket.patch +++ b/libpq-10.3-var-run-socket.patch @@ -1,3 +1,4 @@ + Change the built-in default socket directory to be /var/run/postgresql. For backwards compatibility with (probably non-libpq-based) clients that might still expect to find the socket in /tmp, also create a socket in @@ -12,37 +13,34 @@ server package update, without requiring any existing postgresql.conf to be updated. (Of course, a user who dislikes this behavior can still override it via postgresql.conf.) -diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c -index 4dde819652..8c2f601333 100644 ---- a/src/backend/utils/misc/guc.c -+++ b/src/backend/utils/misc/guc.c -@@ -4159,7 +4159,7 @@ static struct config_string ConfigureNamesString[] = +diff -ur postgresql-16.1/src/backend/utils/misc/guc_tables.c pg_patched/src/backend/utils/misc/guc_tables.c +--- postgresql-16.1/src/backend/utils/misc/guc_tables.c 2023-11-06 23:04:27.000000000 +0100 ++++ pg_patched/src/backend/utils/misc/guc_tables.c 2023-12-05 12:02:46.000000000 +0100 +@@ -4271,7 +4271,7 @@ + GUC_LIST_INPUT | GUC_LIST_QUOTE | GUC_SUPERUSER_ONLY }, &Unix_socket_directories, - #ifdef HAVE_UNIX_SOCKETS - DEFAULT_PGSOCKET_DIR, + DEFAULT_PGSOCKET_DIR ", /tmp", - #else - "", - #endif -diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c -index 4ff0c6c700..6ccd96b1f2 100644 ---- a/src/bin/initdb/initdb.c -+++ b/src/bin/initdb/initdb.c -@@ -1091,7 +1091,7 @@ setup_config(void) - - #ifdef HAVE_UNIX_SOCKETS - snprintf(repltok, sizeof(repltok), "#unix_socket_directories = '%s'", -- DEFAULT_PGSOCKET_DIR); -+ DEFAULT_PGSOCKET_DIR ", /tmp"); - #else - snprintf(repltok, sizeof(repltok), "#unix_socket_directories = ''"); - #endif -diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h -index 8f3ec6bde1..066daf3f08 100644 ---- a/src/include/pg_config_manual.h -+++ b/src/include/pg_config_manual.h -@@ -201,7 +201,7 @@ + NULL, NULL, NULL + }, + +diff -ur postgresql-16.1/src/bin/initdb/initdb.c pg_patched/src/bin/initdb/initdb.c +--- postgresql-16.1/src/bin/initdb/initdb.c 2023-11-06 23:04:27.000000000 +0100 ++++ pg_patched/src/bin/initdb/initdb.c 2023-12-05 12:04:19.000000000 +0100 +@@ -1287,7 +1287,7 @@ + * these are indeed defaults, keep the postgresql.conf lines commented. + */ + conflines = replace_guc_value(conflines, "unix_socket_directories", +- DEFAULT_PGSOCKET_DIR, true); ++ DEFAULT_PGSOCKET_DIR ", /tmp", true); + + conflines = replace_guc_value(conflines, "port", + DEF_PGPORT_STR, true); +diff -ur postgresql-16.1/src/include/pg_config_manual.h pg_patched/src/include/pg_config_manual.h +--- postgresql-16.1/src/include/pg_config_manual.h 2023-11-06 23:04:27.000000000 +0100 ++++ pg_patched/src/include/pg_config_manual.h 2023-12-05 11:45:20.000000000 +0100 +@@ -206,7 +206,7 @@ * support them yet. */ #ifndef WIN32 diff --git a/libpq-12.1-symbol-versioning.patch b/libpq-12.1-symbol-versioning.patch index 48a2482c84dc6e7df69f2643698a29add8b849a3..733b4ae4ef3f5c776437e099494f611684f328d0 100644 --- a/libpq-12.1-symbol-versioning.patch +++ b/libpq-12.1-symbol-versioning.patch @@ -1,4 +1,4 @@ -commit 75040c3388d9a7dd5ad2bee53cbcc8bf3d35cd17 +From 7de9e7c474a617863306efe8dc8463d7736685f2 Mon Sep 17 00:00:00 2001 Author: Honza Horak Date: Fri Oct 30 20:16:50 2020 +0100 @@ -6,6 +6,14 @@ Date: Fri Oct 30 20:16:50 2020 +0100 available in RHEL 8, and ABI versioning will guarantee us that modular RPMs will depend on appropriate libpq ABI version (picked at build-time). +--- + config/Makefile | 1 + + config/build-exports-gnu-ld | 41 ++++++++++++++++++++++++++++++++ + src/Makefile.shlib | 2 +- + src/interfaces/libpq/exports.txt | 10 ++++---- + 4 files changed, 48 insertions(+), 6 deletions(-) + create mode 100644 config/build-exports-gnu-ld + diff --git a/config/Makefile b/config/Makefile index 67e7998..86612a4 100644 --- a/config/Makefile @@ -15,12 +23,12 @@ index 67e7998..86612a4 100644 $(INSTALL_SCRIPT) $(srcdir)/install-sh '$(DESTDIR)$(pgxsdir)/config/install-sh' $(INSTALL_SCRIPT) $(srcdir)/missing '$(DESTDIR)$(pgxsdir)/config/missing' + $(INSTALL_SCRIPT) $(srcdir)/build-exports-gnu-ld '$(DESTDIR)$(pgxsdir)/config/build-exports-gnu-ld' - + installdirs: $(MKDIR_P) '$(DESTDIR)$(pgxsdir)/config' diff --git a/config/build-exports-gnu-ld b/config/build-exports-gnu-ld -new file mode 100755 -index 0000000000..84c48e3ade +new file mode 100644 +index 0000000..df88bd0 --- /dev/null +++ b/config/build-exports-gnu-ld @@ -0,0 +1,41 @@ @@ -38,39 +46,39 @@ index 0000000000..84c48e3ade + +open_block () +{ -+ $first || echo -+ first=false -+ echo "${SYMBOL_VERSION_PREFIX}$version {" -+ echo "global:" ++ $first || echo ++ first=false ++ echo "${SYMBOL_VERSION_PREFIX}$version {" ++ echo "global:" +} + +close_block () +{ -+ echo "}${version_prev:+ $SYMBOL_VERSION_PREFIX$version_prev};" -+ version_prev=$version -+ version=$1 ++ echo "}${version_prev:+ $SYMBOL_VERSION_PREFIX$version_prev};" ++ version_prev=$version ++ version=$1 +} + +open_block +while read -r symbol _ new_version +do -+ case $symbol in '#'*) continue ;; esac -+ if test -n "$new_version" && test "$new_version" != "$version"; then -+ close_block "$new_version" -+ open_block -+ fi -+ echo " $symbol;" ++ case $symbol in '#'*) continue ;; esac ++ if test -n "$new_version" && test "$new_version" != "$version"; then ++ close_block "$new_version" ++ open_block ++ fi ++ echo " $symbol;" +done + +echo "local:" -+echo " *;" ++echo " *;" +close_block diff --git a/src/Makefile.shlib b/src/Makefile.shlib -index 373d73caef..d5bd5468cd 100644 +index fa81f6f..f357c29 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib -@@ -231,7 +231,7 @@ ifeq ($(PORTNAME), linux) - ifdef soname +@@ -176,7 +176,7 @@ ifeq ($(PORTNAME), linux) + endif LINK.shared += -Wl,-soname,$(soname) endif - BUILD.exports = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@ @@ -78,10 +86,11 @@ index 373d73caef..d5bd5468cd 100644 exports_file = $(SHLIB_EXPORTS:%.txt=%.list) ifneq (,$(exports_file)) LINK.shared += -Wl,--version-script=$(exports_file) -diff -ur postgresql-14.1/src/interfaces/libpq/exports.txt patched/src/interfaces/libpq/exports.txt ---- postgresql-14.1/src/interfaces/libpq/exports.txt 2021-11-08 22:58:24.000000000 +0100 -+++ patched/src/interfaces/libpq/exports.txt 2022-01-12 12:00:28.000000000 +0100 -@@ -171,15 +171,15 @@ +diff --git a/src/interfaces/libpq/exports.txt b/src/interfaces/libpq/exports.txt +index 5d8213e..99da9b6 100644 +--- a/src/interfaces/libpq/exports.txt ++++ b/src/interfaces/libpq/exports.txt +@@ -171,22 +171,22 @@ PQsslAttributeNames 168 PQsslAttribute 169 PQsetErrorContextVisibility 170 PQresultVerboseErrorMessage 171 @@ -101,3 +110,14 @@ diff -ur postgresql-14.1/src/interfaces/libpq/exports.txt patched/src/interfaces PQexitPipelineMode 181 PQpipelineSync 182 PQpipelineStatus 183 + PQsetTraceFlags 184 + PQmblenBounded 185 + PQsendFlushRequest 186 +-PQconnectionUsedGSSAPI 187 ++PQconnectionUsedGSSAPI 187 16 + PQclosePrepared 188 + PQclosePortal 189 + PQsendClosePrepared 190 +-- +2.47.1 + diff --git a/libpq.spec b/libpq.spec index 8201424dac82300f9bd88478be006920e9f3c577..0de96a53f56396beb4efa954cdfe132662991a75 100644 --- a/libpq.spec +++ b/libpq.spec @@ -1,9 +1,11 @@ +%global majorversion 17 + Name: libpq -Version: 15.14 +Version: 17.6 Release: 1 Summary: PostgreSQL client library License: PostgreSQL -Url: http://www.postgresql.org/ +Url: https://www.postgresql.org/ Source0: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2 Patch0001: libpq-10.3-rpm-pgsql.patch @@ -12,7 +14,7 @@ Patch0003: libpq-12.1-symbol-versioning.patch Patch0004: add-loongarch-support.patch Patch0005: add-sw_64-support.patch -BuildRequires: gcc glibc-devel bison flex gawk zlib-devel openssl-devel +BuildRequires: gcc glibc-devel bison flex gawk zlib-devel openssl-devel libicu-devel BuildRequires: krb5-devel openldap-devel gettext multilib-rpm-config Obsoletes: postgresql-libs < 15 @@ -29,7 +31,6 @@ or interface. Summary: Development files for building PostgreSQL client tools Requires: libpq%{?_isa} = %{version}-%{release} Provides: postgresql-devel = %{version}-%{release} -Obsoletes: postgresql-devel < 15 %description devel The development package of libpq @@ -42,10 +43,11 @@ export SYMBOL_VERSION_PREFIX=RHPG_ %configure --disable-rpath --with-ldap --with-openssl --with-gssapi \ --enable-nls --without-readline --datadir=%_datadir/pgsql %global build_subdirs \\\ + src/include \\\ + src/common \\\ src/port \\\ src/interfaces/libpq \\\ - src/bin/pg_config \\\ - src/include + src/bin/pg_config for subdir in %build_subdirs; do %make_build -C "$subdir" done @@ -56,31 +58,48 @@ for subdir in %build_subdirs; do done find $RPM_BUILD_ROOT -name '*.a' -delete +# preserve just errcodes.h +mv $RPM_BUILD_ROOT%{_includedir}/pgsql/server/utils/errcodes.h \ + $RPM_BUILD_ROOT%{_includedir}/pgsql rm -r $RPM_BUILD_ROOT%_includedir/pgsql/server +mkdir -p $RPM_BUILD_ROOT%{_includedir}/pgsql/server/utils +mv $RPM_BUILD_ROOT%{_includedir}/pgsql/errcodes.h \ + $RPM_BUILD_ROOT%{_includedir}/pgsql/server/utils + +rm -f $RPM_BUILD_ROOT%{_datadir}/pgsql/postgres.bki $RPM_BUILD_ROOT%{_datadir}/pgsql/system_constraints.sql %multilib_fix_c_header --file "%_includedir/pg_config.h" %multilib_fix_c_header --file "%_includedir/pg_config_ext.h" -cp /dev/null libpq.lst -%find_lang libpq5-15 -cat libpq5-15.lang >>libpq.lst -cp /dev/null libpq-devel.lst -%find_lang pg_config-15 -cat pg_config-15.lang >>libpq-devel.lst +find_lang_bins () +{ + lstfile=$1 ; shift + cp /dev/null "$lstfile" + for binary; do + %find_lang "$binary"-%majorversion + cat "$binary"-%majorversion.lang >>"$lstfile" + done +} -%files -f libpq.lst +find_lang_bins %name.lst libpq5 +find_lang_bins %name-devel.lst pg_config + +%files -f %name.lst %license COPYRIGHT %_libdir/libpq.so.5* %dir %_datadir/pgsql %doc %_datadir/pgsql/pg_service.conf.sample -%files devel -f libpq-devel.lst +%files devel -f %name-devel.lst %_bindir/pg_config %_includedir/* %_libdir/libpq.so %_libdir/pkgconfig/libpq.pc %changelog +* Fri Aug 15 2025 Funda Wang - 17.6-1 +- update to 17.6 + * Fri Aug 15 2025 Funda Wang - 15.14-1 - update to version 15.14 diff --git a/postgresql-15.14.tar.bz2 b/postgresql-17.6.tar.bz2 similarity index 32% rename from postgresql-15.14.tar.bz2 rename to postgresql-17.6.tar.bz2 index 36b7461a2e16bbb45f4c16e5abfab5ce3ca01006..7862d8393074aff0523ebef0d9028bc56d95806f 100644 --- a/postgresql-15.14.tar.bz2 +++ b/postgresql-17.6.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:06dd75d305cd3870ee62b3932e661c624543eaf9ae2ba37cdec0a4f8edd051d2 -size 23229854 +oid sha256:e0630a3600aea27511715563259ec2111cd5f4353a4b040e0be827f94cd7a8b0 +size 21623975