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