diff --git a/0000-rpm-pgsql.patch b/0000-rpm-pgsql.patch deleted file mode 100644 index aec64ac7aec751cdf589749c90d626ca5ce27c28..0000000000000000000000000000000000000000 --- a/0000-rpm-pgsql.patch +++ /dev/null @@ -1,72 +0,0 @@ -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/0001-postgresql-logging.patch b/0001-postgresql-logging.patch deleted file mode 100644 index 76ff7b8c75cb11ff33fb55ba25891e738a555b5e..0000000000000000000000000000000000000000 --- a/0001-postgresql-logging.patch +++ /dev/null @@ -1,41 +0,0 @@ -Default to stderr-based logging with a week's worth of daily logfiles. - - -diff -Naur postgresql-9.1rc1.orig/src/backend/utils/misc/postgresql.conf.sample postgresql-9.1rc1/src/backend/utils/misc/postgresql.conf.sample ---- postgresql-9.1rc1.orig/src/backend/utils/misc/postgresql.conf.sample 2011-08-18 17:23:13.000000000 -0400 -+++ postgresql-9.1rc1/src/backend/utils/misc/postgresql.conf.sample 2011-08-18 18:39:39.697526799 -0400 -@@ -279,7 +279,7 @@ - # requires logging_collector to be on. - - # This is used when logging to stderr: --#logging_collector = off # Enable capturing of stderr and csvlog -+logging_collector = on # Enable capturing of stderr and csvlog - # into log files. Required to be on for - # csvlogs. - # (change requires restart) -@@ -355,11 +355,11 @@ - # 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_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 -@@ -367,9 +367,9 @@ - # or size-driven rotation. Default is - # off, meaning append to existing files - # in all cases. --#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 -+log_rotation_size = 0 # Automatic rotation of logfiles will - # happen after that much log output. - # 0 disables. - diff --git a/0002-postgresql-var-run-socket.patch b/0002-postgresql-var-run-socket.patch deleted file mode 100644 index 8e3b19304cbf5e1ee243ad98c3285158298151f5..0000000000000000000000000000000000000000 --- a/0002-postgresql-var-run-socket.patch +++ /dev/null @@ -1,53 +0,0 @@ -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 --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c -index 9481f2d..75532c7 100644 ---- a/src/backend/utils/misc/guc.c -+++ b/src/backend/utils/misc/guc.c -@@ -3196,7 +3196,7 @@ static struct config_string ConfigureNamesString[] = - }, - &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 feeff9e..3e3d784 100644 ---- a/src/bin/initdb/initdb.c -+++ b/src/bin/initdb/initdb.c -@@ -1234,7 +1234,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 e278fa0..9ee15d4 100644 ---- a/src/include/pg_config_manual.h -+++ b/src/include/pg_config_manual.h -@@ -169,7 +169,7 @@ - * here's where to twiddle it. You can also override this at runtime - * with the postmaster's -k switch. - */ --#define DEFAULT_PGSOCKET_DIR "/tmp" -+#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql" - - /* - * This is the default event source for Windows event log. diff --git a/0003-postgresql-man.patch b/0003-postgresql-man.patch deleted file mode 100644 index 8d3afe3838cb71cf3582e3b40c03fe883cd8a7b8..0000000000000000000000000000000000000000 --- a/0003-postgresql-man.patch +++ /dev/null @@ -1,49 +0,0 @@ -PostgreSQL ecpg/initdb manual page fixes - -This was generated based on automatic Red Hat manual page scan (private -RHBZ#948933). - -diff -up ./doc/src/sgml/man1/ecpg.1.man948933 ./doc/src/sgml/man1/ecpg.1 ---- ./doc/src/sgml/man1/ecpg.1.man948933 2014-12-16 02:13:15.000000000 +0100 -+++ ./doc/src/sgml/man1/ecpg.1 2014-12-23 11:26:37.883644047 +0100 -@@ -80,6 +80,11 @@ INFORMIX_SE\&. - 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\-i\fR - .RS 4 - Parse system include files as well\&. -@@ -128,6 +133,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 ./doc/src/sgml/man1/initdb.1.man948933 ./doc/src/sgml/man1/initdb.1 ---- ./doc/src/sgml/man1/initdb.1.man948933 2014-12-16 02:13:21.000000000 +0100 -+++ ./doc/src/sgml/man1/initdb.1 2014-12-23 11:26:37.883644047 +0100 -@@ -281,6 +281,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/Makefile.regress b/Makefile.regress deleted file mode 100644 index 925877c756d998925e174a7b93c609ff5978fde7..0000000000000000000000000000000000000000 --- a/Makefile.regress +++ /dev/null @@ -1,67 +0,0 @@ -# -# 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 - [ -x /usr/bin/chcon ] && /usr/bin/chcon -u system_u -r object_r -t postgresql_db_t testtablespace results - -# 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/generate-pdf.sh b/generate-pdf.sh deleted file mode 100755 index e0ed00880e882ca6de9c3e85242e2ac115e67090..0000000000000000000000000000000000000000 --- a/generate-pdf.sh +++ /dev/null @@ -1,58 +0,0 @@ -#! /bin/sh - -# This script builds the PDF version of the PostgreSQL documentation. -# -# In principle we could do this as part of the RPM build, but there are -# good reasons not to: -# 1. The build would take longer and have a larger BuildRequires footprint. -# 2. The generated PDF has timestamps in it, which would inevitably result -# in multilib conflicts due to slightly different timestamps. -# So instead, we run this manually when rebasing to a new upstream release, -# and treat the resulting PDF as a separate Source file. -# -# You will need to have the docbook packages installed to run this. -# Expect it to take about 20 minutes and use about 160MB of disk. - -set -e - -# Pass package version (e.g., 9.1.2) as argument -VERSION=$1 - -test -z "$VERSION" && VERSION=`awk '/^Version:/ { print $2; }' postgresql.spec` - -TARGETFILE=postgresql-$VERSION-US.pdf -test -f "$TARGETFILE" && echo "$TARGETFILE exists" && exit 1 - -echo Building $TARGETFILE ... - -# Unpack postgresql - -rm -rf postgresql-$VERSION - -tar xfj postgresql-$VERSION.tar.bz2 - -cd postgresql-$VERSION - -# Apply any patches that affect the PDF documentation - -# patch -p1 < ../xxx.patch - -# Configure ... - -./configure >/dev/null - -# Build the PDF docs - -cd doc/src/sgml - -make postgres-US.pdf >make.log - -mv -f postgres-US.pdf ../../../../$TARGETFILE - -# Clean up - -cd ../../../.. - -rm -rf postgresql-$VERSION - -exit 0 diff --git a/postgresql-10.5-US.pdf b/postgresql-10.5-US.pdf deleted file mode 100644 index 21f0ea266bbd34c878e7e44ffb41117e7e8e70d8..0000000000000000000000000000000000000000 Binary files a/postgresql-10.5-US.pdf and /dev/null differ diff --git a/postgresql-bashprofile b/postgresql-bashprofile deleted file mode 100644 index 1cd70d33a794b2e903b1196f810c5bcd85a331d9..0000000000000000000000000000000000000000 --- a/postgresql-bashprofile +++ /dev/null @@ -1,4 +0,0 @@ -[ -f /etc/profile ] && source /etc/profile - -PGDATA=/var/lib/pgsql/data -export PGDATA diff --git a/postgresql.pam b/postgresql.pam deleted file mode 100644 index 1d785946d3fe6a7a77dbd83de624701afe94f06a..0000000000000000000000000000000000000000 --- a/postgresql.pam +++ /dev/null @@ -1,3 +0,0 @@ -#%PAM-1.0 -auth include password-auth -account include password-auth diff --git a/postgresql.spec b/postgresql.spec index a62065604608c7b78b4040ef42a550520ea761b5..1d7b26e6c6ed86fa1067036311fb5841e342eec7 100644 --- a/postgresql.spec +++ b/postgresql.spec @@ -4,26 +4,15 @@ Name: postgresql Version: 10.5 -Release: 7 +Release: 8 Summary: PostgreSQL client programs License: PostgreSQL -Url: http://www.postgresql.org/ +URL: http://www.postgresql.org/ Source0: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2 -Source1: postgresql-%{version}-US.pdf -Source2: generate-pdf.sh -Source3: https://ftp.postgresql.org/pub/source/v9.6.10/postgresql-9.6.10.tar.bz2 -Source4: Makefile.regress -Source5: postgresql.tmpfiles.d -Source6: postgresql.pam -Source7: postgresql-bashprofile -Source8: https://github.com/devexp-db/postgresql-setup/releases/download/v8.2/postgresql-setup-8.2.tar.gz -Source9: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2.sha256 -Source10: https://ftp.postgresql.org/pub/source/v9.6.10/postgresql-9.6.10.tar.bz2.sha256 - -Patch0000: 0000-rpm-pgsql.patch -Patch0001: 0001-postgresql-logging.patch -Patch0002: 0002-postgresql-var-run-socket.patch -Patch0003: 0003-postgresql-man.patch +Source1: https://ftp.postgresql.org/pub/source/v9.6.10/postgresql-9.6.10.tar.bz2 +Source2: https://github.com/devexp-db/postgresql-setup/releases/download/v8.2/postgresql-setup-8.2.tar.gz +Source3: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2.sha256 +Source4: https://ftp.postgresql.org/pub/source/v9.6.10/postgresql-9.6.10.tar.bz2.sha256 Patch6000: 6000-CVE-2019-10164-1.patch Patch6001: 6001-CVE-2019-10164-2.patch @@ -179,22 +168,12 @@ PostgreSQL database management system, including regression tests and benchmarks %prep ( cd "$(dirname "%{SOURCE0}")" - sha256sum -c %{SOURCE9} - sha256sum -c %{SOURCE10} + sha256sum -c %{SOURCE3} + sha256sum -c %{SOURCE4} ) -%setup -q -a 8 -%patch0000 -p1 -%patch0001 -p1 -%patch0002 -p1 -%patch0003 -p1 - -%patch6000 -p1 -%patch6001 -p1 -%patch6002 -p1 -%patch6003 -p1 - -cp -p %{SOURCE1} . -tar xfj %{SOURCE3} +%autosetup -a 8 -p1 + +tar xfj %{SOURCE1} find . -type f -name .gitignore | xargs rm %build @@ -348,19 +327,11 @@ done install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/pgsql/tutorial cp -p src/tutorial/* $RPM_BUILD_ROOT%{_libdir}/pgsql/tutorial -install -d $RPM_BUILD_ROOT/etc/pam.d -install -m 644 %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/postgresql - install -d -m 755 $RPM_BUILD_ROOT%{?_localstatedir}/run/postgresql -install -d $RPM_BUILD_ROOT%{_tmpfilesdir} -install -m 0644 %{SOURCE5} $RPM_BUILD_ROOT%{_tmpfilesdir}/postgresql.conf - install -d -m 700 $RPM_BUILD_ROOT%{?_localstatedir}/lib/pgsql/data install -d -m 700 $RPM_BUILD_ROOT%{?_localstatedir}/lib/pgsql/backups -install -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{?_localstatedir}/lib/pgsql/.bash_profile - pushd postgresql-9.6.10 %make_install %make_install -C contrib @@ -389,9 +360,6 @@ 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 rm -rf doc/html @@ -503,18 +471,15 @@ make -C postgresql-setup-8.2 check %{_libexecdir}/initscripts/legacy-actions/postgresql/* %{_libexecdir}/postgresql-check-db-dir %{_sbindir}/postgresql-new-systemd-unit -%{_tmpfilesdir}/postgresql.conf %{_unitdir}/*postgresql*.service %dir %{_datadir}/pgsql/{extension,contrib} %dir %{_datadir}/postgresql-setup %dir %{_libexecdir}/initscripts/legacy-actions/postgresql %dir %{_sysconfdir}/postgresql-setup/upgrade -%attr(644,postgres,postgres) %config(noreplace) %{?_localstatedir}/lib/pgsql/.bash_profile %attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql %attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql/backups %attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql/data %attr(755,postgres,postgres) %dir %{?_localstatedir}/run/postgresql -%config(noreplace) /etc/pam.d/postgresql %config %{_sysconfdir}/postgresql-setup/upgrade/*.conf @@ -569,6 +534,12 @@ make -C postgresql-setup-8.2 check %attr(-,postgres,postgres) %{_libdir}/pgsql/test %changelog +* Tue Jan 14 2020 openEuler Buildteam - 10.5-8 +- Type:enhancement +- ID:NA +- SUG:restart +- DESC: remove useless files + * Tue Dec 24 2019 fengbing - 10.5-7 - Type:cves - ID:CVE-2019-10208 CVE-2018-16850 diff --git a/postgresql.tmpfiles.d b/postgresql.tmpfiles.d deleted file mode 100644 index d8d960d75586991fa6d68b95d5c0a49c43e0d090..0000000000000000000000000000000000000000 --- a/postgresql.tmpfiles.d +++ /dev/null @@ -1 +0,0 @@ -d /var/run/postgresql 0755 postgres postgres -