93b8d7
# This is the PostgreSQL Global Development Group Official RPMset spec file,
93b8d7
# or a derivative thereof.
93b8d7
# Copyright 2003-2009 Lamar Owen <lowen@pari.edu> <lamar.owen@wgcr.org>
93b8d7
# and others listed.                 ** vi: ts=4 sw=4 noexpandtab nosmarttab
93b8d7
93b8d7
# Major Contributors:
93b8d7
# ---------------
93b8d7
# Lamar Owen
93b8d7
# Trond Eivind Glomsrd <teg@redhat.com>
93b8d7
# Thomas Lockhart
93b8d7
# Reinhard Max
93b8d7
# Karl DeBisschop
93b8d7
# Peter Eisentraut
93b8d7
# Joe Conway
93b8d7
# Andrew Overholt
93b8d7
# David Jee
93b8d7
# Kaj J. Niemi
93b8d7
# Sander Steffann
93b8d7
# Tom Lane
93b8d7
# and others in the Changelog....
93b8d7
93b8d7
# This spec file and ancillary files are licensed in accordance with
93b8d7
# The PostgreSQL license.
93b8d7
93b8d7
# In this file you can find the default build package list macros.
93b8d7
# These can be overridden by defining on the rpm command line:
93b8d7
# rpm --define 'packagename 1' .... to force the package to build.
93b8d7
# rpm --define 'packagename 0' .... to force the package NOT to build.
93b8d7
# The base package, the libs package, the devel package, and the server package
93b8d7
# always get built.
93b8d7
93b8d7
%{!?beta:%global beta 0}
93b8d7
93b8d7
%{!?test:%global test 1}
93b8d7
# Disable temporarily to be able to build the package
93b8d7
# tracked in RHBZ#1940964
93b8d7
%{!?llvmjit:%global llvmjit 0}
93b8d7
%{!?external_libpq:%global external_libpq 0}
93b8d7
%{!?upgrade:%global upgrade 1}
93b8d7
%{!?plpython3:%global plpython3 1}
93b8d7
%{!?pltcl:%global pltcl 1}
93b8d7
%{!?plperl:%global plperl 1}
93b8d7
%{!?ssl:%global ssl 1}
93b8d7
%{!?icu:%global icu 1}
93b8d7
%{!?kerberos:%global kerberos 1}
93b8d7
%{!?ldap:%global ldap 1}
93b8d7
%{!?nls:%global nls 1}
93b8d7
%{!?uuid:%global uuid 1}
93b8d7
%{!?xml:%global xml 1}
93b8d7
%{!?pam:%global pam 1}
93b8d7
%{!?sdt:%global sdt 1}
93b8d7
%{!?selinux:%global selinux 1}
93b8d7
%{!?runselftest:%global runselftest 1}
93b8d7
93b8d7
# By default, patch(1) creates backup files when chunks apply with offsets.
93b8d7
# Turn that off to ensure such files don't get included in RPMs.
93b8d7
%global _default_patch_flags --no-backup-if-mismatch
93b8d7
93b8d7
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_of_Additional_RPM_Macros
93b8d7
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
93b8d7
93b8d7
Summary: PostgreSQL client programs
93b8d7
Name: postgresql
93b8d7
%global majorversion 15
93b8d7
Version: %{majorversion}.2
93b8d7
Release: 1%{?dist}
93b8d7
93b8d7
# The PostgreSQL license is very similar to other MIT licenses, but the OSI
93b8d7
# recognizes it as an independent license, so we do as well.
93b8d7
License: PostgreSQL
93b8d7
Url: http://www.postgresql.org/
93b8d7
93b8d7
# This SRPM includes a copy of the previous major release, which is needed for
93b8d7
# in-place upgrade of an old database.  In most cases it will not be critical
93b8d7
# that this be kept up with the latest minor release of the previous series;
93b8d7
# but update when bugs affecting pg_dump output are fixed.
93b8d7
%global prevmajorversion 13
93b8d7
%global prevversion %{prevmajorversion}.7
93b8d7
%global prev_prefix %{_libdir}/pgsql/postgresql-%{prevmajorversion}
93b8d7
%global precise_version %{?epoch:%epoch:}%version-%release
93b8d7
93b8d7
%global setup_version 8.8
93b8d7
93b8d7
%global service_name postgresql.service
93b8d7
93b8d7
Source0: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2
93b8d7
# The PDF file is generated by generate-pdf.sh, which see for comments
93b8d7
Source1: postgresql-%{version}-US.pdf
93b8d7
# generate-pdf.sh is not used during RPM build, but include for documentation
93b8d7
Source2: generate-pdf.sh
93b8d7
Source3: https://ftp.postgresql.org/pub/source/v%{prevversion}/postgresql-%{prevversion}.tar.bz2
93b8d7
Source4: Makefile.regress
93b8d7
Source9: postgresql.tmpfiles.d
93b8d7
Source10: postgresql.pam
93b8d7
Source11: postgresql-bashprofile
93b8d7
93b8d7
93b8d7
# git: https://github.com/devexp-db/postgresql-setup
93b8d7
Source12: https://github.com/devexp-db/postgresql-setup/releases/download/v%{setup_version}/postgresql-setup-%{setup_version}.tar.gz
93b8d7
93b8d7
# Those here are just to enforce packagers check that the tarball was downloaded
93b8d7
# correctly.  Also, this allows us check that packagers-only tarballs do not
93b8d7
# differ with publicly released ones.
93b8d7
Source16: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2.sha256
93b8d7
Source17: https://ftp.postgresql.org/pub/source/v%{prevversion}/postgresql-%{prevversion}.tar.bz2.sha256
93b8d7
93b8d7
# Comments for these patches are in the patch files.
93b8d7
Patch1: rpm-pgsql.patch
93b8d7
Patch2: postgresql-logging.patch
93b8d7
Patch5: postgresql-var-run-socket.patch
93b8d7
Patch8: postgresql-external-libpq.patch
93b8d7
Patch9: postgresql-server-pg_config.patch
93b8d7
Patch12: postgresql-no-libecpg.patch
93b8d7
93b8d7
BuildRequires: make
93b8d7
BuildRequires: gcc
93b8d7
BuildRequires: perl(ExtUtils::MakeMaker) glibc-devel bison flex gawk
93b8d7
BuildRequires: perl(ExtUtils::Embed), perl-devel
93b8d7
BuildRequires: perl(Opcode)
93b8d7
%if 0%{?fedora} || 0%{?rhel} > 7
93b8d7
BuildRequires: perl-generators
93b8d7
%endif
93b8d7
BuildRequires: readline-devel zlib-devel
93b8d7
BuildRequires: systemd systemd-devel util-linux
93b8d7
BuildRequires: multilib-rpm-config
93b8d7
%if %external_libpq
93b8d7
BuildRequires: libpq-devel >= %version
93b8d7
%endif
93b8d7
BuildRequires: docbook-style-xsl
93b8d7
93b8d7
# postgresql-setup build requires
93b8d7
BuildRequires: m4 elinks docbook-utils help2man
93b8d7
93b8d7
%if %plpython3
93b8d7
BuildRequires: python3-devel
93b8d7
%endif
93b8d7
93b8d7
%if %pltcl
93b8d7
BuildRequires: tcl-devel
93b8d7
%endif
93b8d7
93b8d7
%if %ssl
93b8d7
BuildRequires: openssl-devel
93b8d7
%endif
93b8d7
93b8d7
%if %kerberos
93b8d7
BuildRequires: krb5-devel
93b8d7
%endif
93b8d7
93b8d7
%if %ldap
93b8d7
BuildRequires: openldap-devel
93b8d7
%endif
93b8d7
93b8d7
%if %nls
93b8d7
BuildRequires: gettext >= 0.10.35
93b8d7
%endif
93b8d7
93b8d7
%if %uuid
93b8d7
BuildRequires: uuid-devel
93b8d7
%endif
93b8d7
93b8d7
%if %xml
93b8d7
BuildRequires: libxml2-devel libxslt-devel
93b8d7
%endif
93b8d7
93b8d7
%if %pam
93b8d7
BuildRequires: pam-devel
93b8d7
%endif
93b8d7
93b8d7
%if %sdt
93b8d7
BuildRequires: systemtap-sdt-devel
93b8d7
%endif
93b8d7
93b8d7
%if %selinux
93b8d7
BuildRequires: libselinux-devel
93b8d7
%endif
93b8d7
93b8d7
%if %icu
93b8d7
BuildRequires:	libicu-devel
93b8d7
%endif
93b8d7
93b8d7
# https://bugzilla.redhat.com/1464368
93b8d7
# and do not provide pkgconfig RPM provides (RHBZ#1980992)
93b8d7
%global __provides_exclude_from %{_libdir}/(pgsql|pkgconfig)
93b8d7
93b8d7
%description
93b8d7
PostgreSQL is an advanced Object-Relational database management system (DBMS).
93b8d7
The base postgresql package contains the client programs that you'll need to
93b8d7
access a PostgreSQL DBMS server, as well as HTML documentation for the whole
93b8d7
system.  These client programs can be located on the same machine as the
93b8d7
PostgreSQL server, or on a remote machine that accesses a PostgreSQL server
93b8d7
over a network connection.  The PostgreSQL server can be found in the
93b8d7
postgresql-server sub-package.
93b8d7
93b8d7
93b8d7
%if ! %external_libpq
93b8d7
%package private-libs
93b8d7
Summary: The shared libraries required only for this build of PostgreSQL server
93b8d7
Group: Applications/Databases
93b8d7
# for /sbin/ldconfig
93b8d7
Requires(post): glibc
93b8d7
Requires(postun): glibc
93b8d7
93b8d7
%description private-libs
93b8d7
The postgresql-private-libs package provides the shared libraries for this
93b8d7
build of PostgreSQL server and plugins build with this version of server.
93b8d7
For shared libraries used by client packages that need to connect to a
93b8d7
PostgreSQL server, install libpq package instead.
93b8d7
93b8d7
93b8d7
%package private-devel
93b8d7
Summary: PostgreSQL development header files for this build of PostgreSQL server
93b8d7
Group: Development/Libraries
93b8d7
Requires: %{name}-private-libs%{?_isa} = %precise_version
93b8d7
# Conflict is desired here, a user must pick one or another
93b8d7
Conflicts: libpq-devel
93b8d7
93b8d7
%description private-devel
93b8d7
The postgresql-private-devel package contains the header files and libraries
93b8d7
needed to compile C or C++ applications which will directly interact
93b8d7
with a PostgreSQL database management server.
93b8d7
You need to install this package if you want to develop applications which
93b8d7
will interact with a PostgreSQL server.
93b8d7
%endif
93b8d7
93b8d7
93b8d7
%package server
93b8d7
Summary: The programs needed to create and run a PostgreSQL server
93b8d7
Requires: %{name}%{?_isa} = %precise_version
93b8d7
Requires(pre): /usr/sbin/useradd
93b8d7
# We require this to be present for %%{_prefix}/lib/tmpfiles.d
93b8d7
Requires: systemd
93b8d7
# Make sure it's there when scriptlets run, too
93b8d7
%{?systemd_requires}
93b8d7
# Packages which provide postgresql plugins should build-require
93b8d7
# postgresql-server-devel and require
93b8d7
# postgresql-server(:MODULE_COMPAT_%%{postgresql_major}).
93b8d7
# This will automatically guard against incompatible server & plugin
93b8d7
# installation (#1008939, #1007840)
93b8d7
Provides: %{name}-server(:MODULE_COMPAT_%{majorversion})
93b8d7
Provides: bundled(postgresql-setup) = %setup_version
93b8d7
93b8d7
%description server
93b8d7
PostgreSQL is an advanced Object-Relational database management system (DBMS).
93b8d7
The postgresql-server package contains the programs needed to create
93b8d7
and run a PostgreSQL server, which will in turn allow you to create
93b8d7
and maintain PostgreSQL databases.
93b8d7
93b8d7
93b8d7
%package docs
93b8d7
Summary: Extra documentation for PostgreSQL
93b8d7
Requires: %{name}%{?_isa} = %precise_version
93b8d7
# Just for more intuitive documentation installation
93b8d7
Provides: %{name}-doc = %precise_version
93b8d7
93b8d7
%description docs
93b8d7
The postgresql-docs package contains some additional documentation for
93b8d7
PostgreSQL.  Currently, this includes the main documentation in PDF format
93b8d7
and source files for the PostgreSQL tutorial.
93b8d7
93b8d7
93b8d7
%package contrib
93b8d7
Summary: Extension modules distributed with PostgreSQL
93b8d7
Requires: %{name}%{?_isa} = %precise_version
93b8d7
93b8d7
%description contrib
93b8d7
The postgresql-contrib package contains various extension modules that are
93b8d7
included in the PostgreSQL distribution.
93b8d7
93b8d7
93b8d7
%package server-devel
93b8d7
Summary: PostgreSQL development header files and libraries
93b8d7
%if %icu
93b8d7
Requires:	libicu-devel
93b8d7
%endif
93b8d7
%if %kerberos
93b8d7
Requires: krb5-devel
93b8d7
%endif
93b8d7
%if %llvmjit
93b8d7
Requires: clang-devel llvm-devel
93b8d7
%endif
93b8d7
%if %external_libpq
93b8d7
# Some extensions require libpq
93b8d7
# Do not make them care about whether server uses private or system-wide
93b8d7
# libpq, simply let the server pull the correct one
93b8d7
Requires: libpq-devel
93b8d7
%else
93b8d7
Requires: %{name}-private-devel
93b8d7
%endif
93b8d7
93b8d7
%description server-devel
93b8d7
The postgresql-server-devel package contains the header files and configuration
93b8d7
needed to compile PostgreSQL server extension.
93b8d7
93b8d7
%package test-rpm-macros
93b8d7
Summary: Convenience RPM macros for build-time testing against PostgreSQL server
93b8d7
Requires: %{name}-server = %precise_version
93b8d7
BuildArch: noarch
93b8d7
93b8d7
%description test-rpm-macros
93b8d7
This package is meant to be added as BuildRequires: dependency of other packages
93b8d7
that want to run build-time testsuite against running PostgreSQL server.
93b8d7
93b8d7
93b8d7
%package static
93b8d7
Summary: Statically linked PostgreSQL libraries
93b8d7
Requires: %{name}-server-devel%{?_isa} = %precise_version
93b8d7
93b8d7
%description static
93b8d7
Statically linked PostgreSQL libraries that do not have dynamically linked
93b8d7
counterparts.
93b8d7
93b8d7
93b8d7
%if %upgrade
93b8d7
%package upgrade
93b8d7
Summary: Support for upgrading from the previous major release of PostgreSQL
93b8d7
Requires: %{name}-server%{?_isa} = %precise_version
93b8d7
Provides: bundled(postgresql-server) = %prevversion
93b8d7
93b8d7
%description upgrade
93b8d7
The postgresql-upgrade package contains the pg_upgrade utility and supporting
93b8d7
files needed for upgrading a PostgreSQL database from the previous major
93b8d7
version of PostgreSQL.
93b8d7
93b8d7
93b8d7
%package upgrade-devel
93b8d7
Summary: Support for build of extensions required for upgrade process
93b8d7
Requires: %{name}-upgrade%{?_isa} = %precise_version
93b8d7
93b8d7
%description upgrade-devel
93b8d7
The postgresql-devel package contains the header files and libraries
93b8d7
needed to compile C or C++ applications which are necessary in upgrade
93b8d7
process.
93b8d7
%endif
93b8d7
93b8d7
93b8d7
%if %plperl
93b8d7
%package plperl
93b8d7
Summary: The Perl procedural language for PostgreSQL
93b8d7
Requires: %{name}-server%{?_isa} = %precise_version
93b8d7
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
93b8d7
%if %runselftest
93b8d7
BuildRequires: perl(Opcode)
93b8d7
BuildRequires: perl(Data::Dumper)
93b8d7
%endif
93b8d7
93b8d7
%description plperl
93b8d7
The postgresql-plperl package contains the PL/Perl procedural language,
93b8d7
which is an extension to the PostgreSQL database server.
93b8d7
Install this if you want to write database functions in Perl.
93b8d7
%endif
93b8d7
93b8d7
93b8d7
%if %plpython3
93b8d7
%package plpython3
93b8d7
Summary: The Python3 procedural language for PostgreSQL
93b8d7
Requires: %{name}-server%{?_isa} = %precise_version
93b8d7
93b8d7
%description plpython3
93b8d7
The postgresql-plpython3 package contains the PL/Python3 procedural language,
93b8d7
which is an extension to the PostgreSQL database server.
93b8d7
Install this if you want to write database functions in Python 3.
93b8d7
%endif
93b8d7
93b8d7
93b8d7
%if %pltcl
93b8d7
%package pltcl
93b8d7
Summary: The Tcl procedural language for PostgreSQL
93b8d7
Requires: %{name}-server%{?_isa} = %precise_version
93b8d7
93b8d7
%description pltcl
93b8d7
The postgresql-pltcl package contains the PL/Tcl procedural language,
93b8d7
which is an extension to the PostgreSQL database server.
93b8d7
Install this if you want to write database functions in Tcl.
93b8d7
%endif
93b8d7
93b8d7
93b8d7
%if %test
93b8d7
%package test
93b8d7
Summary: The test suite distributed with PostgreSQL
93b8d7
Requires: %{name}-server%{?_isa} = %precise_version
93b8d7
Requires: %{name}-server-devel%{?_isa} = %precise_version
93b8d7
93b8d7
%description test
93b8d7
The postgresql-test package contains files needed for various tests for the
93b8d7
PostgreSQL database management system, including regression tests and
93b8d7
benchmarks.
93b8d7
%endif
93b8d7
93b8d7
%if %llvmjit
93b8d7
%package llvmjit
93b8d7
Summary:	Just-in-time compilation support for PostgreSQL
93b8d7
Requires:	%{name}-server%{?_isa} = %{version}-%{release}
93b8d7
%if 0%{?rhel} && 0%{?rhel} == 7
93b8d7
Requires:	llvm5.0 >= 5.0
93b8d7
%else
93b8d7
Requires:	llvm => 5.0
93b8d7
%endif
93b8d7
Provides:	postgresql-llvmjit >= %{version}-%{release}
93b8d7
93b8d7
BuildRequires:	llvm-devel >= 5.0 clang-devel >= 5.0
93b8d7
93b8d7
%description llvmjit
93b8d7
The postgresql-llvmjit package contains support for
93b8d7
just-in-time compiling parts of PostgreSQL queries. Using LLVM it
93b8d7
compiles e.g. expressions and tuple deforming into native code, with the
93b8d7
goal of accelerating analytics queries.
93b8d7
%endif
93b8d7
93b8d7
%prep
93b8d7
(
93b8d7
  cd "$(dirname "%{SOURCE0}")"
93b8d7
  sha256sum -c %{SOURCE16}
93b8d7
%if %upgrade
93b8d7
  sha256sum -c %{SOURCE17}
93b8d7
%endif
93b8d7
)
93b8d7
%setup -q -a 12 -n postgresql-%{version}
93b8d7
%patch1 -p1
93b8d7
%patch2 -p1
93b8d7
%patch5 -p1
93b8d7
%if %external_libpq
93b8d7
%patch8 -p1
93b8d7
%else
93b8d7
%patch12 -p1
93b8d7
%endif
93b8d7
%patch9 -p1
93b8d7
93b8d7
# We used to run autoconf here, but there's no longer any real need to,
93b8d7
# since Postgres ships with a reasonably modern configure script.
93b8d7
93b8d7
cp -p %{SOURCE1} .
93b8d7
93b8d7
%if ! %external_libpq
93b8d7
%global private_soname private%{majorversion}
93b8d7
find . -type f -name Makefile -exec sed -i -e "s/SO_MAJOR_VERSION=\s\?\([0-9]\+\)/SO_MAJOR_VERSION= %{private_soname}-\1/" {} \;
93b8d7
%endif
93b8d7
93b8d7
%if %upgrade
93b8d7
tar xfj %{SOURCE3}
93b8d7
93b8d7
# libpq from this upgrade-only build is dropped and the libpq from the main
93b8d7
# version is used. Use the same major hack therefore.
93b8d7
%if ! %external_libpq
93b8d7
find . -type f -name Makefile -exec sed -i -e "s/SO_MAJOR_VERSION=\s\?\([0-9]\+\)/SO_MAJOR_VERSION= %{private_soname}-\1/" {} \;
93b8d7
%endif
93b8d7
93b8d7
# apply once SOURCE3 is extracted
93b8d7
%endif
93b8d7
93b8d7
# remove .gitignore files to ensure none get into the RPMs (bug #642210)
93b8d7
find . -type f -name .gitignore | xargs rm
93b8d7
93b8d7
93b8d7
%build
93b8d7
# Avoid LTO on armv7hl as it runs out of memory
93b8d7
%ifarch armv7hl s390x
93b8d7
%define _lto_cflags %{nil}
93b8d7
%endif
93b8d7
# fail quickly and obviously if user tries to build as root
93b8d7
%if %runselftest
93b8d7
	if [ x"`id -u`" = x0 ]; then
93b8d7
		echo "postgresql's regression tests fail if run as root."
93b8d7
		echo "If you really need to build the RPM as root, use"
93b8d7
		echo "--define='runselftest 0' to skip the regression tests."
93b8d7
		exit 1
93b8d7
	fi
93b8d7
%endif
93b8d7
93b8d7
# Building postgresql-setup
93b8d7
93b8d7
cd postgresql-setup-%{setup_version}
93b8d7
93b8d7
%configure \
93b8d7
    pgdocdir=%{_pkgdocdir} \
93b8d7
    PGVERSION=%{version} \
93b8d7
    PGMAJORVERSION=%{majorversion} \
93b8d7
    NAME_DEFAULT_PREV_SERVICE=postgresql
93b8d7
93b8d7
make %{?_smp_mflags}
93b8d7
cd ..
93b8d7
93b8d7
# Fiddling with CFLAGS.
93b8d7
93b8d7
CFLAGS="${CFLAGS:-%optflags}"
93b8d7
# Strip out -ffast-math from CFLAGS....
93b8d7
CFLAGS=`echo $CFLAGS|xargs -n 1|grep -v ffast-math|xargs -n 100`
93b8d7
export CFLAGS
93b8d7
93b8d7
common_configure_options='
93b8d7
	--disable-rpath
93b8d7
%if %beta
93b8d7
	--enable-debug
93b8d7
	--enable-cassert
93b8d7
%endif
93b8d7
%if %plperl
93b8d7
	--with-perl
93b8d7
%endif
93b8d7
%if %pltcl
93b8d7
	--with-tcl
93b8d7
	--with-tclconfig=%_libdir
93b8d7
%endif
93b8d7
%if %ldap
93b8d7
	--with-ldap
93b8d7
%endif
93b8d7
%if %ssl
93b8d7
	--with-openssl
93b8d7
%endif
93b8d7
%if %pam
93b8d7
	--with-pam
93b8d7
%endif
93b8d7
%if %kerberos
93b8d7
	--with-gssapi
93b8d7
%endif
93b8d7
%if %uuid
93b8d7
	--with-ossp-uuid
93b8d7
%endif
93b8d7
%if %xml
93b8d7
	--with-libxml
93b8d7
	--with-libxslt
93b8d7
%endif
93b8d7
%if %nls
93b8d7
	--enable-nls
93b8d7
%endif
93b8d7
%if %sdt
93b8d7
	--enable-dtrace
93b8d7
%endif
93b8d7
%if %selinux
93b8d7
	--with-selinux
93b8d7
%endif
93b8d7
	--with-system-tzdata=%_datadir/zoneinfo
93b8d7
	--datadir=%_datadir/pgsql
93b8d7
	--with-systemd
93b8d7
%if %icu
93b8d7
	--with-icu
93b8d7
%endif
93b8d7
%if %llvmjit
93b8d7
	--with-llvm
93b8d7
%endif
93b8d7
%if %plpython3
93b8d7
	--with-python
93b8d7
%endif
93b8d7
'
93b8d7
93b8d7
export PYTHON=/usr/bin/python3
93b8d7
93b8d7
# These configure options must match main build
93b8d7
%configure $common_configure_options
93b8d7
93b8d7
%make_build world
93b8d7
93b8d7
# Have to hack makefile to put correct path into tutorial scripts
93b8d7
sed "s|C=\`pwd\`;|C=%{_libdir}/pgsql/tutorial;|" < src/tutorial/Makefile > src/tutorial/GNUmakefile
93b8d7
make %{?_smp_mflags} -C src/tutorial NO_PGXS=1 all
93b8d7
rm -f src/tutorial/GNUmakefile
93b8d7
93b8d7
# The object files shouldn't be copied to rpm bz#1187514
93b8d7
rm -f src/tutorial/*.o
93b8d7
93b8d7
# run_testsuite WHERE
93b8d7
# -------------------
93b8d7
# Run 'make check' in WHERE path.  When that command fails, return the logs
93b8d7
# given by PostgreSQL build system and set 'test_failure=1'.  This function
93b8d7
# never exits directly nor stops rpmbuild where `set -e` is enabled.
93b8d7
run_testsuite()
93b8d7
{
93b8d7
	make -k -C "$1" MAX_CONNECTIONS=5 check && return 0 || test_failure=1
93b8d7
	(
93b8d7
		set +x
93b8d7
		echo "=== trying to find all regression.diffs files in build directory ==="
93b8d7
		find "$1" -name 'regression.diffs' | \
93b8d7
		while read line; do
93b8d7
			echo "=== make failure: $line ==="
93b8d7
			cat "$line"
93b8d7
		done
93b8d7
	)
93b8d7
}
93b8d7
93b8d7
test_failure=0
93b8d7
93b8d7
%if %runselftest
93b8d7
	run_testsuite "src/test/regress"
93b8d7
	make clean -C "src/test/regress"
93b8d7
	run_testsuite "src/pl"
93b8d7
	run_testsuite "contrib"
93b8d7
%endif
93b8d7
93b8d7
# "assert(ALL_TESTS_OK)"
93b8d7
test "$test_failure" -eq 0
93b8d7
93b8d7
%if %test
93b8d7
	# undo the "make clean" above
93b8d7
	make all -C src/test/regress
93b8d7
%endif
93b8d7
93b8d7
%if %upgrade
93b8d7
	pushd postgresql-%{prevversion}
93b8d7
93b8d7
	# The upgrade build can be pretty stripped-down, but make sure that
93b8d7
	# any options that affect on-disk file layout match the previous
93b8d7
	# major release!
93b8d7
93b8d7
	# The set of built server modules here should ideally create superset
93b8d7
	# of modules we used to ship in %%prevversion (in the installation
93b8d7
	# the user will upgrade from), including *-contrib or *-pl*
93b8d7
	# subpackages.  This increases chances that the upgrade from
93b8d7
	# %%prevversion will work smoothly.
93b8d7
93b8d7
upgrade_configure ()
93b8d7
{
93b8d7
	# Note we intentionally do not use %%configure here, because we *don't* want
93b8d7
	# its ideas about installation paths.
93b8d7
93b8d7
	# The -fno-aggressive-loop-optimizations is hack for #993532
93b8d7
	CFLAGS="$CFLAGS -fno-aggressive-loop-optimizations" ./configure \
93b8d7
		--build=%{_build} \
93b8d7
		--host=%{_host} \
93b8d7
		--prefix=%prev_prefix \
93b8d7
		--disable-rpath \
93b8d7
%if %beta
93b8d7
		--enable-debug \
93b8d7
		--enable-cassert \
93b8d7
%endif
93b8d7
%if %icu
93b8d7
		--with-icu \
93b8d7
%endif
93b8d7
%if %plperl
93b8d7
		--with-perl \
93b8d7
%endif
93b8d7
%if %pltcl
93b8d7
		--with-tcl \
93b8d7
%endif
93b8d7
%if %ssl
93b8d7
	    --with-openssl \
93b8d7
%endif
93b8d7
%if %plpython3
93b8d7
		--with-python \
93b8d7
%endif
93b8d7
		--with-tclconfig=%_libdir \
93b8d7
		--with-system-tzdata=/usr/share/zoneinfo \
93b8d7
		"$@"
93b8d7
}
93b8d7
93b8d7
	upgrade_configure \
93b8d7
93b8d7
	make %{?_smp_mflags} all
93b8d7
	make -C contrib %{?_smp_mflags} all
93b8d7
	popd
93b8d7
# endif upgrade
93b8d7
%endif
93b8d7
93b8d7
93b8d7
%install
93b8d7
cd postgresql-setup-%{setup_version}
93b8d7
make install DESTDIR=$RPM_BUILD_ROOT
93b8d7
cd ..
93b8d7
93b8d7
# For some reason, having '%%doc %%{_pkgdocdir}/README.rpm-dist' in %%files
93b8d7
# causes FTBFS (at least on RHEL6), see rhbz#1250006.
93b8d7
mv $RPM_BUILD_ROOT/%{_pkgdocdir}/README.rpm-dist ./
93b8d7
93b8d7
cat > $RPM_BUILD_ROOT%{_sysconfdir}/postgresql-setup/upgrade/postgresql.conf <
93b8d7
id              postgresql
93b8d7
major           %{prevmajorversion}
93b8d7
data_default    %{_localstatedir}/pgsql/data
93b8d7
package         postgresql-upgrade
93b8d7
engine          %{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin
93b8d7
description     "Upgrade data from system PostgreSQL version (PostgreSQL %{prevmajorversion})"
93b8d7
redhat_sockets_hack no
93b8d7
EOF
93b8d7
93b8d7
make DESTDIR=$RPM_BUILD_ROOT install-world
93b8d7
93b8d7
# We ship pg_config through libpq-devel
93b8d7
mv $RPM_BUILD_ROOT/%_mandir/man1/pg_{,server_}config.1
93b8d7
%if %external_libpq
93b8d7
rm $RPM_BUILD_ROOT/%_includedir/pg_config*.h
93b8d7
rm $RPM_BUILD_ROOT/%_includedir/libpq/libpq-fs.h
93b8d7
rm $RPM_BUILD_ROOT/%_includedir/postgres_ext.h
93b8d7
rm -r $RPM_BUILD_ROOT/%_includedir/pgsql/internal/
93b8d7
%else
93b8d7
ln -s pg_server_config $RPM_BUILD_ROOT/%_bindir/pg_config
93b8d7
rm $RPM_BUILD_ROOT/%{_libdir}/libpq.a
93b8d7
%endif
93b8d7
93b8d7
# make sure these directories exist even if we suppressed all contrib modules
93b8d7
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/pgsql/contrib
93b8d7
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/pgsql/extension
93b8d7
93b8d7
# multilib header hack
93b8d7
for header in \
93b8d7
	%{_includedir}/pg_config.h \
93b8d7
	%{_includedir}/pg_config_ext.h
93b8d7
do
93b8d7
%multilib_fix_c_header --file "$header"
93b8d7
done
93b8d7
93b8d7
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/pgsql/tutorial
93b8d7
cp -p src/tutorial/* $RPM_BUILD_ROOT%{_libdir}/pgsql/tutorial
93b8d7
93b8d7
%if %pam
93b8d7
install -d $RPM_BUILD_ROOT/etc/pam.d
93b8d7
install -m 644 %{SOURCE10} $RPM_BUILD_ROOT/etc/pam.d/postgresql
93b8d7
%endif
93b8d7
93b8d7
# Create the directory for sockets.
93b8d7
install -d -m 755 $RPM_BUILD_ROOT%{?_localstatedir}/run/postgresql
93b8d7
93b8d7
# ... and make a tmpfiles script to recreate it at reboot.
93b8d7
mkdir -p $RPM_BUILD_ROOT%{_tmpfilesdir}
93b8d7
install -m 0644 %{SOURCE9} $RPM_BUILD_ROOT%{_tmpfilesdir}/postgresql.conf
93b8d7
93b8d7
# PGDATA needs removal of group and world permissions due to pg_pwd hole.
93b8d7
install -d -m 700 $RPM_BUILD_ROOT%{?_localstatedir}/lib/pgsql/data
93b8d7
93b8d7
# backups of data go here...
93b8d7
install -d -m 700 $RPM_BUILD_ROOT%{?_localstatedir}/lib/pgsql/backups
93b8d7
93b8d7
# postgres' .bash_profile
93b8d7
install -m 644 %{SOURCE11} $RPM_BUILD_ROOT%{?_localstatedir}/lib/pgsql/.bash_profile
93b8d7
93b8d7
rm $RPM_BUILD_ROOT/%{_datadir}/man/man1/ecpg.1
93b8d7
93b8d7
%if %upgrade
93b8d7
	pushd postgresql-%{prevversion}
93b8d7
	make DESTDIR=$RPM_BUILD_ROOT install
93b8d7
	make -C contrib DESTDIR=$RPM_BUILD_ROOT install
93b8d7
	popd
93b8d7
93b8d7
	# remove stuff we don't actually need for upgrade purposes
93b8d7
	pushd $RPM_BUILD_ROOT%{_libdir}/pgsql/postgresql-%{prevmajorversion}
93b8d7
	rm bin/clusterdb
93b8d7
	rm bin/createdb
93b8d7
	rm bin/createuser
93b8d7
	rm bin/dropdb
93b8d7
	rm bin/dropuser
93b8d7
	rm bin/ecpg
93b8d7
	rm bin/initdb
93b8d7
	rm bin/pg_basebackup
93b8d7
	rm bin/pg_dump
93b8d7
	rm bin/pg_dumpall
93b8d7
	rm bin/pg_restore
93b8d7
	rm bin/pgbench
93b8d7
	rm bin/psql
93b8d7
	rm bin/reindexdb
93b8d7
	rm bin/vacuumdb
93b8d7
	rm -rf share/doc
93b8d7
	rm -rf share/man
93b8d7
	rm -rf share/tsearch_data
93b8d7
	rm lib/*.a
93b8d7
	# Drop libpq.  This might need some tweaks once there's
93b8d7
	# soname bump between %%prevversion and %%version.
93b8d7
	rm lib/libpq.so*
93b8d7
	# Drop libraries.
93b8d7
	rm lib/lib{ecpg,ecpg_compat,pgtypes}.so*
93b8d7
	rm share/*.bki
93b8d7
	rm share/*.sample
93b8d7
	rm share/*.sql
93b8d7
	rm share/*.txt
93b8d7
	rm share/extension/*.sql
93b8d7
	rm share/extension/*.control
93b8d7
	popd
93b8d7
	cat <<EOF > $RPM_BUILD_ROOT%macrosdir/macros.%name-upgrade
93b8d7
%%postgresql_upgrade_prefix %prev_prefix
93b8d7
EOF
93b8d7
%endif
93b8d7
93b8d7
# Let plugins use the same llvmjit settings as server has
93b8d7
cat <<EOF >> $RPM_BUILD_ROOT%macrosdir/macros.%name
93b8d7
%%postgresql_server_llvmjit %llvmjit
93b8d7
EOF
93b8d7
93b8d7
%if %test
93b8d7
	# tests. There are many files included here that are unnecessary,
93b8d7
	# but include them anyway for completeness.  We replace the original
93b8d7
	# Makefiles, however.
93b8d7
	mkdir -p $RPM_BUILD_ROOT%{_libdir}/pgsql/test
93b8d7
	cp -a src/test/regress $RPM_BUILD_ROOT%{_libdir}/pgsql/test
93b8d7
	# pg_regress binary should be only in one subpackage,
93b8d7
	# there will be a symlink from -test to -devel
93b8d7
	rm -f $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/pg_regress
93b8d7
	ln -sf ../../pgxs/src/test/regress/pg_regress $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/pg_regress
93b8d7
	pushd  $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress
93b8d7
	rm -f GNUmakefile Makefile *.o
93b8d7
	chmod 0755 pg_regress regress.so
93b8d7
	popd
93b8d7
	sed 's|@bindir@|%{_bindir}|g' \
93b8d7
		< %{SOURCE4} \
93b8d7
		> $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/Makefile
93b8d7
	chmod 0644 $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/Makefile
93b8d7
%endif
93b8d7
93b8d7
rm -rf doc/html # HACK! allow 'rpmbuild -bi --short-circuit'
93b8d7
mv $RPM_BUILD_ROOT%{_docdir}/pgsql/html doc
93b8d7
rm -rf $RPM_BUILD_ROOT%{_docdir}/pgsql
93b8d7
93b8d7
# remove files not to be packaged
93b8d7
rm $RPM_BUILD_ROOT%{_libdir}/libpgfeutils.a
93b8d7
93b8d7
%if !%plperl
93b8d7
rm -f $RPM_BUILD_ROOT%{_bindir}/pgsql/hstore_plperl.so
93b8d7
%endif
93b8d7
93b8d7
# no python2, yet installed, remove
93b8d7
rm -f $RPM_BUILD_ROOT%{_datadir}/pgsql/extension/*_plpythonu*
93b8d7
rm -f $RPM_BUILD_ROOT%{_datadir}/pgsql/extension/*_plpython2u*
93b8d7
93b8d7
%if %nls
93b8d7
find_lang_bins ()
93b8d7
{
93b8d7
	lstfile=$1 ; shift
93b8d7
	cp /dev/null "$lstfile"
93b8d7
	for binary; do
93b8d7
		%find_lang "$binary"-%{majorversion}
93b8d7
		cat "$binary"-%{majorversion}.lang >>"$lstfile"
93b8d7
	done
93b8d7
}
93b8d7
find_lang_bins devel.lst pg_server_config
93b8d7
find_lang_bins server.lst \
93b8d7
	initdb pg_basebackup pg_controldata pg_ctl pg_resetwal pg_rewind plpgsql \
93b8d7
	postgres pg_checksums pg_verifybackup
93b8d7
find_lang_bins contrib.lst \
93b8d7
	pg_amcheck pg_archivecleanup pg_test_fsync pg_test_timing pg_waldump
93b8d7
find_lang_bins main.lst \
93b8d7
	pg_dump pg_upgrade pgscripts psql \
93b8d7
%if ! %external_libpq
93b8d7
libpq%{private_soname}-5
93b8d7
%endif
93b8d7
93b8d7
%if %plperl
93b8d7
find_lang_bins plperl.lst plperl
93b8d7
%endif
93b8d7
%if %plpython3
93b8d7
find_lang_bins plpython3.lst plpython
93b8d7
%endif
93b8d7
%if %pltcl
93b8d7
find_lang_bins pltcl.lst pltcl
93b8d7
%endif
93b8d7
%endif
93b8d7
93b8d7
%pre server
93b8d7
/usr/sbin/groupadd -g 26 -o -r postgres >/dev/null 2>&1 || :
93b8d7
/usr/sbin/useradd -M -N -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \
93b8d7
	-c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || :
93b8d7
93b8d7
%post server
93b8d7
%systemd_post %service_name
93b8d7
93b8d7
93b8d7
%preun server
93b8d7
%systemd_preun %service_name
93b8d7
93b8d7
93b8d7
%postun server
93b8d7
%systemd_postun_with_restart %service_name
93b8d7
93b8d7
93b8d7
%check
93b8d7
%if %runselftest
93b8d7
make -C postgresql-setup-%{setup_version} check
93b8d7
%endif
93b8d7
93b8d7
# FILES sections.
93b8d7
%files -f main.lst
93b8d7
%doc doc/KNOWN_BUGS doc/MISSING_FEATURES doc/TODO
93b8d7
%doc COPYRIGHT README HISTORY
93b8d7
%doc README.rpm-dist
93b8d7
%{_bindir}/clusterdb
93b8d7
%{_bindir}/createdb
93b8d7
%{_bindir}/createuser
93b8d7
%{_bindir}/dropdb
93b8d7
%{_bindir}/dropuser
93b8d7
%{_bindir}/pg_dump
93b8d7
%{_bindir}/pg_dumpall
93b8d7
%{_bindir}/pg_isready
93b8d7
%{_bindir}/pg_restore
93b8d7
%{_bindir}/pg_upgrade
93b8d7
%{_bindir}/psql
93b8d7
%{_bindir}/reindexdb
93b8d7
%{_bindir}/vacuumdb
93b8d7
%{_mandir}/man1/clusterdb.*
93b8d7
%{_mandir}/man1/createdb.*
93b8d7
%{_mandir}/man1/createuser.*
93b8d7
%{_mandir}/man1/dropdb.*
93b8d7
%{_mandir}/man1/dropuser.*
93b8d7
%{_mandir}/man1/pg_dump.*
93b8d7
%{_mandir}/man1/pg_dumpall.*
93b8d7
%{_mandir}/man1/pg_isready.*
93b8d7
%{_mandir}/man1/pg_restore.*
93b8d7
%{_mandir}/man1/pg_upgrade.*
93b8d7
%{_mandir}/man1/psql.*
93b8d7
%{_mandir}/man1/reindexdb.*
93b8d7
%{_mandir}/man1/vacuumdb.*
93b8d7
%{_mandir}/man7/*
93b8d7
%if %llvmjit
93b8d7
# Install bitcode directory along with the main package,
93b8d7
# so that extensions can use this dir.
93b8d7
%dir %{_libdir}/pgsql/bitcode
93b8d7
%endif
93b8d7
93b8d7
93b8d7
%if ! %external_libpq
93b8d7
%files private-libs
93b8d7
%{_libdir}/libpq.so.*
93b8d7
%endif
93b8d7
93b8d7
93b8d7
%files docs
93b8d7
%doc *-US.pdf
93b8d7
%doc doc/html
93b8d7
%{_libdir}/pgsql/tutorial/
93b8d7
93b8d7
93b8d7
%files contrib -f contrib.lst
93b8d7
%doc contrib/spi/*.example
93b8d7
%{_bindir}/oid2name
93b8d7
%{_bindir}/pg_amcheck
93b8d7
%{_bindir}/pg_archivecleanup
93b8d7
%{_bindir}/pg_test_fsync
93b8d7
%{_bindir}/pg_test_timing
93b8d7
%{_bindir}/pg_waldump
93b8d7
%{_bindir}/pgbench
93b8d7
%{_bindir}/vacuumlo
93b8d7
%{_datadir}/pgsql/extension/adminpack*
93b8d7
%{_datadir}/pgsql/extension/amcheck*
93b8d7
%{_datadir}/pgsql/extension/autoinc*
93b8d7
%{_datadir}/pgsql/extension/bloom*
93b8d7
%{_datadir}/pgsql/extension/btree_gin*
93b8d7
%{_datadir}/pgsql/extension/btree_gist*
93b8d7
%{_datadir}/pgsql/extension/citext*
93b8d7
%{_datadir}/pgsql/extension/cube*
93b8d7
%{_datadir}/pgsql/extension/dblink*
93b8d7
%{_datadir}/pgsql/extension/dict_int*
93b8d7
%{_datadir}/pgsql/extension/dict_xsyn*
93b8d7
%{_datadir}/pgsql/extension/earthdistance*
93b8d7
%{_datadir}/pgsql/extension/file_fdw*
93b8d7
%{_datadir}/pgsql/extension/fuzzystrmatch*
93b8d7
%{_datadir}/pgsql/extension/hstore*
93b8d7
%{_datadir}/pgsql/extension/insert_username*
93b8d7
%{_datadir}/pgsql/extension/intagg*
93b8d7
%{_datadir}/pgsql/extension/intarray*
93b8d7
%{_datadir}/pgsql/extension/isn*
93b8d7
%if %{plperl}
93b8d7
%{_datadir}/pgsql/extension/jsonb_plperl*
93b8d7
%endif
93b8d7
%if %{plpython3}
93b8d7
%{_datadir}/pgsql/extension/jsonb_plpython3u*
93b8d7
%endif
93b8d7
%{_datadir}/pgsql/extension/lo*
93b8d7
%{_datadir}/pgsql/extension/ltree*
93b8d7
%{_datadir}/pgsql/extension/moddatetime*
93b8d7
%{_datadir}/pgsql/extension/old_snapshot*
93b8d7
%{_datadir}/pgsql/extension/pg_surgery*
93b8d7
%{_datadir}/pgsql/extension/pageinspect*
93b8d7
%{_datadir}/pgsql/extension/pg_buffercache*
93b8d7
%{_datadir}/pgsql/extension/pg_freespacemap*
93b8d7
%{_datadir}/pgsql/extension/pg_prewarm*
93b8d7
%{_datadir}/pgsql/extension/pg_stat_statements*
93b8d7
%{_datadir}/pgsql/extension/pg_trgm*
93b8d7
%{_datadir}/pgsql/extension/pg_visibility*
93b8d7
%{_datadir}/pgsql/extension/pgcrypto*
93b8d7
%{_datadir}/pgsql/extension/pgrowlocks*
93b8d7
%{_datadir}/pgsql/extension/pgstattuple*
93b8d7
%{_datadir}/pgsql/extension/postgres_fdw*
93b8d7
%{_datadir}/pgsql/extension/refint*
93b8d7
%{_datadir}/pgsql/extension/seg*
93b8d7
%{_datadir}/pgsql/extension/tablefunc*
93b8d7
%{_datadir}/pgsql/extension/tcn*
93b8d7
%{_datadir}/pgsql/extension/tsm_system_rows*
93b8d7
%{_datadir}/pgsql/extension/tsm_system_time*
93b8d7
%{_datadir}/pgsql/extension/unaccent*
93b8d7
%{_datadir}/pgsql/extension/pg_walinspect*
93b8d7
%{_libdir}/pgsql/_int.so
93b8d7
%{_libdir}/pgsql/adminpack.so
93b8d7
%{_libdir}/pgsql/amcheck.so
93b8d7
%{_libdir}/pgsql/auth_delay.so
93b8d7
%{_libdir}/pgsql/auto_explain.so
93b8d7
%{_libdir}/pgsql/autoinc.so
93b8d7
%{_libdir}/pgsql/bloom.so
93b8d7
%{_libdir}/pgsql/btree_gin.so
93b8d7
%{_libdir}/pgsql/btree_gist.so
93b8d7
%{_libdir}/pgsql/citext.so
93b8d7
%{_libdir}/pgsql/cube.so
93b8d7
%{_libdir}/pgsql/dblink.so
93b8d7
%{_libdir}/pgsql/dict_int.so
93b8d7
%{_libdir}/pgsql/dict_xsyn.so
93b8d7
%{_libdir}/pgsql/earthdistance.so
93b8d7
%{_libdir}/pgsql/file_fdw.so
93b8d7
%{_libdir}/pgsql/fuzzystrmatch.so
93b8d7
%{_libdir}/pgsql/hstore.so
93b8d7
%if %plperl
93b8d7
%{_libdir}/pgsql/hstore_plperl.so
93b8d7
%endif
93b8d7
%if %plpython3
93b8d7
%{_libdir}/pgsql/hstore_plpython3.so
93b8d7
%endif
93b8d7
%{_libdir}/pgsql/insert_username.so
93b8d7
%{_libdir}/pgsql/isn.so
93b8d7
%if %plperl
93b8d7
%{_libdir}/pgsql/jsonb_plperl.so
93b8d7
%endif
93b8d7
%if %plpython3
93b8d7
%{_libdir}/pgsql/jsonb_plpython3.so
93b8d7
%endif
93b8d7
%{_libdir}/pgsql/lo.so
93b8d7
%{_libdir}/pgsql/ltree.so
93b8d7
%if %plpython3
93b8d7
%{_libdir}/pgsql/ltree_plpython3.so
93b8d7
%endif
93b8d7
%{_libdir}/pgsql/moddatetime.so
93b8d7
%{_libdir}/pgsql/old_snapshot.so
93b8d7
%{_libdir}/pgsql/pg_surgery.so
93b8d7
%{_libdir}/pgsql/pageinspect.so
93b8d7
%{_libdir}/pgsql/passwordcheck.so
93b8d7
%{_libdir}/pgsql/pg_buffercache.so
93b8d7
%{_libdir}/pgsql/pg_freespacemap.so
93b8d7
%{_libdir}/pgsql/pg_stat_statements.so
93b8d7
%{_libdir}/pgsql/pg_trgm.so
93b8d7
%{_libdir}/pgsql/pg_visibility.so
93b8d7
%{_libdir}/pgsql/pgcrypto.so
93b8d7
%{_libdir}/pgsql/pgrowlocks.so
93b8d7
%{_libdir}/pgsql/pgstattuple.so
93b8d7
%{_libdir}/pgsql/postgres_fdw.so
93b8d7
%{_libdir}/pgsql/refint.so
93b8d7
%{_libdir}/pgsql/seg.so
93b8d7
%{_libdir}/pgsql/tablefunc.so
93b8d7
%{_libdir}/pgsql/tcn.so
93b8d7
%{_libdir}/pgsql/test_decoding.so
93b8d7
%{_libdir}/pgsql/tsm_system_rows.so
93b8d7
%{_libdir}/pgsql/tsm_system_time.so
93b8d7
%{_libdir}/pgsql/unaccent.so
93b8d7
%{_libdir}/pgsql/basebackup_to_shell.so
93b8d7
%{_libdir}/pgsql/basic_archive.so
93b8d7
%{_libdir}/pgsql/pg_walinspect.so
93b8d7
%{_mandir}/man1/oid2name.*
93b8d7
%{_mandir}/man1/pg_amcheck.*
93b8d7
%{_mandir}/man1/pg_archivecleanup.*
93b8d7
%{_mandir}/man1/pg_recvlogical.*
93b8d7
%{_mandir}/man1/pg_test_fsync.*
93b8d7
%{_mandir}/man1/pg_test_timing.*
93b8d7
%{_mandir}/man1/pg_waldump.*
93b8d7
%{_mandir}/man1/pgbench.*
93b8d7
%{_mandir}/man1/vacuumlo.*
93b8d7
%{_mandir}/man3/dblink*
93b8d7
%if %selinux
93b8d7
%{_datadir}/pgsql/contrib/sepgsql.sql
93b8d7
%{_libdir}/pgsql/sepgsql.so
93b8d7
%endif
93b8d7
%if %ssl
93b8d7
%{_datadir}/pgsql/extension/sslinfo*
93b8d7
%{_libdir}/pgsql/sslinfo.so
93b8d7
%endif
93b8d7
%if %uuid
93b8d7
%{_datadir}/pgsql/extension/uuid-ossp*
93b8d7
%{_libdir}/pgsql/uuid-ossp.so
93b8d7
%endif
93b8d7
%if %xml
93b8d7
%{_datadir}/pgsql/extension/xml2*
93b8d7
%{_libdir}/pgsql/pgxml.so
93b8d7
%endif
93b8d7
93b8d7
%files server -f server.lst
93b8d7
%{_bindir}/initdb
93b8d7
%{_bindir}/pg_basebackup
93b8d7
%{_bindir}/pg_controldata
93b8d7
%{_bindir}/pg_ctl
93b8d7
%{_bindir}/pg_receivewal
93b8d7
%{_bindir}/pg_recvlogical
93b8d7
%{_bindir}/pg_resetwal
93b8d7
%{_bindir}/pg_rewind
93b8d7
%{_bindir}/pg_checksums
93b8d7
%{_bindir}/pg_verifybackup
93b8d7
%{_bindir}/postgres
93b8d7
%{_bindir}/postgresql-setup
93b8d7
%{_bindir}/postgresql-upgrade
93b8d7
%{_bindir}/postmaster
93b8d7
%dir %{_datadir}/pgsql
93b8d7
%{_datadir}/pgsql/*.sample
93b8d7
%dir %{_datadir}/pgsql/contrib
93b8d7
%dir %{_datadir}/pgsql/extension
93b8d7
%{_datadir}/pgsql/extension/plpgsql*
93b8d7
%{_datadir}/pgsql/information_schema.sql
93b8d7
%{_datadir}/pgsql/postgres.bki
93b8d7
%{_datadir}/pgsql/snowball_create.sql
93b8d7
%{_datadir}/pgsql/sql_features.txt
93b8d7
%{_datadir}/pgsql/system_constraints.sql
93b8d7
%{_datadir}/pgsql/system_functions.sql
93b8d7
%{_datadir}/pgsql/system_views.sql
93b8d7
%{_datadir}/pgsql/timezonesets/
93b8d7
%{_datadir}/pgsql/tsearch_data/
93b8d7
%dir %{_datadir}/postgresql-setup
93b8d7
%{_datadir}/postgresql-setup/library.sh
93b8d7
%dir %{_libdir}/pgsql
93b8d7
%{_libdir}/pgsql/*_and_*.so
93b8d7
%{_libdir}/pgsql/dict_snowball.so
93b8d7
%{_libdir}/pgsql/euc2004_sjis2004.so
93b8d7
%{_libdir}/pgsql/libpqwalreceiver.so
93b8d7
%{_libdir}/pgsql/pg_prewarm.so
93b8d7
%{_libdir}/pgsql/pgoutput.so
93b8d7
%{_libdir}/pgsql/plpgsql.so
93b8d7
%dir %{_libexecdir}/initscripts/legacy-actions/postgresql
93b8d7
%{_libexecdir}/initscripts/legacy-actions/postgresql/*
93b8d7
%{_libexecdir}/postgresql-check-db-dir
93b8d7
%dir %{_sysconfdir}/postgresql-setup
93b8d7
%dir %{_sysconfdir}/postgresql-setup/upgrade
93b8d7
%config %{_sysconfdir}/postgresql-setup/upgrade/*.conf
93b8d7
%{_mandir}/man1/initdb.*
93b8d7
%{_mandir}/man1/pg_basebackup.*
93b8d7
%{_mandir}/man1/pg_controldata.*
93b8d7
%{_mandir}/man1/pg_ctl.*
93b8d7
%{_mandir}/man1/pg_receivewal.*
93b8d7
%{_mandir}/man1/pg_resetwal.*
93b8d7
%{_mandir}/man1/pg_rewind.*
93b8d7
%{_mandir}/man1/pg_checksums.*
93b8d7
%{_mandir}/man1/pg_verifybackup.*
93b8d7
%{_mandir}/man1/postgres.*
93b8d7
%{_mandir}/man1/postgresql-new-systemd-unit.*
93b8d7
%{_mandir}/man1/postgresql-setup.*
93b8d7
%{_mandir}/man1/postgresql-upgrade.*
93b8d7
%{_mandir}/man1/postmaster.*
93b8d7
%{_sbindir}/postgresql-new-systemd-unit
93b8d7
%{_tmpfilesdir}/postgresql.conf
93b8d7
%{_unitdir}/*postgresql*.service
93b8d7
%attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql
93b8d7
%attr(644,postgres,postgres) %config(noreplace) %{?_localstatedir}/lib/pgsql/.bash_profile
93b8d7
%attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql/backups
93b8d7
%attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql/data
93b8d7
%attr(755,postgres,postgres) %dir %{?_localstatedir}/run/postgresql
93b8d7
%if %pam
93b8d7
%config(noreplace) /etc/pam.d/postgresql
93b8d7
%endif
93b8d7
93b8d7
93b8d7
%files server-devel -f devel.lst
93b8d7
%{_bindir}/pg_server_config
93b8d7
%dir %{_datadir}/pgsql
93b8d7
%{_datadir}/pgsql/errcodes.txt
93b8d7
%dir %{_includedir}/pgsql
93b8d7
%{_includedir}/pgsql/server
93b8d7
%{_libdir}/pgsql/pgxs/
93b8d7
%{_mandir}/man1/pg_server_config.*
93b8d7
%{_mandir}/man3/SPI_*
93b8d7
%{macrosdir}/macros.%name
93b8d7
93b8d7
93b8d7
%if ! %external_libpq
93b8d7
%files private-devel
93b8d7
%{_bindir}/pg_config
93b8d7
%{_includedir}/libpq-events.h
93b8d7
%{_includedir}/libpq-fe.h
93b8d7
%{_includedir}/postgres_ext.h
93b8d7
%{_includedir}/pgsql/internal/*.h
93b8d7
%{_includedir}/pgsql/internal/libpq/pqcomm.h
93b8d7
%{_includedir}/libpq/*.h
93b8d7
%exclude %{_libdir}/pkgconfig/*.pc
93b8d7
%{_libdir}/libpq.so
93b8d7
%{_includedir}/pg_config*.h
93b8d7
%endif
93b8d7
93b8d7
93b8d7
%files test-rpm-macros
93b8d7
%{_datadir}/postgresql-setup/postgresql_pkg_tests.sh
93b8d7
%{macrosdir}/macros.%name-test
93b8d7
93b8d7
93b8d7
%files static
93b8d7
%{_libdir}/libpgcommon.a
93b8d7
%{_libdir}/libpgport.a
93b8d7
%{_libdir}/libpgcommon_shlib.a
93b8d7
%{_libdir}/libpgport_shlib.a
93b8d7
93b8d7
93b8d7
%if %upgrade
93b8d7
%files upgrade
93b8d7
%{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin
93b8d7
%exclude %{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin/pg_config
93b8d7
%{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib
93b8d7
%exclude %{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pgxs
93b8d7
%exclude %{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pkgconfig
93b8d7
%{_libdir}/pgsql/postgresql-%{prevmajorversion}/share
93b8d7
93b8d7
93b8d7
%files upgrade-devel
93b8d7
%{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin/pg_config
93b8d7
%{_libdir}/pgsql/postgresql-%{prevmajorversion}/include
93b8d7
%{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pkgconfig
93b8d7
%{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pgxs
93b8d7
%{macrosdir}/macros.%name-upgrade
93b8d7
%endif
93b8d7
93b8d7
%if %llvmjit
93b8d7
%files llvmjit
93b8d7
%defattr(-,root,root)
93b8d7
%{_libdir}/pgsql/bitcode/*
93b8d7
%{_libdir}/pgsql/llvmjit.so
93b8d7
%{_libdir}/pgsql/llvmjit_types.bc
93b8d7
%endif
93b8d7
93b8d7
%if %plperl
93b8d7
%files plperl -f plperl.lst
93b8d7
%{_datadir}/pgsql/extension/bool_plperl*
93b8d7
%{_datadir}/pgsql/extension/plperl*
93b8d7
%{_libdir}/pgsql/bool_plperl.so
93b8d7
%{_libdir}/pgsql/plperl.so
93b8d7
%endif
93b8d7
93b8d7
93b8d7
%if %pltcl
93b8d7
%files pltcl -f pltcl.lst
93b8d7
%{_datadir}/pgsql/extension/pltcl*
93b8d7
%{_libdir}/pgsql/pltcl.so
93b8d7
%endif
93b8d7
93b8d7
93b8d7
%if %plpython3
93b8d7
%files plpython3 -f plpython3.lst
93b8d7
%{_datadir}/pgsql/extension/plpython3*
93b8d7
%{_libdir}/pgsql/plpython3.so
93b8d7
%endif
93b8d7
93b8d7
93b8d7
%if %test
93b8d7
%files test
93b8d7
%attr(-,postgres,postgres) %{_libdir}/pgsql/test
93b8d7
%endif
93b8d7
93b8d7
93b8d7
%changelog
93b8d7
* Wed Feb 08 2023 Filip Januš <fjanus@redhat.com> - 15.2-1
93b8d7
- Update to upstream version 15.2
93b8d7
- Update postgresql-setup to 8.8
93b8d7
- PostgreSQL systemd unit waits for the network to be up
93b8d7
- Resolves: #2128241
93b8d7
93b8d7
* Fri Oct 14 2022 Filip Januš <fjanus@redhat.com> - 15.0-1
93b8d7
- Initial import for postgresql 15
93b8d7
- Specfile is based on version locate in centos stream
93b8d7
  It reflects changes with libpq. This version of databse server
93b8d7
  will use private libpq library.
93b8d7
- Resolves: #2128241