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