diff --git a/SOURCES/Makefile.regress b/SOURCES/Makefile.regress index 925877c..95bc589 100644 --- a/SOURCES/Makefile.regress +++ b/SOURCES/Makefile.regress @@ -47,7 +47,9 @@ installcheck-parallel: cleandirs 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 + 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... diff --git a/SOURCES/postgresql-11.2-US.pdf b/SOURCES/postgresql-11.2-US.pdf new file mode 100644 index 0000000..be9532f Binary files /dev/null and b/SOURCES/postgresql-11.2-US.pdf differ diff --git a/SOURCES/postgresql-external-libpq.patch b/SOURCES/postgresql-external-libpq.patch new file mode 100644 index 0000000..71dc609 --- /dev/null +++ b/SOURCES/postgresql-external-libpq.patch @@ -0,0 +1,40 @@ +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 9a4a8a3..2bdfb77 100644 +--- a/src/Makefile.global.in ++++ b/src/Makefile.global.in +@@ -513,7 +513,7 @@ endif + + # This macro is for use by libraries linking to libpq. (Because libpgport + # isn't created with the same link flags as libpq, it can't be used.) +-libpq = -L$(libpq_builddir) -lpq ++libpq = -lpq + + # This macro is for use by client executables (not libraries) that use libpq. + # We force clients to pull symbols from the non-shared libraries libpgport +@@ -539,7 +539,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 diff --git a/SOURCES/postgresql-server-pg_config.patch b/SOURCES/postgresql-server-pg_config.patch new file mode 100644 index 0000000..6cde037 --- /dev/null +++ b/SOURCES/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 --git a/src/bin/pg_config/Makefile b/src/bin/pg_config/Makefile +index 02e6f9d..f7c844f 100644 +--- a/src/bin/pg_config/Makefile ++++ b/src/bin/pg_config/Makefile +@@ -11,28 +11,30 @@ + 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 + + OBJS= pg_config.o $(WIN32RES) + +-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 maintainer-clean: +- rm -f pg_config$(X) $(OBJS) ++ rm -f $(PG_CONFIG) $(OBJS) + rm -rf tmp_check + + check: +diff --git a/src/bin/pg_config/nls.mk b/src/bin/pg_config/nls.mk +index 1d41f90..0f34f37 100644 +--- a/src/bin/pg_config/nls.mk ++++ b/src/bin/pg_config/nls.mk +@@ -1,4 +1,4 @@ + # src/bin/pg_config/nls.mk +-CATALOG_NAME = pg_config ++CATALOG_NAME = pg_server_config + AVAIL_LANGUAGES = cs de es fr he it ja ko nb pl pt_BR ro ru sv ta tr vi zh_CN zh_TW + GETTEXT_FILES = pg_config.c ../../common/config_info.c ../../common/exec.c diff --git a/SPECS/postgresql.spec b/SPECS/postgresql.spec index dc71043..0c9e480 100644 --- a/SPECS/postgresql.spec +++ b/SPECS/postgresql.spec @@ -31,13 +31,14 @@ %{!?beta:%global beta 0} -%{!?test:%global test 0} +%{!?test:%global test 1} %{!?upgrade:%global upgrade 1} %{!?plpython:%global plpython 1} %{!?plpython3:%global plpython3 1} %{!?pltcl:%global pltcl 1} %{!?plperl:%global plperl 1} %{!?ssl:%global ssl 1} +%{!?icu:%global icu 1} %{!?kerberos:%global kerberos 1} %{!?ldap:%global ldap 1} %{!?nls:%global nls 1} @@ -46,7 +47,7 @@ %{!?pam:%global pam 1} %{!?sdt:%global sdt 1} %{!?selinux:%global selinux 1} -%{!?runselftest:%global runselftest 0} +%{!?runselftest:%global runselftest 1} # 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. @@ -57,31 +58,30 @@ Summary: PostgreSQL client programs Name: postgresql -%global majorversion 10 -Version: 10.7 -Release: 1%{?dist} +%global majorversion 11 +Version: 11.2 +Release: 3%{?dist} # The PostgreSQL license is very similar to other MIT licenses, but the OSI # recognizes it as an independent license, so we do as well. License: PostgreSQL -Group: Applications/Databases 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 prevversion 9.6.5 -%global prevmajorversion 9.6 +%global prevversion 10.7 +%global prevmajorversion 10 %global prev_prefix %{_libdir}/pgsql/postgresql-%{prevmajorversion} +%global precise_version %{?epoch:%epoch:}%version-%release -%global setup_version 5.1 +%global setup_version 8.4 %global service_name postgresql.service Source0: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2 # The PDF file is generated by generate-pdf.sh, which see for comments -#Source1: postgresql-%{version}-US.pdf -Source1: postgresql-10.0-US.pdf +Source1: postgresql-%{version}-US.pdf # generate-pdf.sh is not used during RPM build, but include for documentation Source2: generate-pdf.sh Source3: https://ftp.postgresql.org/pub/source/v%{prevversion}/postgresql-%{prevversion}.tar.bz2 @@ -105,21 +105,25 @@ Patch1: rpm-pgsql.patch Patch2: postgresql-logging.patch Patch5: postgresql-var-run-socket.patch Patch6: postgresql-man.patch +Patch8: postgresql-external-libpq.patch +Patch9: postgresql-server-pg_config.patch +BuildRequires: gcc BuildRequires: perl(ExtUtils::MakeMaker) glibc-devel bison flex gawk BuildRequires: perl(ExtUtils::Embed), perl-devel %if 0%{?fedora} || 0%{?rhel} > 7 BuildRequires: perl-generators %endif BuildRequires: readline-devel zlib-devel -BuildRequires: systemd util-linux +BuildRequires: systemd systemd-devel util-linux BuildRequires: multilib-rpm-config +BuildRequires: libpq-devel >= %version # postgresql-setup build requires BuildRequires: m4 elinks docbook-utils help2man %if %plpython -BuildRequires: python-devel +BuildRequires: python2-devel %endif %if %plpython3 @@ -166,8 +170,9 @@ BuildRequires: systemtap-sdt-devel BuildRequires: libselinux-devel %endif -# main package requires -libs subpackage -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +%if %icu +BuildRequires: libicu-devel +%endif # https://bugzilla.redhat.com/1464368 %global __provides_exclude_from %{_libdir}/pgsql @@ -182,33 +187,16 @@ over a network connection. The PostgreSQL server can be found in the postgresql-server sub-package. -%package libs -Summary: The shared libraries required for any PostgreSQL clients -Group: Applications/Databases -Provides: libpq.so = %{version}-%{release} -# for /sbin/ldconfig -Requires(post): glibc -Requires(postun): glibc - -%description libs -The postgresql-libs package provides the essential shared libraries for any -PostgreSQL client program or interface. You will need to install this package -to use any other PostgreSQL package or any clients that need to connect to a -PostgreSQL server. - - %package server Summary: The programs needed to create and run a PostgreSQL server -Group: Applications/Databases -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: %{name}%{?_isa} = %precise_version Requires(pre): /usr/sbin/useradd # We require this to be present for %%{_prefix}/lib/tmpfiles.d Requires: systemd # Make sure it's there when scriptlets run, too %{?systemd_requires} # Packages which provide postgresql plugins should build-require -# postgresql-devel and require +# postgresql-server-devel and require # postgresql-server(:MODULE_COMPAT_%%{postgresql_major}). # This will automatically guard against incompatible server & plugin # installation (#1008939, #1007840) @@ -224,10 +212,9 @@ and maintain PostgreSQL databases. %package docs Summary: Extra documentation for PostgreSQL -Group: Applications/Databases -Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: %{name}%{?_isa} = %precise_version # Just for more intuitive documentation installation -Provides: %{name}-doc = %{version}-%{release} +Provides: %{name}-doc = %precise_version %description docs The postgresql-docs package contains some additional documentation for @@ -237,31 +224,35 @@ and source files for the PostgreSQL tutorial. %package contrib Summary: Extension modules distributed with PostgreSQL -Group: Applications/Databases -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: %{name}%{?_isa} = %precise_version %description contrib The postgresql-contrib package contains various extension modules that are included in the PostgreSQL distribution. -%package devel +%package server-devel Summary: PostgreSQL development header files and libraries -Group: Development/Libraries -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +%if %icu +Requires: libicu-devel +%endif -%description devel -The postgresql-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. It also contains the ecpg -Embedded C Postgres preprocessor. You need to install this package if you want -to develop applications which will interact with a PostgreSQL server. +%description server-devel +The postgresql-server-devel package contains the header files and configuration +needed to compile PostgreSQL server extension. + +%package test-rpm-macros +Summary: Convenience RPM macros for build-time testing against PostgreSQL server +Requires: %{name}-server = %precise_version + +%description 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 static Summary: Statically linked PostgreSQL libraries -Requires: %{name}-devel%{?_isa} = %{version}-%{release} +Requires: %{name}-server-devel%{?_isa} = %precise_version %description static Statically linked PostgreSQL libraries that do not have dynamically linked @@ -271,20 +262,18 @@ counterparts. %if %upgrade %package upgrade Summary: Support for upgrading from the previous major release of PostgreSQL -Group: Applications/Databases -Requires: %{name}-server%{?_isa} = %{version}-%{release} -Requires: %{name}-libs%{?_isa} = %{version}-%{release} -Provides: bundled(postgresql-libs) = %prevversion +Requires: %{name}-server%{?_isa} = %precise_version +Provides: bundled(postgresql-server) = %prevversion %description 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 upgrade-devel Summary: Support for build of extensions required for upgrade process -Group: Development/Libraries -Requires: %{name}-upgrade%{?_isa} = %{version}-%{release} +Requires: %{name}-upgrade%{?_isa} = %precise_version %description upgrade-devel The postgresql-devel package contains the header files and libraries @@ -296,8 +285,7 @@ process. %if %plperl %package plperl Summary: The Perl procedural language for PostgreSQL -Group: Applications/Databases -Requires: %{name}-server%{?_isa} = %{version}-%{release} +Requires: %{name}-server%{?_isa} = %precise_version Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) %if %runselftest BuildRequires: perl(Data::Dumper) @@ -309,11 +297,12 @@ which is an extension to the PostgreSQL database server. Install this if you want to write database functions in Perl. %endif + %if %plpython %package plpython Summary: The Python2 procedural language for PostgreSQL -Group: Applications/Databases -Requires: %{name}-server%{?_isa} = %{version}-%{release} +Requires: %{name}-server%{?_isa} = %precise_version +Provides: %{name}-plpython2 = %precise_version %description plpython The postgresql-plpython package contains the PL/Python procedural language, @@ -321,11 +310,11 @@ which is an extension to the PostgreSQL database server. Install this if you want to write database functions in Python 2. %endif + %if %plpython3 %package plpython3 Summary: The Python3 procedural language for PostgreSQL -Group: Applications/Databases -Requires: %{name}-server%{?_isa} = %{version}-%{release} +Requires: %{name}-server%{?_isa} = %precise_version %description plpython3 The postgresql-plpython3 package contains the PL/Python3 procedural language, @@ -333,12 +322,11 @@ 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 pltcl Summary: The Tcl procedural language for PostgreSQL -Group: Applications/Databases -Requires: %{name}-server%{?_isa} = %{version}-%{release} -Requires: tcl-pgtcl +Requires: %{name}-server%{?_isa} = %precise_version %description pltcl The postgresql-pltcl package contains the PL/Tcl procedural language, @@ -346,12 +334,12 @@ which is an extension to the PostgreSQL database server. Install this if you want to write database functions in Tcl. %endif + %if %test %package test Summary: The test suite distributed with PostgreSQL -Group: Applications/Databases -Requires: %{name}-server%{?_isa} = %{version}-%{release} -Requires: %{name}-devel%{?_isa} = %{version}-%{release} +Requires: %{name}-server%{?_isa} = %precise_version +Requires: %{name}-server-devel%{?_isa} = %precise_version %description test The postgresql-test package contains files needed for various tests for the @@ -359,13 +347,22 @@ PostgreSQL database management system, including regression tests and benchmarks. %endif + %prep -( cd %_sourcedir; sha256sum -c %{SOURCE16}; sha256sum -c %{SOURCE17} ) +( + cd "$(dirname "%{SOURCE0}")" + sha256sum -c %{SOURCE16} +%if %upgrade + sha256sum -c %{SOURCE17} +%endif +) %setup -q -a 12 %patch1 -p1 %patch2 -p1 %patch5 -p1 %patch6 -p1 +%patch8 -p1 +%patch9 -p1 # We used to run autoconf here, but there's no longer any real need to, # since Postgres ships with a reasonably modern configure script. @@ -381,8 +378,8 @@ tar xfj %{SOURCE3} # remove .gitignore files to ensure none get into the RPMs (bug #642210) find . -type f -name .gitignore | xargs rm -%build +%build # fail quickly and obviously if user tries to build as root %if %runselftest if [ x"`id -u`" = x0 ]; then @@ -397,8 +394,6 @@ find . -type f -name .gitignore | xargs rm cd postgresql-setup-%{setup_version} -sed -i 's|/etc/redhat-release;|/etc/powerel-release;|' configure - %configure \ pgdocdir=%{_pkgdocdir} \ PGVERSION=%{version} \ @@ -424,122 +419,98 @@ export CFLAGS # distclean and do it again for the "normal" build. Note that the installed # Makefile.global will reflect the python 2 build, which seems appropriate # since that's still considered the default plpython version. -%if %plpython3 - -export PYTHON=/usr/bin/python3 - -# These configure options must match main build -%configure --disable-rpath \ +common_configure_options=' + --disable-rpath %if %beta - --enable-debug \ - --enable-cassert \ + --enable-debug + --enable-cassert %endif %if %plperl - --with-perl \ + --with-perl %endif %if %pltcl - --with-tcl \ - --with-tclconfig=%{_libdir} \ -%endif -%if %plpython3 - --with-python \ + --with-tcl + --with-tclconfig=%_libdir %endif %if %ldap - --with-ldap \ + --with-ldap %endif %if %ssl - --with-openssl \ + --with-openssl %endif %if %pam - --with-pam \ + --with-pam %endif %if %kerberos - --with-krb5 \ - --with-gssapi \ + --with-gssapi %endif %if %uuid - --with-ossp-uuid \ + --with-ossp-uuid %endif %if %xml - --with-libxml \ - --with-libxslt \ + --with-libxml + --with-libxslt %endif %if %nls - --enable-nls \ + --enable-nls %endif %if %sdt - --enable-dtrace \ + --enable-dtrace %endif %if %selinux - --with-selinux \ + --with-selinux +%endif + --with-system-tzdata=%_datadir/zoneinfo + --datadir=%_datadir/pgsql + --with-systemd +%if %icu + --with-icu %endif - --with-system-tzdata=%{_datadir}/zoneinfo \ - --datadir=%{_datadir}/pgsql +' + +%if %plpython3 + +export PYTHON=/usr/bin/python3 + +# These configure options must match main build +%configure $common_configure_options \ + --with-python # Fortunately we don't need to build much except plpython itself. -make %{?_smp_mflags} -C src/pl/plpython all +%global python_subdirs \\\ + src/pl/plpython \\\ + contrib/hstore_plpython \\\ + contrib/jsonb_plpython \\\ + contrib/ltree_plpython + +for dir in %python_subdirs; do + %make_build -C "$dir" all +done + # save built form in a directory that "make distclean" won't touch -cp -a src/pl/plpython src/pl/plpython3 +for dir in %python_subdirs; do + rm -rf "${dir}3" # shouldn't exist, unless --short-circuit + cp -a "$dir" "${dir}3" +done # must also save this version of Makefile.global for later cp src/Makefile.global src/Makefile.global.python3 make distclean -%endif - -unset PYTHON +%endif # %%plpython3 -# Normal (not python3) build begins here +PYTHON=/usr/bin/python2 -%configure --disable-rpath \ -%if %beta - --enable-debug \ - --enable-cassert \ -%endif -%if %plperl - --with-perl \ -%endif -%if %pltcl - --with-tcl \ - --with-tclconfig=%{_libdir} \ -%endif +# Normal (python2) build begins here +%configure $common_configure_options \ %if %plpython - --with-python \ -%endif -%if %ldap - --with-ldap \ -%endif -%if %ssl - --with-openssl \ -%endif -%if %pam - --with-pam \ -%endif -%if %kerberos - --with-krb5 \ - --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 - --with-selinux \ + --with-python %endif - --with-system-tzdata=%_datadir/zoneinfo \ - --datadir=%_datadir/pgsql -make %{?_smp_mflags} world +unset PYTHON + +%make_build world # Have to hack makefile to put correct path into tutorial scripts sed "s|C=\`pwd\`;|C=%{_libdir}/pgsql/tutorial;|" < src/tutorial/Makefile > src/tutorial/GNUmakefile @@ -579,17 +550,25 @@ test_failure=0 mv src/Makefile.global src/Makefile.global.save cp src/Makefile.global.python3 src/Makefile.global touch -r src/Makefile.global.save src/Makefile.global - # because "make check" does "make install" on the whole tree, - # we must temporarily install plpython3 as src/pl/plpython, - # since that is the subdirectory src/pl/Makefile knows about - mv src/pl/plpython src/pl/plpython2 - mv src/pl/plpython3 src/pl/plpython - run_testsuite "src/pl/plpython" + for dir in %python_subdirs; do + # because "make check" does "make install" on the whole tree, + # we must temporarily install *plpython3 dir as *plpython, + # since that is the subdirectory src/pl/Makefile knows about + mv "$dir" "${dir}2" + mv "${dir}3" "$dir" + done + + for dir in %python_subdirs; do + run_testsuite "$dir" + done + + for dir in %python_subdirs; do + # and clean up our mess + mv "$dir" "${dir}3" + mv "${dir}2" "${dir}" + done - # and clean up our mess - mv src/pl/plpython src/pl/plpython3 - mv src/pl/plpython2 src/pl/plpython mv -f src/Makefile.global.save src/Makefile.global %endif run_testsuite "contrib" @@ -608,10 +587,21 @@ test "$test_failure" -eq 0 # 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! Also, note we intentionally do not use %%configure - # here, because we *don't* want its ideas about installation paths. + # 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 + PYTHON="${PYTHON-/usr/bin/python2}" \ CFLAGS="$CFLAGS -fno-aggressive-loop-optimizations" ./configure \ --build=%{_build} \ --host=%{_host} \ @@ -621,22 +611,54 @@ test "$test_failure" -eq 0 --enable-debug \ --enable-cassert \ %endif - --with-system-tzdata=/usr/share/zoneinfo +%if %icu + --with-icu \ +%endif +%if %plperl + --with-perl \ +%endif +%if %pltcl + --with-tcl \ +%endif + --with-tclconfig=%_libdir \ + --with-system-tzdata=/usr/share/zoneinfo \ + "$@" +} - make %{?_smp_mflags} all +%if %plpython3 + export PYTHON=/usr/bin/python3 + upgrade_configure --with-python + for dir in %python_subdirs; do + # Previous version doesn't necessarily have this. + test -d "$dir" || continue + %make_build -C "$dir" all + + # save aside the only one file which we are interested here + cp "$dir"/*plpython3.so ./ + done + unset PYTHON + make distclean +%endif - popd + upgrade_configure \ +%if %plpython + --with-python %endif -%install + make %{?_smp_mflags} all + make -C contrib %{?_smp_mflags} all + popd +%endif # %%upgrade + +%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 ./ +mv $RPM_BUILD_ROOT/%{_pkgdocdir}/README.rpm-dist ./ cat > $RPM_BUILD_ROOT%{_sysconfdir}/postgresql-setup/upgrade/postgresql.conf < $RPM_BUILD_ROOT%macrosdir/macros.%name-upgrade %%postgresql_upgrade_prefix %prev_prefix @@ -746,7 +785,7 @@ EOF # 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, + # 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 ln -sf ../../pgxs/src/test/regress/pg_regress $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/pg_regress @@ -765,7 +804,7 @@ 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}/lib{ecpg,pq,ecpg_compat,pgfeutils,pgtypes}.a +rm $RPM_BUILD_ROOT%{_libdir}/libpgfeutils.a %if !%plperl rm -f $RPM_BUILD_ROOT%{_bindir}/pgsql/hstore_plperl.so @@ -775,34 +814,24 @@ rm -f $RPM_BUILD_ROOT%{_bindir}/pgsql/hstore_plperl.so rm -f $RPM_BUILD_ROOT%{_bindir}/pgsql/hstore_plpython2.so %endif -# initialize file lists -cp /dev/null main.lst -cp /dev/null libs.lst -cp /dev/null server.lst -cp /dev/null contrib.lst -cp /dev/null devel.lst -cp /dev/null plperl.lst -cp /dev/null pltcl.lst -cp /dev/null plpython.lst -cp /dev/null plpython3.lst - %if %nls find_lang_bins () { lstfile=$1 ; shift + cp /dev/null "$lstfile" for binary; do %find_lang "$binary"-%{majorversion} - cat "$binary"-%{majorversion}.lang >>$lstfile + cat "$binary"-%{majorversion}.lang >>"$lstfile" done } -find_lang_bins devel.lst ecpg -find_lang_bins libs.lst ecpglib6 libpq5 +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 + initdb pg_basebackup pg_controldata pg_ctl pg_resetwal pg_rewind plpgsql \ + postgres pg_verify_checksums find_lang_bins contrib.lst \ pg_archivecleanup pg_test_fsync pg_test_timing pg_waldump -find_lang_bins main.lst \ - pg_config pg_dump pg_upgrade pgscripts psql +find_lang_bins main.lst \ + pg_dump pg_upgrade pgscripts psql %if %plperl find_lang_bins plperl.lst plperl %endif @@ -818,9 +847,6 @@ find_lang_bins pltcl.lst pltcl %endif %endif -%post libs -p /sbin/ldconfig -%postun libs -p /sbin/ldconfig - %pre server /usr/sbin/groupadd -g 26 -o -r postgres >/dev/null 2>&1 || : /usr/sbin/useradd -M -N -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \ @@ -843,15 +869,11 @@ find_lang_bins pltcl.lst pltcl make -C postgresql-setup-%{setup_version} check %endif - -%clean - -# FILES section. - +# FILES sections. %files -f main.lst %doc doc/KNOWN_BUGS doc/MISSING_FEATURES doc/TODO %doc COPYRIGHT README HISTORY doc/bug.template -#%doc README.rpm-dist +%doc README.rpm-dist %{_bindir}/clusterdb %{_bindir}/createdb %{_bindir}/createuser @@ -880,11 +902,13 @@ make -C postgresql-setup-%{setup_version} check %{_mandir}/man1/vacuumdb.* %{_mandir}/man7/* + %files docs %doc *-US.pdf %doc doc/html %{_libdir}/pgsql/tutorial/ + %files contrib -f contrib.lst %doc contrib/spi/*.example %{_bindir}/oid2name @@ -901,7 +925,6 @@ make -C postgresql-setup-%{setup_version} check %{_datadir}/pgsql/extension/bloom* %{_datadir}/pgsql/extension/btree_gin* %{_datadir}/pgsql/extension/btree_gist* -%{_datadir}/pgsql/extension/chkpass* %{_datadir}/pgsql/extension/citext* %{_datadir}/pgsql/extension/cube* %{_datadir}/pgsql/extension/dblink* @@ -915,6 +938,16 @@ make -C postgresql-setup-%{setup_version} check %{_datadir}/pgsql/extension/intagg* %{_datadir}/pgsql/extension/intarray* %{_datadir}/pgsql/extension/isn* +%if %{plperl} +%{_datadir}/pgsql/extension/jsonb_plperl* +%endif +%if %{plpython} +%{_datadir}/pgsql/extension/jsonb_plpythonu* +%{_datadir}/pgsql/extension/jsonb_plpython2u* +%endif +%if %{plpython3} +%{_datadir}/pgsql/extension/jsonb_plpython3u* +%endif %{_datadir}/pgsql/extension/lo* %{_datadir}/pgsql/extension/ltree* %{_datadir}/pgsql/extension/moddatetime* @@ -946,7 +979,6 @@ make -C postgresql-setup-%{setup_version} check %{_libdir}/pgsql/bloom.so %{_libdir}/pgsql/btree_gin.so %{_libdir}/pgsql/btree_gist.so -%{_libdir}/pgsql/chkpass.so %{_libdir}/pgsql/citext.so %{_libdir}/pgsql/cube.so %{_libdir}/pgsql/dblink.so @@ -962,13 +994,28 @@ make -C postgresql-setup-%{setup_version} check %if %plpython %{_libdir}/pgsql/hstore_plpython2.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 %plpython +%{_libdir}/pgsql/jsonb_plpython2.so +%endif +%if %plpython3 +%{_libdir}/pgsql/jsonb_plpython3.so +%endif %{_libdir}/pgsql/lo.so %{_libdir}/pgsql/ltree.so %if %plpython %{_libdir}/pgsql/ltree_plpython2.so %endif +%if %plpython3 +%{_libdir}/pgsql/ltree_plpython3.so +%endif %{_libdir}/pgsql/moddatetime.so %{_libdir}/pgsql/pageinspect.so %{_libdir}/pgsql/passwordcheck.so @@ -1017,14 +1064,6 @@ make -C postgresql-setup-%{setup_version} check %{_libdir}/pgsql/pgxml.so %endif -%files libs -f libs.lst -%doc COPYRIGHT -%dir %{_libdir}/pgsql -%{_libdir}/libecpg.so.* -%{_libdir}/libecpg_compat.so.* -%{_libdir}/libpgtypes.so.* -%{_libdir}/libpq.so.* - %files server -f server.lst %{_bindir}/initdb %{_bindir}/pg_basebackup @@ -1034,6 +1073,7 @@ make -C postgresql-setup-%{setup_version} check %{_bindir}/pg_recvlogical %{_bindir}/pg_resetwal %{_bindir}/pg_rewind +%{_bindir}/pg_verify_checksums %{_bindir}/postgres %{_bindir}/postgresql-setup %{_bindir}/postmaster @@ -1054,7 +1094,6 @@ make -C postgresql-setup-%{setup_version} check %{_datadir}/pgsql/tsearch_data/ %dir %{_datadir}/postgresql-setup %{_datadir}/postgresql-setup/library.sh -%{_datadir}/postgresql-setup/postgresql_pkg_tests.sh %{_libdir}/pgsql/*_and_*.so %{_libdir}/pgsql/dict_snowball.so %{_libdir}/pgsql/euc2004_sjis2004.so @@ -1065,7 +1104,6 @@ make -C postgresql-setup-%{setup_version} check %dir %{_libexecdir}/initscripts/legacy-actions/postgresql %{_libexecdir}/initscripts/legacy-actions/postgresql/* %{_libexecdir}/postgresql-check-db-dir -%{_libexecdir}/postgresql-ctl %dir %{_sysconfdir}/postgresql-setup %dir %{_sysconfdir}/postgresql-setup/upgrade %config %{_sysconfdir}/postgresql-setup/upgrade/*.conf @@ -1076,9 +1114,12 @@ make -C postgresql-setup-%{setup_version} check %{_mandir}/man1/pg_receivewal.* %{_mandir}/man1/pg_resetwal.* %{_mandir}/man1/pg_rewind.* +%{_mandir}/man1/pg_verify_checksums.* %{_mandir}/man1/postgres.* +%{_mandir}/man1/postgresql-new-systemd-unit.* %{_mandir}/man1/postgresql-setup.* %{_mandir}/man1/postmaster.* +%{_sbindir}/postgresql-new-systemd-unit %{_tmpfilesdir}/postgresql.conf %{_unitdir}/*postgresql*.service %attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql @@ -1091,25 +1132,28 @@ make -C postgresql-setup-%{setup_version} check %endif -%files devel -f devel.lst -%{_bindir}/ecpg -%{_bindir}/pg_config -%{_includedir}/* -%{_libdir}/libecpg.so -%{_libdir}/libecpg_compat.so -%{_libdir}/libpgtypes.so -%{_libdir}/libpq.so +%files 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/ -%{_libdir}/pkgconfig/*.pc -%{_mandir}/man1/ecpg.* -%{_mandir}/man1/pg_config.* +%{_mandir}/man1/pg_server_config.* %{_mandir}/man3/SPI_* %{macrosdir}/macros.%name + +%files test-rpm-macros +%{_datadir}/postgresql-setup/postgresql_pkg_tests.sh +%{macrosdir}/macros.%name-test + + %files static %{_libdir}/libpgcommon.a %{_libdir}/libpgport.a + %if %upgrade %files upgrade %{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin @@ -1119,6 +1163,7 @@ make -C postgresql-setup-%{setup_version} check %exclude %{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pkgconfig %{_libdir}/pgsql/postgresql-%{prevmajorversion}/share + %files upgrade-devel %{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin/pg_config %{_libdir}/pgsql/postgresql-%{prevmajorversion}/include @@ -1127,18 +1172,21 @@ make -C postgresql-setup-%{setup_version} check %{macrosdir}/macros.%name-upgrade %endif + %if %plperl %files plperl -f plperl.lst %{_datadir}/pgsql/extension/plperl* %{_libdir}/pgsql/plperl.so %endif + %if %pltcl %files pltcl -f pltcl.lst %{_datadir}/pgsql/extension/pltcl* %{_libdir}/pgsql/pltcl.so %endif + %if %plpython %files plpython -f plpython.lst %{_datadir}/pgsql/extension/plpython2* @@ -1146,18 +1194,143 @@ make -C postgresql-setup-%{setup_version} check %{_libdir}/pgsql/plpython2.so %endif + %if %plpython3 %files plpython3 -f plpython3.lst %{_datadir}/pgsql/extension/plpython3* %{_libdir}/pgsql/plpython3.so %endif + %if %test %files test %attr(-,postgres,postgres) %{_libdir}/pgsql/test %endif + %changelog +* Tue Mar 05 2019 Pavel Raiskup - 11.2-3 +- update postgresql-setup to 8.4 (related to rhbz#1668301) + +* Sun Feb 17 2019 Igor Gnatenko - 11.2-2 +- Rebuild for readline 8.0 + +* Thu Feb 14 2019 Patrik Novotný - 11.2-1 +- Rebase to upstream release 11.2 + +* Thu Feb 14 2019 Pavel Raiskup - 11.1-5 +- protect against building server against older libpq library + +* Sat Feb 02 2019 Fedora Release Engineering - 11.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Jan 22 2019 Pavel Raiskup - 11.1-3 +- build with ICU support, to provide more opt-in collations + +* Mon Jan 14 2019 Björn Esser - 11.1-2 +- Rebuilt for libcrypt.so.2 (#1666033) + +* Wed Nov 07 2018 Patrik Novotný - 11.1-1 +- Rebase to upstream release 11.1 + https://www.postgresql.org/docs/11/release-11-1.html + +* Fri Oct 26 2018 Pavel Raiskup - 11.0-2 +- build also contrib *plpython3 modules + +* Tue Oct 16 2018 Pavel Raiskup - 11.0-1 +- new upstream release, per release notes: + https://www.postgresql.org/docs/11/static/release-11.html + +* Wed Sep 05 2018 Pavel Raiskup - 10.5-4 +- build without postgresql-libs; libraries moved to libpq and libecpg + +* Mon Aug 27 2018 Pavel Raiskup - 10.5-3 +- devel subpackage provides postgresql-server-devel and libecpg-devel + (first step for rhbz#1618698) + +* Mon Aug 27 2018 Pavel Raiskup - 10.5-2 +- packaging cleanup +- devel subpackage to provide libpq-devel (first step for rhbz#1618698) + +* Wed Aug 08 2018 Pavel Raiskup - 10.5-1 +- update to 10.5 per release notes: + https://www.postgresql.org/docs/10/static/release-10-5.html + +* Thu Aug 02 2018 Pavel Raiskup - 10.4-8 +- new postgresql-setup, the %%postgresql_tests* macros now start + the build-time server on random port number + +* Fri Jul 13 2018 Fedora Release Engineering - 10.4-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Thu Jul 12 2018 Pavel Raiskup - 10.4-6 +- drop ppc64 patch, gcc is already fixed (rhbz#1544349) +- move pg_config*.mo files into devel subpackage + +* Mon Jul 09 2018 Pavel Raiskup - 10.4-5 +- re-enable -O3 for 64bit PPC boxes +- explicitly set PYTHON=python2, /bin/python doesn't exist fc29+ + +* Tue Jul 03 2018 Petr Pisar - 10.4-4 +- Perl 5.28 rebuild + +* Wed Jun 27 2018 Jitka Plesnikova - 10.4-3 +- Perl 5.28 rebuild + +* Tue Jun 19 2018 Miro Hrončok - 10.4-2 +- Rebuilt for Python 3.7 + +* Wed May 09 2018 Pavel Raiskup - 10.4-1 +- update to 10.4 per release notes: + https://www.postgresql.org/docs/10/static/release-10-4.html + +* Thu Apr 26 2018 Pavel Raiskup - 10.3-5 +- pltcl: drop tcl-pltcl dependency (rhbz#1571181) + +* Thu Apr 19 2018 Pavel Raiskup - 10.3-4 +- upgrade: package plpython*.so modules + +* Mon Apr 16 2018 Pavel Raiskup - 10.3-3 +- upgrade: package plperl.so and pltcl.so +- upgrade: package contrib modules +- upgrade: drop dynamic libraries + +* Fri Apr 13 2018 Pavel Raiskup - 10.3-2 +- define %%precise_version helper macro +- drop explicit libpq.so provide from *-libs +- update postgresql-setup tarball +- add postgresql-test-rpm-macros package + +* Thu Mar 01 2018 Pavel Raiskup - 10.3-1 +- update to 10.3 per release notes: + https://www.postgresql.org/docs/10/static/release-10-3.html + +* Thu Feb 08 2018 Petr Kubat - 10.2-1 +- update to 10.2 per release notes: + https://www.postgresql.org/docs/10/static/release-10-2.html + +* Sat Jan 20 2018 Björn Esser - 10.1-5 +- Rebuilt for switch to libxcrypt + +* Tue Dec 19 2017 Pavel Raiskup - 10.1-4 +- configure with --with-systemd (rhbz#1414314) +- disable startup timeout of PostgreSQL service (rhbz#1525477) + +* Wed Dec 13 2017 Pavel Raiskup - 10.1-3 +- unify %%configure options for python2/python3 configure +- drop --with-krb5 option, not supported since PostgreSQL 9.4 +- python packaging - requires/provides s/python/python2/ + +* Tue Nov 14 2017 Pavel Raiskup - 10.1-2 +- postgresql-setup v7.0 + +* Wed Nov 08 2017 Pavel Raiskup - 10.1-1 +- update to 10.1 per release notes: + https://www.postgresql.org/docs/10/static/release-10-1.html + +* Mon Nov 06 2017 Pavel Raiskup - 10.0-4 +- rebase to new postgresql-setup 6.0 version, to fix CVE-2017-15097 + * Thu Oct 12 2017 Pavel Raiskup - 10.0-3 - confess that we bundle setup scripts and previous version of ourseleves - provide %%postgresql_upgrade_prefix macro @@ -1410,8 +1583,8 @@ make -C postgresql-setup-%{setup_version} check http://www.postgresql.org/docs/9.3/static/release-9-3-4.html * Thu Mar 13 2014 Jozef Mlich - 9.3.3-2 -- Fix WAL replay of locking an updated tuple - kudos to Alvaro Herrera +- Fix WAL replay of locking an updated tuple + kudos to Alvaro Herrera * Thu Feb 20 2014 Jozef Mlich - 9.3.3-1 - update to 9.3.3 minor version per release notes: @@ -2201,5 +2374,5 @@ Resolves: #161470 - Default to compiling libpq and ECPG as fully thread-safe - 7.4 Origin. See previous spec files for previous history. Adapted -- from Red Hat and PGDG's 7.3.4 RPM, directly descended from +- from Red Hat and PGDG's 7.3.4 RPM, directly descended from - postgresql-7.3.4-2 as shipped in Fedora Core 1.