diff --git a/.gitignore b/.gitignore index e69de29..bd9c63f 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,12 @@ +/postgresql-17.2.tar.bz2 +/postgresql-17.2.tar.bz2.sha256 +/postgresql-setup-8.9.tar.gz +/postgresql-18beta1.tar.bz2.sha256 +/postgresql-18beta1.tar.bz2 +/postgresql-18.0.tar.bz2 +/postgresql-17.6.tar.bz2 +/postgresql-18.0.tar.bz2.sha256 +/postgresql-17.6.tar.bz2.sha256 +/postgresql-16.10.tar.bz2 +/postgresql-16.10.tar.bz2.sha256 +/postgresql-16.6.tar.bz2.sha256 diff --git a/Makefile.regress b/Makefile.regress new file mode 100644 index 0000000..95bc589 --- /dev/null +++ b/Makefile.regress @@ -0,0 +1,69 @@ +# +# Simplified makefile for running the PostgreSQL regression tests +# in an RPM installation +# + +# maximum simultaneous connections for parallel tests +MAXCONNOPT = +ifdef MAX_CONNECTIONS +MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS) +endif + +# locale +NOLOCALE = +ifdef NO_LOCALE +NOLOCALE += --no-locale +endif + +srcdir := . + +REGRESS_OPTS += --dlpath=. + +pg_regress_locale_flags = $(if $(ENCODING),--encoding=$(ENCODING)) $(NOLOCALE) + +pg_regress_installcheck = ./pg_regress --inputdir=$(srcdir) --bindir=@bindir@ $(pg_regress_locale_flags) + +# Test input and expected files. These are created by pg_regress itself, so we +# don't have a rule to create them. We do need rules to clean them however. +ifile_list := $(subst .source,, $(notdir $(wildcard $(srcdir)/input/*.source))) +input_files := $(foreach file, $(ifile_list), sql/$(file).sql) +ofile_list := $(subst .source,, $(notdir $(wildcard $(srcdir)/output/*.source))) +output_files := $(foreach file, $(ofile_list), expected/$(file).out) + +abs_srcdir := $(shell pwd) +abs_builddir := $(shell pwd) + +check: installcheck-parallel + +installcheck: cleandirs + $(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/serial_schedule $(EXTRA_TESTS) + +installcheck-parallel: cleandirs + $(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(EXTRA_TESTS) + +# The tests command the server to write into testtablespace and results. +# On a SELinux-enabled system this will fail unless we mark those directories +# as writable by the server. +cleandirs: + -rm -rf testtablespace results + mkdir testtablespace results + if test -x /usr/bin/chcon && ! test -f /.dockerenv; then \ + /usr/bin/chcon -u system_u -r object_r -t postgresql_db_t testtablespace results ; \ + fi + +# old interfaces follow... + +runcheck: check +runtest: installcheck +runtest-parallel: installcheck-parallel + + +## +## Clean up +## + +clean distclean maintainer-clean: + rm -f $(output_files) $(input_files) + rm -rf testtablespace + rm -rf results tmp_check log + rm -f regression.diffs regression.out regress.out run_check.out diff --git a/README.md b/README.md new file mode 100644 index 0000000..b92ec81 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# postgresql18 + +The postgresql18 package diff --git a/ci.fmf b/ci.fmf new file mode 100644 index 0000000..c5aa0e0 --- /dev/null +++ b/ci.fmf @@ -0,0 +1 @@ +resultsdb-testcase: separate diff --git a/generate-sources.sh b/generate-sources.sh new file mode 100644 index 0000000..1d53682 --- /dev/null +++ b/generate-sources.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +rm sources +set -e +spectool -S *.spec | cut -d' ' -f2 \ + | grep -E -e 'postgresql-.*\.tar\.*' -e 'postgresql.*\.pdf' | sort | \ +while read line +do + base=`basename "$line"` + echo " * handling $base" + sha512sum --tag "$base" >> sources +done diff --git a/hstore-plperl-data-dumper.patch b/hstore-plperl-data-dumper.patch new file mode 100644 index 0000000..dfc2f23 --- /dev/null +++ b/hstore-plperl-data-dumper.patch @@ -0,0 +1,192 @@ +From 69db3b0cfccc0687dfbdf56afcfb2f8e536053c6 Mon Sep 17 00:00:00 2001 +From: Andrew Dunstan +Date: Sun, 14 May 2017 01:10:18 -0400 +Subject: [PATCH] Suppress indentation from Data::Dumper in regression tests + +Ultra-modern versions of the perl Data::Dumper module have apparently +changed how they indent output. Instead of trying to keep up we choose +to tell it to supporess all indentation in the hstore_plperl regression +tests. + +Backpatch to 9.5 where this feature was introduced. +--- + contrib/hstore_plperl/expected/hstore_plperlu.out | 44 ++++++----------------- + contrib/hstore_plperl/sql/hstore_plperlu.sql | 6 ++++ + 2 files changed, 17 insertions(+), 33 deletions(-) + +diff --git a/contrib/hstore_plperl/expected/hstore_plperlu.out b/contrib/hstore_plperl/expected/hstore_plperlu.out +index b09fb78..d719d29 100644 +--- a/contrib/hstore_plperl/expected/hstore_plperlu.out ++++ b/contrib/hstore_plperl/expected/hstore_plperlu.out +@@ -20,15 +20,12 @@ TRANSFORM FOR TYPE hstore + AS $$ + use Data::Dumper; + $Data::Dumper::Sortkeys = 1; ++$Data::Dumper::Indent = 0; + elog(INFO, Dumper($_[0])); + return scalar(keys %{$_[0]}); + $$; + SELECT test1('aa=>bb, cc=>NULL'::hstore); +-INFO: $VAR1 = { +- 'aa' => 'bb', +- 'cc' => undef +- }; +- ++INFO: $VAR1 = {'aa' => 'bb','cc' => undef}; + test1 + ------- + 2 +@@ -39,12 +36,12 @@ LANGUAGE plperlu + AS $$ + use Data::Dumper; + $Data::Dumper::Sortkeys = 1; ++$Data::Dumper::Indent = 0; + elog(INFO, Dumper($_[0])); + return scalar(keys %{$_[0]}); + $$; + SELECT test1none('aa=>bb, cc=>NULL'::hstore); + INFO: $VAR1 = '"aa"=>"bb", "cc"=>NULL'; +- + test1none + ----------- + 0 +@@ -56,15 +53,12 @@ TRANSFORM FOR TYPE hstore + AS $$ + use Data::Dumper; + $Data::Dumper::Sortkeys = 1; ++$Data::Dumper::Indent = 0; + elog(INFO, Dumper($_[0])); + return scalar(keys %{$_[0]}); + $$; + SELECT test1list('aa=>bb, cc=>NULL'::hstore); +-INFO: $VAR1 = { +- 'aa' => 'bb', +- 'cc' => undef +- }; +- ++INFO: $VAR1 = {'aa' => 'bb','cc' => undef}; + test1list + ----------- + 2 +@@ -77,18 +71,12 @@ TRANSFORM FOR TYPE hstore + AS $$ + use Data::Dumper; + $Data::Dumper::Sortkeys = 1; ++$Data::Dumper::Indent = 0; + elog(INFO, Dumper($_[0]->[0], $_[0]->[1])); + return scalar(keys %{$_[0]}); + $$; + SELECT test1arr(array['aa=>bb, cc=>NULL'::hstore, 'dd=>ee']); +-INFO: $VAR1 = { +- 'aa' => 'bb', +- 'cc' => undef +- }; +-$VAR2 = { +- 'dd' => 'ee' +- }; +- ++INFO: $VAR1 = {'aa' => 'bb','cc' => undef};$VAR2 = {'dd' => 'ee'}; + test1arr + ---------- + 2 +@@ -101,6 +89,7 @@ TRANSFORM FOR TYPE hstore + AS $$ + use Data::Dumper; + $Data::Dumper::Sortkeys = 1; ++$Data::Dumper::Indent = 0; + + $rv = spi_exec_query(q{SELECT 'aa=>bb, cc=>NULL'::hstore AS col1}); + elog(INFO, Dumper($rv->{rows}[0]->{col1})); +@@ -111,13 +100,8 @@ $rv = spi_exec_prepared($plan, {}, $val); + elog(INFO, Dumper($rv->{rows}[0]->{col1})); + $$; + SELECT test3(); +-INFO: $VAR1 = { +- 'aa' => 'bb', +- 'cc' => undef +- }; +- ++INFO: $VAR1 = {'aa' => 'bb','cc' => undef}; + INFO: $VAR1 = '"a"=>"1", "b"=>"boo", "c"=>NULL'; +- + test3 + ------- + +@@ -138,6 +122,7 @@ TRANSFORM FOR TYPE hstore + AS $$ + use Data::Dumper; + $Data::Dumper::Sortkeys = 1; ++$Data::Dumper::Indent = 0; + elog(INFO, Dumper($_TD->{new})); + if ($_TD->{new}{a} == 1) { + $_TD->{new}{b} = {a => 1, b => 'boo', c => undef}; +@@ -147,14 +132,7 @@ return "MODIFY"; + $$; + CREATE TRIGGER test4 BEFORE UPDATE ON test1 FOR EACH ROW EXECUTE PROCEDURE test4(); + UPDATE test1 SET a = a; +-INFO: $VAR1 = { +- 'a' => '1', +- 'b' => { +- 'aa' => 'bb', +- 'cc' => undef +- } +- }; +- ++INFO: $VAR1 = {'a' => '1','b' => {'aa' => 'bb','cc' => undef}}; + SELECT * FROM test1; + a | b + ---+--------------------------------- +diff --git a/contrib/hstore_plperl/sql/hstore_plperlu.sql b/contrib/hstore_plperl/sql/hstore_plperlu.sql +index 8d8508c..c714b35 100644 +--- a/contrib/hstore_plperl/sql/hstore_plperlu.sql ++++ b/contrib/hstore_plperl/sql/hstore_plperlu.sql +@@ -15,6 +15,7 @@ TRANSFORM FOR TYPE hstore + AS $$ + use Data::Dumper; + $Data::Dumper::Sortkeys = 1; ++$Data::Dumper::Indent = 0; + elog(INFO, Dumper($_[0])); + return scalar(keys %{$_[0]}); + $$; +@@ -26,6 +27,7 @@ LANGUAGE plperlu + AS $$ + use Data::Dumper; + $Data::Dumper::Sortkeys = 1; ++$Data::Dumper::Indent = 0; + elog(INFO, Dumper($_[0])); + return scalar(keys %{$_[0]}); + $$; +@@ -38,6 +40,7 @@ TRANSFORM FOR TYPE hstore + AS $$ + use Data::Dumper; + $Data::Dumper::Sortkeys = 1; ++$Data::Dumper::Indent = 0; + elog(INFO, Dumper($_[0])); + return scalar(keys %{$_[0]}); + $$; +@@ -52,6 +55,7 @@ TRANSFORM FOR TYPE hstore + AS $$ + use Data::Dumper; + $Data::Dumper::Sortkeys = 1; ++$Data::Dumper::Indent = 0; + elog(INFO, Dumper($_[0]->[0], $_[0]->[1])); + return scalar(keys %{$_[0]}); + $$; +@@ -66,6 +70,7 @@ TRANSFORM FOR TYPE hstore + AS $$ + use Data::Dumper; + $Data::Dumper::Sortkeys = 1; ++$Data::Dumper::Indent = 0; + + $rv = spi_exec_query(q{SELECT 'aa=>bb, cc=>NULL'::hstore AS col1}); + elog(INFO, Dumper($rv->{rows}[0]->{col1})); +@@ -90,6 +95,7 @@ TRANSFORM FOR TYPE hstore + AS $$ + use Data::Dumper; + $Data::Dumper::Sortkeys = 1; ++$Data::Dumper::Indent = 0; + elog(INFO, Dumper($_TD->{new})); + if ($_TD->{new}{a} == 1) { + $_TD->{new}{b} = {a => 1, b => 'boo', c => undef}; +-- +2.1.4 diff --git a/plans/tier1-internal.fmf b/plans/tier1-internal.fmf new file mode 100644 index 0000000..c9a9e11 --- /dev/null +++ b/plans/tier1-internal.fmf @@ -0,0 +1,8 @@ +summary: internal tier1 beakerlib tests +discover: + how: fmf + url: https://pkgs.devel.redhat.com/git/tests/postgresql + filter: 'tier: 1' +execute: + how: tmt + diff --git a/plperl_warning.patch b/plperl_warning.patch new file mode 100644 index 0000000..1e260a3 --- /dev/null +++ b/plperl_warning.patch @@ -0,0 +1,23 @@ +diff -ur postgresql-15.4/src/pl/plperl/expected/plperl_call.out postgresql-patched/src/pl/plperl/expected/plperl_call.out +--- postgresql-15.4/src/pl/plperl/expected/plperl_call.out 2023-08-07 22:08:18.000000000 +0200 ++++ postgresql-patched/src/pl/plperl/expected/plperl_call.out 2023-09-18 10:23:42.499078442 +0200 +@@ -64,6 +64,7 @@ + RAISE NOTICE '_a: %, _b: %', _a, _b; + END + $$; ++WARNING: could not determine encoding for locale "C.UTF-8": codeset is "ANSI_X3.4-1968" + NOTICE: a: 10, b: + NOTICE: _a: 10, _b: 20 + DROP PROCEDURE test_proc1; +diff -ur postgresql-15.4/src/pl/plperl/expected/plperl_elog_1.out postgresql-patched/src/pl/plperl/expected/plperl_elog_1.out +--- postgresql-15.4/src/pl/plperl/expected/plperl_elog_1.out 2023-08-07 22:08:18.000000000 +0200 ++++ postgresql-patched/src/pl/plperl/expected/plperl_elog_1.out 2023-09-18 10:24:39.233451395 +0200 +@@ -76,6 +76,7 @@ + RETURN 1; + END; + $$; ++WARNING: could not determine encoding for locale "C.UTF-8": codeset is "ANSI_X3.4-1968" + select die_caller(); + NOTICE: caught die + die_caller +Only in postgresql-patched/src/pl/plperl/expected: plperl_warning.patch diff --git a/postgresql-12.5-contrib-dblink-expected-out.patch b/postgresql-12.5-contrib-dblink-expected-out.patch new file mode 100644 index 0000000..bd4b0e5 --- /dev/null +++ b/postgresql-12.5-contrib-dblink-expected-out.patch @@ -0,0 +1,13 @@ +diff --git a/contrib/dblink/expected/dblink.out b/contrib/dblink/expected/dblink.out +index 6ceabb453c..6516d4f131 100644 +--- a/contrib/dblink/expected/dblink.out ++++ b/contrib/dblink/expected/dblink.out +@@ -879,7 +879,7 @@ $d$; + CREATE USER MAPPING FOR public SERVER fdtest + OPTIONS (server 'localhost'); -- fail, can't specify server here + ERROR: invalid option "server" +-HINT: Valid options in this context are: user, password ++HINT: Valid options in this context are: user, password, sslpassword + CREATE USER MAPPING FOR public SERVER fdtest OPTIONS (user :'USER'); + GRANT USAGE ON FOREIGN SERVER fdtest TO regress_dblink_user; + GRANT EXECUTE ON FUNCTION dblink_connect_u(text, text) TO regress_dblink_user; diff --git a/postgresql-bashprofile b/postgresql-bashprofile new file mode 100644 index 0000000..1cd70d3 --- /dev/null +++ b/postgresql-bashprofile @@ -0,0 +1,4 @@ +[ -f /etc/profile ] && source /etc/profile + +PGDATA=/var/lib/pgsql/data +export PGDATA diff --git a/postgresql-datalayout-mismatch-on-s390.patch b/postgresql-datalayout-mismatch-on-s390.patch new file mode 100644 index 0000000..eef0378 --- /dev/null +++ b/postgresql-datalayout-mismatch-on-s390.patch @@ -0,0 +1,99 @@ +From 0edaa982336823d4d7af8f10b91579fe0099ef3d Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Tue, 20 Apr 2021 20:14:21 -0700 +Subject: [PATCH] jit: Workaround potential datalayout mismatch on s390x + +LLVM's s390x target uses a different datalayout for z13 and newer processors. +If llvmjit_types.bc is compiled to target a processor older than z13, and +then the JIT runs on a z13 or newer processor, then there will be a mismatch +in datalayouts between llvmjit_types.bc and the JIT engine. This mismatch +causes the JIT to fail at runtime. +--- + src/backend/jit/llvm/llvmjit.c | 46 ++++++++++++++++++++++++++++++++-- + 1 file changed, 44 insertions(+), 2 deletions(-) + +diff --git a/src/backend/jit/llvm/llvmjit.c b/src/backend/jit/llvm/llvmjit.c +index 98a27f08bf..05b6438ba8 100644 +--- a/src/backend/jit/llvm/llvmjit.c ++++ b/src/backend/jit/llvm/llvmjit.c +@@ -776,6 +776,35 @@ llvm_compile_module(LLVMJitContext *context) + errhidecontext(true))); + } + ++/* ++ * For the systemz target, LLVM uses a different datalayout for z13 and newer ++ * CPUs than it does for older CPUs. This can cause a mismatch in datalayouts ++ * in the case where the llvm_types_module is compiled with a pre-z13 CPU ++ * and the JIT is running on z13 or newer. ++ * See computeDataLayout() function in ++ * llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp for information on the ++ * datalayout differences. ++ */ ++static bool ++needs_systemz_workaround(void) ++{ ++ bool ret = false; ++ LLVMContextRef llvm_context; ++ LLVMTypeRef vec_type; ++ LLVMTargetDataRef llvm_layoutref; ++ if (strncmp(LLVMGetTargetName(llvm_targetref), "systemz", strlen("systemz"))) ++ { ++ return false; ++ } ++ ++ llvm_context = LLVMGetModuleContext(llvm_types_module); ++ vec_type = LLVMVectorType(LLVMIntTypeInContext(llvm_context, 32), 4); ++ llvm_layoutref = LLVMCreateTargetData(llvm_layout); ++ ret = (LLVMABIAlignmentOfType(llvm_layoutref, vec_type) == 16); ++ LLVMDisposeTargetData(llvm_layoutref); ++ return ret; ++} ++ + /* + * Per session initialization. + */ +@@ -785,6 +814,7 @@ llvm_session_initialize(void) + MemoryContext oldcontext; + char *error = NULL; + char *cpu = NULL; ++ char *host_features = NULL; + char *features = NULL; + LLVMTargetMachineRef opt0_tm; + LLVMTargetMachineRef opt3_tm; +@@ -816,10 +846,17 @@ llvm_session_initialize(void) + * features not all CPUs have (weird, huh). + */ + cpu = LLVMGetHostCPUName(); +- features = LLVMGetHostCPUFeatures(); ++ features = host_features = LLVMGetHostCPUFeatures(); + elog(DEBUG2, "LLVMJIT detected CPU \"%s\", with features \"%s\"", + cpu, features); + ++ if (needs_systemz_workaround()) ++ { ++ const char *no_vector =",-vector"; ++ features = malloc(sizeof(char) * (strlen(host_features) + strlen(no_vector) + 1)); ++ sprintf(features, "%s%s", host_features, no_vector); ++ } ++ + opt0_tm = + LLVMCreateTargetMachine(llvm_targetref, llvm_triple, cpu, features, + LLVMCodeGenLevelNone, +@@ -833,8 +870,13 @@ llvm_session_initialize(void) + + LLVMDisposeMessage(cpu); + cpu = NULL; +- LLVMDisposeMessage(features); ++ if (features != host_features) ++ { ++ free(features); ++ } + features = NULL; ++ LLVMDisposeMessage(host_features); ++ host_features = NULL; + + /* force symbols in main binary to be loaded */ + LLVMLoadLibraryPermanently(NULL); +-- +2.27.0 + diff --git a/postgresql-external-libpq.patch b/postgresql-external-libpq.patch new file mode 100644 index 0000000..ba7ef73 --- /dev/null +++ b/postgresql-external-libpq.patch @@ -0,0 +1,43 @@ +We don't build/install interfaces by upstream's implicit rules. + +This patch is used on two places; postgresql.spec and libecpg.spec -- keep those +in sync! + +Related: rhbz#1618698 + +diff --git a/src/Makefile b/src/Makefile +index bcdbd95..4bea236 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -20,7 +20,6 @@ SUBDIRS = \ + backend/utils/mb/conversion_procs \ + backend/snowball \ + include \ +- interfaces \ + backend/replication/libpqwalreceiver \ + backend/replication/pgoutput \ + fe_utils \ +diff --git a/src/Makefile.global.in b/src/Makefile.global.in +index b9d86ac..29df69f 100644 +--- a/src/Makefile.global.in ++++ b/src/Makefile.global.in +@@ -549,7 +549,7 @@ endif + # How to link to libpq. (This macro may be used as-is by backend extensions. + # Client-side code should go through libpq_pgport or libpq_pgport_shlib, + # instead.) +-libpq = -L$(libpq_builddir) -lpq ++libpq = -lpq + + # libpq_pgport is for use by client executables (not libraries) that use libpq. + # We force clients to pull symbols from the non-shared libraries libpgport +@@ -579,7 +579,6 @@ endif + # Commonly used submake targets + + submake-libpq: | submake-generated-headers +- $(MAKE) -C $(libpq_builddir) all + + submake-libpgport: | submake-generated-headers + $(MAKE) -C $(top_builddir)/src/port all +-- +2.21.0 + diff --git a/postgresql-logging.patch b/postgresql-logging.patch new file mode 100644 index 0000000..b1c84e9 --- /dev/null +++ b/postgresql-logging.patch @@ -0,0 +1,33 @@ +diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample +index 83d5df8e46..e47d127a7b 100644 +--- a/src/backend/utils/misc/postgresql.conf.sample ++++ b/src/backend/utils/misc/postgresql.conf.sample +@@ -473,7 +473,7 @@ + # logging_collector to be on. + + # This is used when logging to stderr: +-#logging_collector = off # Enable capturing of stderr, jsonlog, ++logging_collector = on # Enable capturing of stderr, jsonlog, + # and csvlog into log files. Required + # to be on for csvlogs and jsonlogs. + # (change requires restart) +@@ -481,16 +481,16 @@ + # These are only used if logging_collector is on: + #log_directory = 'log' # directory where log files are written, + # can be absolute or relative to PGDATA +-#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, ++log_filename = 'postgresql-%a.log' # log file name pattern, + # can include strftime() escapes + #log_file_mode = 0600 # creation mode for log files, + # begin with 0 to use octal notation +-#log_rotation_age = 1d # Automatic rotation of logfiles will ++log_rotation_age = 1d # Automatic rotation of logfiles will + # happen after that time. 0 disables. + #log_rotation_size = 10MB # Automatic rotation of logfiles will + # happen after that much log output. + # 0 disables. +-#log_truncate_on_rotation = off # If on, an existing log file with the ++log_truncate_on_rotation = on # If on, an existing log file with the + # same name as the new log file will be + # truncated rather than appended to. + # But such truncation only occurs on diff --git a/postgresql-man.patch b/postgresql-man.patch new file mode 100644 index 0000000..6b0ed00 --- /dev/null +++ b/postgresql-man.patch @@ -0,0 +1,49 @@ +PostgreSQL ecpg/initdb manual page fixes + +This was generated based on automatic Red Hat manual page scan (private +RHBZ#948933). + +diff -up postgresql-13.1/doc/src/sgml/man1/ecpg.1.patch6 postgresql-13.1/doc/src/sgml/man1/ecpg.1 +--- postgresql-13.1/doc/src/sgml/man1/ecpg.1.patch6 2020-11-09 23:38:03.000000000 +0100 ++++ postgresql-13.1/doc/src/sgml/man1/ecpg.1 2020-11-18 09:26:40.547324791 +0100 +@@ -81,6 +81,11 @@ ORACLE\&. + Define a C preprocessor symbol\&. + .RE + .PP ++\fB\-h \fR ++.RS 4 ++Parse a header file, this option includes option \fB\-c\fR\&. ++.RE ++.PP + \fB\-h\fR + .RS 4 + Process header files\&. When this option is specified, the output file extension becomes +@@ -144,6 +149,11 @@ Allow question mark as placeholder for c + .RE + .RE + .PP ++\fB\-\-regression\fR ++.RS 4 ++Run in regression testing mode\&. ++.RE ++.PP + \fB\-t\fR + .RS 4 + Turn on autocommit of transactions\&. In this mode, each SQL command is automatically committed unless it is inside an explicit transaction block\&. In the default mode, commands are committed only when +diff -up postgresql-13.1/doc/src/sgml/man1/initdb.1.patch6 postgresql-13.1/doc/src/sgml/man1/initdb.1 +--- postgresql-13.1/doc/src/sgml/man1/initdb.1.patch6 2020-11-09 23:38:05.000000000 +0100 ++++ postgresql-13.1/doc/src/sgml/man1/initdb.1 2020-11-18 09:25:05.082348424 +0100 +@@ -311,6 +311,13 @@ determines that an error prevented it fr + .PP + Other options: + .PP ++\fB\-s\fR ++.br ++\fB\-\-show\fR ++.RS 4 ++Print the internal settings, then exit\&. ++.RE ++.PP + \fB\-V\fR + .br + \fB\-\-version\fR diff --git a/postgresql-no-libecpg.patch b/postgresql-no-libecpg.patch new file mode 100644 index 0000000..1ef7e69 --- /dev/null +++ b/postgresql-no-libecpg.patch @@ -0,0 +1,13 @@ +diff -ur postgresql-18beta1/src/interfaces/Makefile pg18_patch/src/interfaces/Makefile +--- postgresql-18beta1/src/interfaces/Makefile 2025-05-05 20:25:46.000000000 +0000 ++++ pg18_patch/src/interfaces/Makefile 2025-05-21 08:13:15.038986820 +0000 +@@ -12,7 +12,7 @@ + top_builddir = ../.. + include $(top_builddir)/src/Makefile.global + +-SUBDIRS = libpq ecpg ++SUBDIRS = libpq + + ifeq ($(with_libcurl), yes) + SUBDIRS += libpq-oauth +Only in pg18_patch/src/interfaces: Makefile.orig diff --git a/postgresql-server-pg_config.patch b/postgresql-server-pg_config.patch new file mode 100644 index 0000000..e86f5f1 --- /dev/null +++ b/postgresql-server-pg_config.patch @@ -0,0 +1,59 @@ +We should ideally provide '/bin/pg_config' in postgresql-server-devel, and +provide no pg_config binary in libpq package. But most of the Fedora packages +that use pg_config actually only build against PG libraries (and +postgresql-server-devel isn't needed). So.., to avoid the initial rush around +rhbz#1618698 change, rather provide pg_server_config binary, which int urn means +that we'll have to fix only a minimal set of packages which really build +PostgreSQL server modules. + +diff -ur postgresql-17.0/src/bin/pg_config/Makefile postgresql-17.0_patched/src/bin/pg_config/Makefile +--- postgresql-17.0/src/bin/pg_config/Makefile 2024-09-23 22:02:53.000000000 +0200 ++++ postgresql-17.0_patched/src/bin/pg_config/Makefile 2024-10-01 22:55:48.058972358 +0200 +@@ -11,6 +11,8 @@ + PGFILEDESC = "pg_config - report configuration information" + PGAPPICON=win32 + ++PG_CONFIG = pg_server_config$(X) ++ + subdir = src/bin/pg_config + top_builddir = ../../.. + include $(top_builddir)/src/Makefile.global +@@ -19,22 +21,22 @@ + $(WIN32RES) \ + pg_config.o + +-all: pg_config ++all: $(PG_CONFIG) + +-pg_config: $(OBJS) | submake-libpgport +- $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) ++$(PG_CONFIG): $(OBJS) | submake-libpgport ++ $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@ + + install: all installdirs +- $(INSTALL_SCRIPT) pg_config$(X) '$(DESTDIR)$(bindir)/pg_config$(X)' ++ $(INSTALL_SCRIPT) $(PG_CONFIG) '$(DESTDIR)$(bindir)/$(PG_CONFIG)' + + installdirs: + $(MKDIR_P) '$(DESTDIR)$(bindir)' + + uninstall: +- rm -f '$(DESTDIR)$(bindir)/pg_config$(X)' ++ rm -f '$(DESTDIR)$(bindir)/$(PG_CONFIG)' + + clean distclean: +- rm -f pg_config$(X) $(OBJS) ++ rm -f $(PG_CONFIG) $(OBJS) + rm -rf tmp_check + + check: +diff -ur postgresql-17.0/src/bin/pg_config/nls.mk postgresql-17.0_patched/src/bin/pg_config/nls.mk +--- postgresql-17.0/src/bin/pg_config/nls.mk 2024-09-23 22:02:53.000000000 +0200 ++++ postgresql-17.0_patched/src/bin/pg_config/nls.mk 2024-10-01 22:55:48.076305162 +0200 +@@ -1,5 +1,5 @@ + # src/bin/pg_config/nls.mk +-CATALOG_NAME = pg_config ++CATALOG_NAME = pg_server_config + GETTEXT_FILES = pg_config.c \ + ../../common/config_info.c \ + ../../common/exec.c \ diff --git a/postgresql-var-run-socket.patch b/postgresql-var-run-socket.patch new file mode 100644 index 0000000..1e554e5 --- /dev/null +++ b/postgresql-var-run-socket.patch @@ -0,0 +1,50 @@ +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 +/tmp. This is to resolve communication problems with clients operating +under systemd's PrivateTmp environment, which won't be using the same +global /tmp directory as the server; see bug #825448. + +Note that we apply the socket directory change at the level of the +hard-wired defaults in the C code, not by just twiddling the setting in +postgresql.conf.sample; this is so that the change will take effect on +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 -ur -x 'cscope*' postgresql-16beta1/src/backend/utils/misc/guc_tables.c postgresql16_socket_patch/src/backend/utils/misc/guc_tables.c +--- postgresql-16beta1/src/backend/utils/misc/guc_tables.c 2023-05-22 23:08:08.000000000 +0200 ++++ postgresql16_socket_patch/src/backend/utils/misc/guc_tables.c 2023-06-01 09:39:24.000000000 +0200 +@@ -4300,7 +4300,7 @@ + GUC_LIST_INPUT | GUC_LIST_QUOTE | GUC_SUPERUSER_ONLY + }, + &Unix_socket_directories, +- DEFAULT_PGSOCKET_DIR, ++ DEFAULT_PGSOCKET_DIR ", /tmp", + NULL, NULL, NULL + }, + +diff -ur -x 'cscope*' postgresql-16beta1/src/bin/initdb/initdb.c postgresql16_socket_patch/src/bin/initdb/initdb.c +--- postgresql-16beta1/src/bin/initdb/initdb.c 2023-05-22 23:08:08.000000000 +0200 ++++ postgresql16_socket_patch/src/bin/initdb/initdb.c 2023-06-01 09:42:16.000000000 +0200 +@@ -1291,7 +1291,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 -x 'cscope*' postgresql-16beta1/src/include/pg_config_manual.h postgresql16_socket_patch/src/include/pg_config_manual.h +--- postgresql-16beta1/src/include/pg_config_manual.h 2023-05-22 23:08:08.000000000 +0200 ++++ postgresql16_socket_patch/src/include/pg_config_manual.h 2023-06-01 09:43:19.000000000 +0200 +@@ -206,7 +206,7 @@ + * support them yet. + */ + #ifndef WIN32 +-#define DEFAULT_PGSOCKET_DIR "/tmp" ++#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql" + #else + #define DEFAULT_PGSOCKET_DIR "" + #endif diff --git a/postgresql.pam b/postgresql.pam new file mode 100644 index 0000000..1d78594 --- /dev/null +++ b/postgresql.pam @@ -0,0 +1,3 @@ +#%PAM-1.0 +auth include password-auth +account include password-auth diff --git a/postgresql.tmpfiles.d b/postgresql.tmpfiles.d new file mode 100644 index 0000000..6c48e34 --- /dev/null +++ b/postgresql.tmpfiles.d @@ -0,0 +1 @@ +d /run/postgresql 0755 postgres postgres - diff --git a/postgresql18.spec b/postgresql18.spec new file mode 100644 index 0000000..0377618 --- /dev/null +++ b/postgresql18.spec @@ -0,0 +1,1364 @@ +# This is the PostgreSQL Global Development Group Official RPMset spec file, +# or a derivative thereof. + +# This spec file and ancillary files are licensed in accordance with +# The PostgreSQL license. + +# In this file you can find the default build package list macros. +# These can be overridden by defining on the rpm command line: +# rpm --define 'packagename 1' .... to force the package to build. +# rpm --define 'packagename 0' .... to force the package NOT to build. +# The base package, the libs package, the devel package, and the server package +# always get built. + +%{!?test:%global test 1} +%{!?llvmjit:%global llvmjit 0} +%{!?external_libpq:%global external_libpq 0} +%{!?upgrade:%global upgrade 1} +%{!?plpython3:%global plpython3 1} +%{!?pltcl:%global pltcl 0} +%{!?plperl:%global plperl 1} +%{!?ssl:%global ssl 1} +%{!?icu:%global icu 1} +%{!?kerberos:%global kerberos 1} +%{!?ldap:%global ldap 1} +%{!?nls:%global nls 1} +%{!?uuid:%global uuid 1} +%{!?xml:%global xml 1} +%{!?pam:%global pam 1} +%{!?sdt:%global sdt 1} +%{!?selinux:%global selinux 1} +%{!?runselftest:%global runselftest 1} +%{!?postgresql_default:%global postgresql_default 0} + +%global majorname postgresql +%global majorversion 18 + +# By default, patch(1) creates backup files when chunks apply with offsets. +# Turn that off to ensure such files don't get included in RPMs. +%global _default_patch_flags --no-backup-if-mismatch + +# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_of_Additional_RPM_Macros +%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) + +# Don't create note file, added package_note_flags to linker by redhat-rpm-config +# will cause issue during extension build because it'll be inherited. +%undefine _package_note_file + +Summary: PostgreSQL client programs +Name: %{majorname}%{majorversion} +Version: 18.0 +Release: 1%{?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. +License: PostgreSQL +Url: http://www.postgresql.org/ + +# This SRPM includes a copy of the previous major release, which is needed for +# in-place upgrade of an old database. In most cases it will not be critical +# that this be kept up with the latest minor release of the previous series; +# but update when bugs affecting pg_dump output are fixed. +%global prevmajorversion 16 +%global prevversion %{prevmajorversion}.10 +%global prev_prefix %{_libdir}/pgsql/postgresql-%{prevmajorversion} +%global precise_version %{?epoch:%epoch:}%version-%release + +%global setup_version 8.9 + +%global service_name postgresql.service + +Source0: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2 +Source3: https://ftp.postgresql.org/pub/source/v%{prevversion}/postgresql-%{prevversion}.tar.bz2 +Source4: Makefile.regress +Source9: postgresql.tmpfiles.d +Source10: postgresql.pam +Source11: postgresql-bashprofile + + +# git: https://github.com/devexp-db/postgresql-setup +Source12: https://github.com/devexp-db/postgresql-setup/releases/download/v%{setup_version}/postgresql-setup-%{setup_version}.tar.gz + +# Those here are just to enforce packagers check that the tarball was downloaded +# correctly. Also, this allows us check that packagers-only tarballs do not +# differ with publicly released ones. +Source16: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2.sha256 +Source17: https://ftp.postgresql.org/pub/source/v%{prevversion}/postgresql-%{prevversion}.tar.bz2.sha256 + +# Comments for these patches are in the patch files. +Patch1: rpm-pgsql.patch +Patch2: postgresql-logging.patch +Patch5: postgresql-var-run-socket.patch +Patch8: postgresql-external-libpq.patch +Patch9: postgresql-server-pg_config.patch +# Upstream bug #16971: https://www.postgresql.org/message-id/16971-5d004d34742a3d35%40postgresql.org +# rhbz#1940964 +Patch10: postgresql-datalayout-mismatch-on-s390.patch +Patch12: postgresql-no-libecpg.patch + +# This macro is used for package names in the files section +%if %?postgresql_default +%global pkgname %{majorname} +%package -n %{pkgname} +Summary: PostgreSQL client programs +%else +%global pkgname %{majorname}%{majorversion} +%endif + +BuildRequires: make +BuildRequires: lz4-devel +BuildRequires: libzstd-devel +BuildRequires: gcc +BuildRequires: perl(ExtUtils::MakeMaker) glibc-devel bison flex gawk +BuildRequires: perl(ExtUtils::Embed), perl-devel +BuildRequires: perl(Opcode) +BuildRequires: perl-FindBin +%if 0%{?fedora} || 0%{?rhel} > 7 +BuildRequires: perl-generators +%endif +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 +BuildRequires: m4 elinks docbook-utils help2man + +%if %plpython3 +BuildRequires: python3-devel +%endif + +%if %pltcl +BuildRequires: tcl-devel +%endif + +%if %ssl +BuildRequires: openssl-devel +%endif + +%if %kerberos +BuildRequires: krb5-devel +%endif + +%if %ldap +BuildRequires: openldap-devel +%endif + +%if %nls +BuildRequires: gettext >= 0.10.35 +%endif + +%if %uuid +BuildRequires: uuid-devel +%endif + +%if %xml +BuildRequires: libxml2-devel libxslt-devel +%endif + +%if %pam +BuildRequires: pam-devel +%endif + +%if %sdt +BuildRequires: systemtap-sdt-devel +BuildRequires: systemtap-sdt-dtrace +%endif + +%if %selinux +BuildRequires: libselinux-devel +%endif + +%if %icu +BuildRequires: libicu-devel +%endif + +%if %?postgresql_default +%define postgresqlXX_if_default() %{expand:\ +Provides: postgresql%{majorversion}%{?1:-%{1}} = %precise_version\ +Provides: postgresql%{majorversion}%{?1:-%{1}}%{?_isa} = %precise_version\ +Obsoletes: postgresql%{majorversion}%{?1:-%{1}}\ +} +%else +%define postgresqlXX_if_default() %{nil} +%endif + +%define conflict_with_other_streams() %{expand:\ +Provides: %{majorname}%{?1:-%{1}}-any\ +Conflicts: %{majorname}%{?1:-%{1}}-any\ +} + +%define virtual_conflicts_and_provides() %{expand:\ +%conflict_with_other_streams %{**}\ +%postgresqlXX_if_default %{**}\ +} + +Provides: %{pkgname} = %precise_version +Provides: %{pkgname}%{?_isa} = %precise_version + +%virtual_conflicts_and_provides + +# https://bugzilla.redhat.com/1464368 +# and do not provide pkgconfig RPM provides (RHBZ#1980992) and #2121696 +%global __provides_exclude_from %{_libdir}/(pgsql|pkgconfig) + +%description +PostgreSQL is an advanced Object-Relational database management system (DBMS). +The base postgresql package contains the client programs that you'll need to +access a PostgreSQL DBMS server, as well as HTML documentation for the whole +system. These client programs can be located on the same machine as the +PostgreSQL server, or on a remote machine that accesses a PostgreSQL server +over a network connection. The PostgreSQL server can be found in the +postgresql-server sub-package. + +%description -n %{pkgname} +PostgreSQL is an advanced Object-Relational database management system (DBMS). +The base postgresql package contains the client programs that you'll need to +access a PostgreSQL DBMS server, as well as HTML documentation for the whole +system. These client programs can be located on the same machine as the +PostgreSQL server, or on a remote machine that accesses a PostgreSQL server +over a network connection. The PostgreSQL server can be found in the +postgresql-server sub-package. + + +%if ! %external_libpq +%package -n %{pkgname}-private-libs +Summary: The shared libraries required only for this build of PostgreSQL server +Group: Applications/Databases +# for /sbin/ldconfig +Requires(post): glibc +Requires(postun): glibc +Provides: %{pkgname}-private-libs = %precise_version +Provides: %{pkgname}-private-libs%{?_isa} = %precise_version + +%virtual_conflicts_and_provides private-libs + +%description -n %{pkgname}-private-libs +The postgresql-private-libs package provides the shared libraries for this +build of PostgreSQL server and plugins build with this version of server. +For shared libraries used by client packages that need to connect to a +PostgreSQL server, install libpq package instead. + + +%package -n %{pkgname}-private-devel +Summary: PostgreSQL development header files for this build of PostgreSQL server +Group: Development/Libraries +Requires: %{pkgname}-private-libs%{?_isa} = %precise_version +# Conflict is desired here, a user must pick one or another +Conflicts: libpq-devel +Provides: %{pkgname}-devel = %precise_version +Provides: %{pkgname}-devel%{?_isa} = %precise_version + +%virtual_conflicts_and_provides private-devel + +%description -n %{pkgname}-private-devel +The postgresql-private-devel package contains the header files and libraries +needed to compile C or C++ applications which will directly interact +with a PostgreSQL database management server. +You need to install this package if you want to develop applications which +will interact with a PostgreSQL server. +%endif + + +%package -n %{pkgname}-server +Summary: The programs needed to create and run a PostgreSQL server +Requires: %{pkgname}%{?_isa} = %precise_version +# We require this to be present for %%{_prefix}/lib/tmpfiles.d +Requires: systemd +# Make sure it's there when scriptlets run, too +%{?systemd_requires} +# We require this to be present for /usr/sbin/runuser when using --initdb (rhbz#2071437) +Requires: util-linux +# postgresql setup requires runuser from util-linux package +BuildRequires: util-linux +# Packages which provide postgresql plugins should build-require +# postgresql-server-devel and require +# postgresql-server(:MODULE_COMPAT_%%{postgresql_major}). +# This will automatically guard against incompatible server & plugin +# installation (#1008939, #1007840) +Provides: %{pkgname}-server(:MODULE_COMPAT_%{majorversion}) +Provides: bundled(postgresql-setup) = %setup_version +Provides: %{pkgname}-server = %precise_version +Provides: %{pkgname}-server%{?_isa} = %precise_version +# Provide symbol regardless version. This symbol is present in every single +# postgresql stream + +%virtual_conflicts_and_provides server + +%description -n %{pkgname}-server +PostgreSQL is an advanced Object-Relational database management system (DBMS). +The postgresql-server package contains the programs needed to create +and run a PostgreSQL server, which will in turn allow you to create +and maintain PostgreSQL databases. + + +%package -n %{pkgname}-docs +Summary: Extra documentation for PostgreSQL +Requires: %{pkgname}%{?_isa} = %precise_version +Provides: %{pkgname}-doc = %precise_version +Provides: %{pkgname}-docs = %precise_version + +%virtual_conflicts_and_provides docs + +%description -n %{pkgname}-docs +The postgresql-docs package contains some additional documentation for +PostgreSQL. Currently, this includes the main documentation in PDF format +and source files for the PostgreSQL tutorial. + + +%package -n %{pkgname}-contrib +Summary: Extension modules distributed with PostgreSQL +Requires: %{pkgname}%{?_isa} = %precise_version +Provides: %{pkgname}-contrib = %precise_version +Provides: %{pkgname}-contrib%{?_isa} = %precise_version + +%virtual_conflicts_and_provides contrib + +%description -n %{pkgname}-contrib +The postgresql-contrib package contains various extension modules that are +included in the PostgreSQL distribution. + + +%package -n %{pkgname}-server-devel +Summary: PostgreSQL development header files and libraries +%if %icu +Requires: libicu-devel +%endif +%if %kerberos +Requires: krb5-devel +%endif +%if %llvmjit +Requires: clang-devel llvm-devel +%endif +%if %external_libpq +# Some extensions require libpq +# Do not make them care about whether server uses private or system-wide +# libpq, simply let the server pull the correct one +Requires: libpq-devel +%else +Requires: %{pkgname}-private-devel +%endif +Provides: %{pkgname}-server-devel = %precise_version +Provides: %{pkgname}-server-devel%{?_isa} = %precise_version + +%virtual_conflicts_and_provides server-devel + +%description -n %{pkgname}-server-devel +The postgresql-server-devel package contains the header files and configuration +needed to compile PostgreSQL server extension. + +%package -n %{pkgname}-test-rpm-macros +Summary: Convenience RPM macros for build-time testing against PostgreSQL server +Requires: %{pkgname}-server = %precise_version +BuildArch: noarch +Provides: %{pkgname}-test-rpm-macros = %precise_version + +%conflict_with_other_streams test-rpm-macros + +%description -n %{pkgname}-test-rpm-macros +This package is meant to be added as BuildRequires: dependency of other packages +that want to run build-time testsuite against running PostgreSQL server. + + +%package -n %{pkgname}-static +Summary: Statically linked PostgreSQL libraries +Requires: %{pkgname}-server-devel%{?_isa} = %precise_version +Provides: %{pkgname}-static = %precise_version +Provides: %{pkgname}-static%{?_isa} = %precise_version + +%virtual_conflicts_and_provides static + +%description -n %{pkgname}-static +Statically linked PostgreSQL libraries that do not have dynamically linked +counterparts. + + +%if %upgrade +%package -n %{pkgname}-upgrade +Summary: Support for upgrading from the previous major release of PostgreSQL +Requires: %{pkgname}-server%{?_isa} = %precise_version +Provides: bundled(postgresql-server) = %prevversion +Provides: %{pkgname}-upgrade = %precise_version +Provides: %{pkgname}-upgrade%{?_isa} = %precise_version + +%virtual_conflicts_and_provides upgrade + +%description -n %{pkgname}-upgrade +The postgresql-upgrade package contains the pg_upgrade utility and supporting +files needed for upgrading a PostgreSQL database from the previous major +version of PostgreSQL. + + +%package -n %{pkgname}-upgrade-devel +Summary: Support for build of extensions required for upgrade process +Requires: %{pkgname}-upgrade%{?_isa} = %precise_version +Provides: %{pkgname}-upgrade-devel = %precise_version +Provides: %{pkgname}-upgrade-devel%{?_isa} = %precise_version + +%virtual_conflicts_and_provides upgrade-devel + +%description -n %{pkgname}-upgrade-devel +The postgresql-devel package contains the header files and libraries +needed to compile C or C++ applications which are necessary in upgrade +process. +%endif + + +%if %plperl +%package -n %{pkgname}-plperl +Summary: The Perl procedural language for PostgreSQL +Requires: %{pkgname}-server%{?_isa} = %precise_version +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +%if %runselftest +BuildRequires: perl(Opcode) +BuildRequires: perl(Data::Dumper) +%endif +Provides: %{pkgname}-plperl = %precise_version +Provides: %{pkgname}-plperl%{?_isa} = %precise_version + +%virtual_conflicts_and_provides plperl + +%description -n %{pkgname}-plperl +The postgresql-plperl package contains the PL/Perl procedural language, +which is an extension to the PostgreSQL database server. +Install this if you want to write database functions in Perl. +%endif + + +%if %plpython3 +%package -n %{pkgname}-plpython3 +Summary: The Python3 procedural language for PostgreSQL +Requires: %{pkgname}-server%{?_isa} = %precise_version +Provides: %{pkgname}-plpython3 = %precise_version +Provides: %{pkgname}-plpython3%{?_isa} = %precise_version + +%virtual_conflicts_and_provides plpython3 + +%description -n %{pkgname}-plpython3 +The postgresql-plpython3 package contains the PL/Python3 procedural language, +which is an extension to the PostgreSQL database server. +Install this if you want to write database functions in Python 3. +%endif + + +%if %pltcl +%package -n %{pkgname}-pltcl +Summary: The Tcl procedural language for PostgreSQL +Requires: %{pkgname}-server%{?_isa} = %precise_version +Provides: %{pkgname}-pltcl = %precise_version +Provides: %{pkgname}-pltcl%{?_isa} = %precise_version + +%virtual_conflicts_and_provides pltcl + +%description -n %{pkgname}-pltcl +The postgresql-pltcl package contains the PL/Tcl procedural language, +which is an extension to the PostgreSQL database server. +Install this if you want to write database functions in Tcl. +%endif + + +%if %test +%package -n %{pkgname}-test +Summary: The test suite distributed with PostgreSQL +Requires: %{pkgname}-server%{?_isa} = %precise_version +Requires: %{pkgname}-server-devel%{?_isa} = %precise_version +Requires: %{pkgname}-contrib%{?_isa} = %precise_version +Provides: %{pkgname}-test = %precise_version +Provides: %{pkgname}-test%{?_isa} = %precise_version + +%virtual_conflicts_and_provides test + +%description -n %{pkgname}-test +The postgresql-test package contains files needed for various tests for the +PostgreSQL database management system, including regression tests and +benchmarks. +%endif + +%if %llvmjit +%package -n %{pkgname}-llvmjit +Summary: Just-in-time compilation support for PostgreSQL +Requires: %{pkgname}-server%{?_isa} = %{version}-%{release} +%if 0%{?rhel} && 0%{?rhel} == 7 +Requires: llvm5.0 >= 5.0 +%else +Requires: llvm => 5.0 +%endif +Provides: postgresql-llvmjit >= %{version}-%{release} +Provides: %{pkgname}-llvmjit = %precise_version +Provides: %{pkgname}-llvmjit%{?_isa} = %precise_version + +BuildRequires: llvm-devel >= 5.0 clang-devel >= 5.0 + +%virtual_conflicts_and_provides llvmjit + +%description -n %{pkgname}-llvmjit +The postgresql-llvmjit package contains support for +just-in-time compiling parts of PostgreSQL queries. Using LLVM it +compiles e.g. expressions and tuple deforming into native code, with the +goal of accelerating analytics queries. +%endif + +%prep +( + cd "$(dirname "%{SOURCE0}")" + sha256sum -c %{SOURCE16} +%if %upgrade + sha256sum -c %{SOURCE17} +%endif +) +%setup -q -a 12 -n postgresql-%{version} +%patch 1 -p1 +%patch 2 -p1 +%patch 5 -p1 +%if %external_libpq +%patch 8 -p1 +%else +%patch 12 -p1 +%endif +%patch 9 -p1 +%patch 10 -p1 + + +%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 + +# remove .gitignore files to ensure none get into the RPMs (bug #642210) +find . -type f -name .gitignore | xargs rm + +# Create a sysusers.d config file +cat > postgresql18.sysusers.conf < postgresql18.tmpfiles.conf < src/tutorial/GNUmakefile +make %{?_smp_mflags} -C src/tutorial NO_PGXS=1 all +rm -f src/tutorial/GNUmakefile + +# The object files shouldn't be copied to rpm bz#1187514 +rm -f src/tutorial/*.o + +# run_testsuite WHERE +# ------------------- +# Run 'make check' in WHERE path. When that command fails, return the logs +# given by PostgreSQL build system and set 'test_failure=1'. This function +# never exits directly nor stops rpmbuild where `set -e` is enabled. +run_testsuite() +{ + make -k -C "$1" MAX_CONNECTIONS=5 check && return 0 || test_failure=1 + ( + set +x + echo "=== trying to find all regression.diffs files in build directory ===" + find "$1" -name 'regression.diffs' | \ + while read line; do + echo "=== make failure: $line ===" + cat "$line" + done + ) +} + +test_failure=0 + +%if %runselftest + run_testsuite "src/test/regress" + make clean -C "src/test/regress" + run_testsuite "src/pl" + run_testsuite "contrib" +%endif + +# "assert(ALL_TESTS_OK)" +test "$test_failure" -eq 0 + +%if %test + # undo the "make clean" above + make all -C src/test/regress +%endif + +%if %upgrade + pushd postgresql-%{prevversion} + + # The upgrade build can be pretty stripped-down, but make sure that + # any options that affect on-disk file layout match the previous + # major release! + + # The set of built server modules here should ideally create superset + # of modules we used to ship in %%prevversion (in the installation + # the user will upgrade from), including *-contrib or *-pl* + # subpackages. This increases chances that the upgrade from + # %%prevversion will work smoothly. + +upgrade_configure () +{ + # Note we intentionally do not use %%configure here, because we *don't* want + # its ideas about installation paths. + + # The -fno-aggressive-loop-optimizations is hack for #993532 + CFLAGS="$CFLAGS -fno-aggressive-loop-optimizations -DOPENSSL_NO_ENGINE" ./configure \ + --build=%{_build} \ + --host=%{_host} \ + --prefix=%prev_prefix \ + --disable-rpath \ + --with-lz4 \ + --with-zstd \ +%if %icu + --with-icu \ +%endif +%if %plperl + --with-perl \ +%endif +%if %pltcl + --with-tcl \ +%endif +%if %ldap + --with-ldap \ +%endif +%if %pam + --with-pam \ +%endif +%if %kerberos + --with-gssapi \ +%endif +%if %uuid + --with-ossp-uuid \ +%endif +%if %xml + --with-libxml \ + --with-libxslt \ +%endif +%if %nls + --enable-nls \ +%endif +%if %sdt + --enable-dtrace \ +%endif +%if %selinux +%if %ssl + --with-openssl \ +%endif + --with-selinux \ +%endif +%if %plpython3 + --with-python \ +%endif + --with-tclconfig=/usr/%_lib \ + --with-system-tzdata=/usr/share/zoneinfo \ + "$@" +} + + upgrade_configure \ + + make %{?_smp_mflags} all + make -C contrib %{?_smp_mflags} all + popd +# endif upgrade +%endif + + +%install +cd postgresql-setup-%{setup_version} +make install DESTDIR=$RPM_BUILD_ROOT +cd .. + +# For some reason, having '%%doc %%{_pkgdocdir}/README.rpm-dist' in %%files +# causes FTBFS (at least on RHEL6), see rhbz#1250006. +mv $RPM_BUILD_ROOT/%{_pkgdocdir}/README.rpm-dist ./ + +cat > $RPM_BUILD_ROOT%{_sysconfdir}/postgresql-setup/upgrade/postgresql.conf < $RPM_BUILD_ROOT%macrosdir/macros.postgresql-upgrade +%%postgresql_upgrade_prefix %prev_prefix +EOF +%endif + +# Let plugins use the same llvmjit settings as server has +cat <> $RPM_BUILD_ROOT%macrosdir/macros.postgresql +%%postgresql_server_llvmjit %llvmjit +EOF + +%if %test + # tests. There are many files included here that are unnecessary, + # but include them anyway for completeness. We replace the original + # Makefiles, however. + mkdir -p $RPM_BUILD_ROOT%{_libdir}/pgsql/test + cp -a src/test/regress $RPM_BUILD_ROOT%{_libdir}/pgsql/test + # pg_regress binary should be only in one subpackage, + # there will be a symlink from -test to -devel + rm -f $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/pg_regress + rm -f $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/refint.so + rm -f $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/autoinc.so + ln -sf ../../pgxs/src/test/regress/pg_regress $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/pg_regress + ln -sf ../../autoinc.so $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/autoinc.so + ln -sf ../../refint.so $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/refint.so + pushd $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress + rm -f GNUmakefile Makefile *.o + chmod 0755 pg_regress regress.so + popd + sed 's|@bindir@|%{_bindir}|g' \ + < %{SOURCE4} \ + > $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/Makefile + chmod 0644 $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/Makefile +%endif + +rm -rf doc/html # HACK! allow 'rpmbuild -bi --short-circuit' +mv $RPM_BUILD_ROOT%{_docdir}/pgsql/html doc +rm -rf $RPM_BUILD_ROOT%{_docdir}/pgsql + +# remove files not to be packaged +rm $RPM_BUILD_ROOT%{_libdir}/libpgfeutils.a + +%if !%plperl +rm -f $RPM_BUILD_ROOT%{_bindir}/pgsql/hstore_plperl.so +%endif + +# no python2, yet installed, remove +rm -f $RPM_BUILD_ROOT%{_datadir}/pgsql/extension/*_plpythonu* +rm -f $RPM_BUILD_ROOT%{_datadir}/pgsql/extension/*_plpython2u* + +%if %nls +find_lang_bins () +{ + lstfile=$1 ; shift + cp /dev/null "$lstfile" + for binary; do + %find_lang "$binary"-%{majorversion} + cat "$binary"-%{majorversion}.lang >>"$lstfile" + done +} +find_lang_bins devel.lst pg_server_config +find_lang_bins server.lst \ + initdb pg_basebackup pg_controldata pg_ctl pg_resetwal pg_rewind plpgsql \ + postgres pg_checksums pg_verifybackup pg_combinebackup \ + pg_walsummary +find_lang_bins contrib.lst \ + pg_amcheck pg_archivecleanup pg_test_fsync pg_test_timing pg_waldump +find_lang_bins main.lst \ + pg_dump pg_upgrade pgscripts psql \ +%if ! %external_libpq +libpq%{private_soname}-5 +%endif + +%if %plperl +find_lang_bins plperl.lst plperl +%endif +%if %plpython3 +find_lang_bins plpython3.lst plpython +%endif +%if %pltcl +find_lang_bins pltcl.lst pltcl +%endif +%endif + +install -m0644 -D postgresql18.sysusers.conf %{buildroot}%{_sysusersdir}/postgresql18.conf +install -m0644 -D postgresql18.tmpfiles.conf %{buildroot}%{_tmpfilesdir}/postgresql18.conf + +%post -n %{pkgname}-server +%systemd_post %service_name + + +%preun -n %{pkgname}-server +%systemd_preun %service_name + + +%postun -n %{pkgname}-server +%systemd_postun_with_restart %service_name + + +%check +%if %runselftest +make -C postgresql-setup-%{setup_version} check +%endif + +# FILES sections. +%files -f main.lst -n %{pkgname} +%doc doc/KNOWN_BUGS doc/MISSING_FEATURES doc/TODO +%doc COPYRIGHT HISTORY +%doc README.rpm-dist +%{_bindir}/clusterdb +%{_bindir}/createdb +%{_bindir}/createuser +%{_bindir}/dropdb +%{_bindir}/dropuser +%{_bindir}/pg_dump +%{_bindir}/pg_dumpall +%{_bindir}/pg_isready +%{_bindir}/pg_restore +%{_bindir}/pg_upgrade +%{_bindir}/psql +%{_bindir}/reindexdb +%{_bindir}/vacuumdb +%{_mandir}/man1/clusterdb.* +%{_mandir}/man1/createdb.* +%{_mandir}/man1/createuser.* +%{_mandir}/man1/dropdb.* +%{_mandir}/man1/dropuser.* +%{_mandir}/man1/pg_dump.* +%{_mandir}/man1/pg_dumpall.* +%{_mandir}/man1/pg_isready.* +%{_mandir}/man1/pg_restore.* +%{_mandir}/man1/pg_upgrade.* +%{_mandir}/man1/psql.* +%{_mandir}/man1/reindexdb.* +%{_mandir}/man1/vacuumdb.* +%{_mandir}/man7/* +%if %llvmjit +# Install bitcode directory along with the main package, +# so that extensions can use this dir. +%dir %{_libdir}/pgsql/bitcode +%endif + + +%if ! %external_libpq +%files -n %{pkgname}-private-libs +%{_libdir}/libpq.so.* +%endif + + +%files -n %{pkgname}-docs +%doc doc/html +%{_libdir}/pgsql/tutorial/ + + +%files -n %{pkgname}-contrib -f contrib.lst +%doc contrib/spi/*.example +%{_bindir}/oid2name +%{_bindir}/pg_amcheck +%{_bindir}/pg_archivecleanup +%{_bindir}/pg_test_fsync +%{_bindir}/pg_test_timing +%{_bindir}/pg_waldump + +%{_bindir}/pg_walsummary +%{_bindir}/pg_combinebackup + +%{_bindir}/pgbench +%{_bindir}/vacuumlo +%{_datadir}/pgsql/extension/amcheck* +%{_datadir}/pgsql/extension/autoinc* +%{_datadir}/pgsql/extension/bloom* +%{_datadir}/pgsql/extension/btree_gin* +%{_datadir}/pgsql/extension/btree_gist* +%{_datadir}/pgsql/extension/citext* +%{_datadir}/pgsql/extension/cube* +%{_datadir}/pgsql/extension/dblink* +%{_datadir}/pgsql/extension/dict_int* +%{_datadir}/pgsql/extension/dict_xsyn* +%{_datadir}/pgsql/extension/earthdistance* +%{_datadir}/pgsql/extension/file_fdw* +%{_datadir}/pgsql/extension/fuzzystrmatch* +%{_datadir}/pgsql/extension/hstore* +%{_datadir}/pgsql/extension/insert_username* +%{_datadir}/pgsql/extension/intagg* +%{_datadir}/pgsql/extension/intarray* +%{_datadir}/pgsql/extension/isn* +%if %{plperl} +%{_datadir}/pgsql/extension/jsonb_plperl* +%endif +%if %{plpython3} +%{_datadir}/pgsql/extension/jsonb_plpython3u* +%endif +%{_datadir}/pgsql/extension/lo* +%{_datadir}/pgsql/extension/pg_logicalinspect* +%{_datadir}/pgsql/extension/ltree* +%{_datadir}/pgsql/extension/moddatetime* +%{_datadir}/pgsql/extension/pageinspect* +%{_datadir}/pgsql/extension/pg_buffercache* +%{_datadir}/pgsql/extension/pg_freespacemap* +%{_datadir}/pgsql/extension/pg_prewarm* +%{_datadir}/pgsql/extension/pg_stat_statements* +%{_datadir}/pgsql/extension/pg_surgery* +%{_datadir}/pgsql/extension/pg_trgm* +%{_datadir}/pgsql/extension/pg_visibility* +%{_datadir}/pgsql/extension/pg_walinspect* +%{_datadir}/pgsql/extension/pgcrypto* +%{_datadir}/pgsql/extension/pgrowlocks* +%{_datadir}/pgsql/extension/pgstattuple* +%{_datadir}/pgsql/extension/postgres_fdw* +%{_datadir}/pgsql/extension/refint* +%{_datadir}/pgsql/extension/seg* +%{_datadir}/pgsql/extension/tablefunc* +%{_datadir}/pgsql/extension/tcn* +%{_datadir}/pgsql/extension/tsm_system_rows* +%{_datadir}/pgsql/extension/tsm_system_time* +%{_datadir}/pgsql/extension/unaccent* +%{_libdir}/pgsql/_int.so +%{_libdir}/pgsql/amcheck.so +%{_libdir}/pgsql/auth_delay.so +%{_libdir}/pgsql/auto_explain.so +%{_libdir}/pgsql/autoinc.so +%{_libdir}/pgsql/bloom.so +%{_libdir}/pgsql/btree_gin.so +%{_libdir}/pgsql/btree_gist.so +%{_libdir}/pgsql/citext.so +%{_libdir}/pgsql/cube.so +%{_libdir}/pgsql/dblink.so +%{_libdir}/pgsql/dict_int.so +%{_libdir}/pgsql/dict_xsyn.so +%{_libdir}/pgsql/earthdistance.so +%{_libdir}/pgsql/file_fdw.so +%{_libdir}/pgsql/fuzzystrmatch.so +%{_libdir}/pgsql/hstore.so +%if %plperl +%{_libdir}/pgsql/hstore_plperl.so +%endif +%if %plpython3 +%{_libdir}/pgsql/hstore_plpython3.so +%endif +%{_libdir}/pgsql/insert_username.so +%{_libdir}/pgsql/isn.so +%if %plperl +%{_libdir}/pgsql/jsonb_plperl.so +%endif +%if %plpython3 +%{_libdir}/pgsql/jsonb_plpython3.so +%endif +%{_libdir}/pgsql/lo.so +%{_libdir}/pgsql/ltree.so +%if %plpython3 +%{_libdir}/pgsql/ltree_plpython3.so +%endif +%{_libdir}/pgsql/pg_logicalinspect.so +%{_libdir}/pgsql/pg_overexplain.so +%{_libdir}/pgsql/moddatetime.so +%{_libdir}/pgsql/pageinspect.so +%{_libdir}/pgsql/passwordcheck.so +%{_libdir}/pgsql/pg_buffercache.so +%{_libdir}/pgsql/pg_freespacemap.so +%{_libdir}/pgsql/pg_stat_statements.so +%{_libdir}/pgsql/pg_surgery.so +%{_libdir}/pgsql/pg_trgm.so +%{_libdir}/pgsql/pg_visibility.so +%{_libdir}/pgsql/pg_walinspect.so +%{_libdir}/pgsql/basic_archive.so +%{_libdir}/pgsql/basebackup_to_shell.so +%{_libdir}/pgsql/pgcrypto.so +%{_libdir}/pgsql/pgrowlocks.so +%{_libdir}/pgsql/pgstattuple.so +%{_libdir}/pgsql/postgres_fdw.so +%{_libdir}/pgsql/refint.so +%{_libdir}/pgsql/seg.so +%{_libdir}/pgsql/tablefunc.so +%{_libdir}/pgsql/tcn.so +%{_libdir}/pgsql/test_decoding.so +%{_libdir}/pgsql/tsm_system_rows.so +%{_libdir}/pgsql/tsm_system_time.so +%{_libdir}/pgsql/unaccent.so +%{_mandir}/man1/oid2name.* +%{_mandir}/man1/pg_amcheck.* +%{_mandir}/man1/pg_archivecleanup.* +%{_mandir}/man1/pg_recvlogical.* +%{_mandir}/man1/pg_test_fsync.* +%{_mandir}/man1/pg_test_timing.* +%{_mandir}/man1/pg_waldump.* +%{_mandir}/man1/pgbench.* +%{_mandir}/man1/vacuumlo.* +%{_mandir}/man3/dblink* +%if %selinux +%{_datadir}/pgsql/contrib/sepgsql.sql +%{_libdir}/pgsql/sepgsql.so +%endif +%if %ssl +%{_datadir}/pgsql/extension/sslinfo* +%{_libdir}/pgsql/sslinfo.so +%endif +%if %uuid +%{_datadir}/pgsql/extension/uuid-ossp* +%{_libdir}/pgsql/uuid-ossp.so +%endif +%if %xml +%{_datadir}/pgsql/extension/xml2* +%{_libdir}/pgsql/pgxml.so +%endif + +%files -n %{pkgname}-server -f server.lst +%{_bindir}/initdb +%{_bindir}/pg_basebackup + +%{_bindir}/pg_controldata +%{_bindir}/pg_ctl +%{_bindir}/pg_receivewal +%{_bindir}/pg_recvlogical +%{_bindir}/pg_resetwal +%{_bindir}/pg_rewind +%{_bindir}/pg_checksums +%{_bindir}/pg_verifybackup + +%{_bindir}/pg_createsubscriber + +%{_bindir}/postgres +%{_bindir}/postgresql-setup +%{_bindir}/postgresql-upgrade +%dir %{_datadir}/pgsql +%{_datadir}/pgsql/*.sample +%dir %{_datadir}/pgsql/contrib +%dir %{_datadir}/pgsql/extension +%{_datadir}/pgsql/extension/plpgsql* +%{_datadir}/pgsql/information_schema.sql +%{_datadir}/pgsql/postgres.bki +%{_datadir}/pgsql/snowball_create.sql +%{_datadir}/pgsql/sql_features.txt +%{_datadir}/pgsql/system_constraints.sql +%{_datadir}/pgsql/system_functions.sql +%{_datadir}/pgsql/system_views.sql +%{_datadir}/pgsql/timezonesets/ +%{_datadir}/pgsql/tsearch_data/ +%dir %{_datadir}/postgresql-setup +%{_datadir}/postgresql-setup/library.sh +%dir %{_libdir}/pgsql +%{_libdir}/pgsql/*_and_*.so +%{_libdir}/pgsql/dict_snowball.so +%{_libdir}/pgsql/euc2004_sjis2004.so +%{_libdir}/pgsql/libpqwalreceiver.so +%{_libdir}/pgsql/pg_prewarm.so +%{_libdir}/pgsql/pgoutput.so +%{_libdir}/pgsql/plpgsql.so +%dir %{_usr}/libexec/initscripts/legacy-actions/postgresql +%{_usr}/libexec/initscripts/legacy-actions/postgresql/* +%{_libexecdir}/postgresql-check-db-dir +%dir %{_sysconfdir}/postgresql-setup +%dir %{_sysconfdir}/postgresql-setup/upgrade +%config %{_sysconfdir}/postgresql-setup/upgrade/*.conf +%{_mandir}/man1/initdb.* +%{_mandir}/man1/pg_basebackup.* +%{_mandir}/man1/pg_controldata.* +%{_mandir}/man1/pg_ctl.* +%{_mandir}/man1/pg_receivewal.* +%{_mandir}/man1/pg_resetwal.* +%{_mandir}/man1/pg_rewind.* +%{_mandir}/man1/pg_checksums.* +%{_mandir}/man1/pg_verifybackup.* +%{_mandir}/man1/postgres.* +%{_mandir}/man1/postgresql-new-systemd-unit.* +%{_mandir}/man1/postgresql-setup.* +%{_mandir}/man1/postgresql-upgrade.* + +%{_mandir}/man1/pg_walsummary.* +%{_mandir}/man1/pg_combinebackup.* +%{_mandir}/man1/pg_createsubscriber.* + +%{_sbindir}/postgresql-new-systemd-unit +%{_tmpfilesdir}/postgresql.conf +%{_unitdir}/*postgresql*.service +%attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql +%attr(644,postgres,postgres) %config(noreplace) %{?_localstatedir}/lib/pgsql/.bash_profile +%attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql/backups +%attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql/data +%ghost %attr(755,postgres,postgres) %dir %{_rundir}/postgresql +%if %pam +%config(noreplace) /etc/pam.d/postgresql +%endif +%{_sysusersdir}/postgresql18.conf +%{_tmpfilesdir}/postgresql18.conf + +%files -n %{pkgname}-server-devel -f devel.lst +%{_bindir}/pg_server_config +%dir %{_datadir}/pgsql +%{_datadir}/pgsql/errcodes.txt +%dir %{_includedir}/pgsql +%{_includedir}/pgsql/server +%{_libdir}/pgsql/pgxs/ +%{_mandir}/man1/pg_server_config.* +%{_mandir}/man3/SPI_* +%{macrosdir}/macros.postgresql + + +%if ! %external_libpq +%files -n %{pkgname}-private-devel +%{_bindir}/pg_config +%{_includedir}/libpq-events.h +%{_includedir}/libpq-fe.h +%{_includedir}/postgres_ext.h +%{_includedir}/pgsql/internal/*.h +%{_includedir}/pgsql/internal/libpq/pqcomm.h + +%{_includedir}/pgsql/internal/libpq/protocol.h + +%{_includedir}/libpq/*.h +%{_libdir}/pkgconfig/*.pc +%{_libdir}/libpq.so +%{_includedir}/pg_config*.h +%endif + + +%files -n %{pkgname}-test-rpm-macros +%{_datadir}/postgresql-setup/postgresql_pkg_tests.sh +%{macrosdir}/macros.postgresql-test + + +%files -n %{pkgname}-static +%{_libdir}/libpgcommon.a +%{_libdir}/libpgport.a +%{_libdir}/libpgcommon_shlib.a +%{_libdir}/libpgport_shlib.a + + +%if %upgrade +%files -n %{pkgname}-upgrade +%{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin +%exclude %{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin/pg_config +%{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib +%exclude %{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pgxs +%exclude %{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pkgconfig +%{_libdir}/pgsql/postgresql-%{prevmajorversion}/share + + +%files -n %{pkgname}-upgrade-devel +%{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin/pg_config +%{_libdir}/pgsql/postgresql-%{prevmajorversion}/include +%{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pkgconfig +%{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pgxs +%{macrosdir}/macros.postgresql-upgrade +%endif + +%if %llvmjit +%files -n %{pkgname}-llvmjit +%defattr(-,root,root) +%{_libdir}/pgsql/bitcode/* +%{_libdir}/pgsql/llvmjit.so +%{_libdir}/pgsql/llvmjit_types.bc +%endif + +%if %plperl +%files -n %{pkgname}-plperl -f plperl.lst +%{_datadir}/pgsql/extension/bool_plperl* +%{_datadir}/pgsql/extension/plperl* +%{_libdir}/pgsql/bool_plperl.so +%{_libdir}/pgsql/plperl.so +%endif + + +%if %pltcl +%files -n %{pkgname}-pltcl -f pltcl.lst +%{_datadir}/pgsql/extension/pltcl* +%{_libdir}/pgsql/pltcl.so +%endif + + +%if %plpython3 +%files -n %{pkgname}-plpython3 -f plpython3.lst +%{_datadir}/pgsql/extension/plpython3* +%{_libdir}/pgsql/plpython3.so +%endif + + +%if %test +%files -n %{pkgname}-test +%attr(-,postgres,postgres) %{_libdir}/pgsql/test +%endif + + +%changelog +* Thu Oct 27 2025 Nikola Davidova - 18.0-1 +- Initial commit on c10s +- Resolves: RHEL-116546 + diff --git a/rpm-pgsql.patch b/rpm-pgsql.patch new file mode 100644 index 0000000..aec64ac --- /dev/null +++ b/rpm-pgsql.patch @@ -0,0 +1,72 @@ +For the RPMs, we want the custom installation directories to end in +/pgsql not /postgresql. This is historical but not worth changing. + +Notice that this patch also makes the appending of /pgsql unconditional. +This is to avoid unexpected behavior if the RPM is built in a working +directory whose path happens to include "postgres" or "pgsql" already. +However, datadir and sysconfdir are already set up in the specfile's +configure call, so we do not have to append anything to them. + + +diff -Naur postgresql-9.0.1.orig/src/Makefile.global.in postgresql-9.0.1/src/Makefile.global.in +--- postgresql-9.0.1.orig/src/Makefile.global.in 2010-10-01 10:25:44.000000000 -0400 ++++ postgresql-9.0.1/src/Makefile.global.in 2010-10-11 11:52:05.224975308 -0400 +@@ -55,8 +55,7 @@ + # Installation directories + # + # These are set by the equivalent --xxxdir configure options. We +-# append "postgresql" to some of them, if the string does not already +-# contain "pgsql" or "postgres", in order to avoid directory clutter. ++# append "pgsql" to some of them, in order to avoid directory clutter. + # + # In a PGXS build, we cannot use the values inserted into Makefile.global + # by configure, since the installation tree may have been relocated. +@@ -74,45 +73,23 @@ + bindir := @bindir@ + + datadir := @datadir@ +-ifeq "$(findstring pgsql, $(datadir))" "" +-ifeq "$(findstring postgres, $(datadir))" "" +-override datadir := $(datadir)/postgresql +-endif +-endif + + sysconfdir := @sysconfdir@ +-ifeq "$(findstring pgsql, $(sysconfdir))" "" +-ifeq "$(findstring postgres, $(sysconfdir))" "" +-override sysconfdir := $(sysconfdir)/postgresql +-endif +-endif + + libdir := @libdir@ + + pkglibdir = $(libdir) +-ifeq "$(findstring pgsql, $(pkglibdir))" "" +-ifeq "$(findstring postgres, $(pkglibdir))" "" +-override pkglibdir := $(pkglibdir)/postgresql +-endif +-endif ++override pkglibdir := $(pkglibdir)/pgsql + + includedir := @includedir@ + + pkgincludedir = $(includedir) +-ifeq "$(findstring pgsql, $(pkgincludedir))" "" +-ifeq "$(findstring postgres, $(pkgincludedir))" "" +-override pkgincludedir := $(pkgincludedir)/postgresql +-endif +-endif ++override pkgincludedir := $(pkgincludedir)/pgsql + + mandir := @mandir@ + + docdir := @docdir@ +-ifeq "$(findstring pgsql, $(docdir))" "" +-ifeq "$(findstring postgres, $(docdir))" "" +-override docdir := $(docdir)/postgresql +-endif +-endif ++override docdir := $(docdir)/pgsql + + htmldir := @htmldir@ + diff --git a/rpminspect.yaml b/rpminspect.yaml new file mode 100644 index 0000000..0647934 --- /dev/null +++ b/rpminspect.yaml @@ -0,0 +1,21 @@ +--- +# Forbidden function symbols found: +# inet_net_ntop +# inet_net_pton +# This is not a problem because the older version is only used for upgrade +# purposes and communicates through unix socket only +badfuncs: + ignore: + - /usr/lib*/pgsql/postgresql-*/bin/postgres + +# Invalid XML for HTML doc is ok +xml: + ignore: + - /usr/share/doc/postgresql-docs/html/*.html + +# Wacky guess on file type that we do not need to care +# Message: MIME type on was text/plain and became text/x-c +types: + ignore: + - /usr/lib64/pgsql/postgresql-*/include/server/port/freebsd.h + - /usr/include/pgsql/server/port/freebsd.h diff --git a/sources b/sources new file mode 100644 index 0000000..b580102 --- /dev/null +++ b/sources @@ -0,0 +1,5 @@ +SHA512 (postgresql-16.10.tar.bz2) = b6de80d522f863b0d9dd8c2bf4f71bea309bd07586859e309a9821e7f6fd5839557dc396351e7b61aebf492bf8c8a053a324f059a1dee621ac1a6d5e8eccea22 +SHA512 (postgresql-setup-8.9.tar.gz) = 118e9ebf858722a38b0e90324bc1b49fc7058cda601ca0a7e78c94e7b95e89d6dbbc46f377626364b068614ced3cde3cb4733973ad2d71bf17892ad773657ef7 +SHA512 (postgresql-18.0.tar.bz2) = d3a2b460465259c461b1e53555f48881986d3103af6f7c654366ada04ab43b61ce22eb3cb078c70afdac22ddfa5bd9ce2928e3edb110f7f029c958340a980f37 +SHA512 (postgresql-16.10.tar.bz2.sha256) = 2489a4a2074c7be5c352153ab899681f0761db5dfce8fe315be19783d91613c033570a2f5f85145e5608550e1636231abbeb96aacaa8a94f463caf0c02af48a1 +SHA512 (postgresql-18.0.tar.bz2.sha256) = f5e2050321f209dbdd02cebc82d62ed241ce5c24adabf7892ea15460eaa846983e852cd4c2b5055dc2752b035e61363eefada108dc877c311160b3a92de791b5