SHA256
1
0
forked from pool/postgresql12

Accepting request 811573 from home:rmax:branches:server:database:postgresql

- update to 12.3 (bsc#1171924).
  https://www.postgresql.org/about/news/2038/
  https://www.postgresql.org/docs/12/release-12-3.html
- Unify the spec file to work across all current PostgreSQL
  versions to simplify future maintenance.

- Temporarily disable JIT support on SLE until support status of
  clang has been clarified.
- We only need clang for LLVM, not clang-devel.

OBS-URL: https://build.opensuse.org/request/show/811573
OBS-URL: https://build.opensuse.org/package/show/server:database:postgresql/postgresql12?expand=0&rev=14
This commit is contained in:
Reinhard Max 2020-06-04 17:47:22 +00:00 committed by Git OBS Bridge
parent ea31700f9d
commit eebdc7ceb0
5 changed files with 274 additions and 176 deletions

View File

@ -1,3 +1,3 @@
<multibuild> <multibuild>
<package>libs</package> <package>mini</package>
</multibuild> </multibuild>

View File

@ -5,3 +5,4 @@ addFilter("non-standard-uid")
addFilter("file-not-in-%lang") addFilter("file-not-in-%lang")
addFilter("no-dependency-on") addFilter("no-dependency-on")
addFilter("no-soname") addFilter("no-soname")
addFilter("devel-file-in-non-devel-package")

View File

@ -4,10 +4,8 @@ Date: Fri Mar 8 17:56:58 2013 +0100
+ SET LC_ + SET LC_
Index: postgresql-11beta1/src/test/regress/expected/int8.out --- src/test/regress/expected/int8.out.orig
=================================================================== +++ src/test/regress/expected/int8.out
--- postgresql-11beta1.orig/src/test/regress/expected/int8.out
+++ postgresql-11beta1/src/test/regress/expected/int8.out
@@ -580,6 +580,7 @@ SELECT '' AS to_char_12, to_char(q2, 'FM @@ -580,6 +580,7 @@ SELECT '' AS to_char_12, to_char(q2, 'FM
| -4567890123456789.000 | -4567890123456789.000
(5 rows) (5 rows)
@ -16,10 +14,8 @@ Index: postgresql-11beta1/src/test/regress/expected/int8.out
SELECT '' AS to_char_13, to_char(q2, 'L9999999999999999.000') FROM INT8_TBL; SELECT '' AS to_char_13, to_char(q2, 'L9999999999999999.000') FROM INT8_TBL;
to_char_13 | to_char to_char_13 | to_char
------------+------------------------ ------------+------------------------
Index: postgresql-11beta1/src/test/regress/expected/numeric.out --- src/test/regress/expected/numeric.out.orig
=================================================================== +++ src/test/regress/expected/numeric.out
--- postgresql-11beta1.orig/src/test/regress/expected/numeric.out
+++ postgresql-11beta1/src/test/regress/expected/numeric.out
@@ -1079,6 +1079,7 @@ SELECT '' AS to_char_15, to_char(val, 'F @@ -1079,6 +1079,7 @@ SELECT '' AS to_char_15, to_char(val, 'F
| -24926804.04504742 | -24926804.04504742
(10 rows) (10 rows)
@ -28,10 +24,8 @@ Index: postgresql-11beta1/src/test/regress/expected/numeric.out
SELECT '' AS to_char_16, to_char(val, 'L9999999999999999.099999999999999') FROM num_data; SELECT '' AS to_char_16, to_char(val, 'L9999999999999999.099999999999999') FROM num_data;
to_char_16 | to_char to_char_16 | to_char
------------+------------------------------------ ------------+------------------------------------
Index: postgresql-11beta1/src/test/regress/sql/int8.sql --- src/test/regress/sql/int8.sql.orig
=================================================================== +++ src/test/regress/sql/int8.sql
--- postgresql-11beta1.orig/src/test/regress/sql/int8.sql
+++ postgresql-11beta1/src/test/regress/sql/int8.sql
@@ -116,6 +116,7 @@ SELECT '' AS to_char_9, to_char(q2, '09 @@ -116,6 +116,7 @@ SELECT '' AS to_char_9, to_char(q2, '09
SELECT '' AS to_char_10, to_char(q2, 'S0999999999999999') FROM INT8_TBL; SELECT '' AS to_char_10, to_char(q2, 'S0999999999999999') FROM INT8_TBL;
SELECT '' AS to_char_11, to_char(q2, 'FM0999999999999999') FROM INT8_TBL; SELECT '' AS to_char_11, to_char(q2, 'FM0999999999999999') FROM INT8_TBL;
@ -40,10 +34,8 @@ Index: postgresql-11beta1/src/test/regress/sql/int8.sql
SELECT '' AS to_char_13, to_char(q2, 'L9999999999999999.000') FROM INT8_TBL; SELECT '' AS to_char_13, to_char(q2, 'L9999999999999999.000') FROM INT8_TBL;
SELECT '' AS to_char_14, to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL; SELECT '' AS to_char_14, to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
SELECT '' AS to_char_15, to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9') FROM INT8_TBL; SELECT '' AS to_char_15, to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9') FROM INT8_TBL;
Index: postgresql-11beta1/src/test/regress/sql/numeric.sql --- src/test/regress/sql/numeric.sql.orig
=================================================================== +++ src/test/regress/sql/numeric.sql
--- postgresql-11beta1.orig/src/test/regress/sql/numeric.sql
+++ postgresql-11beta1/src/test/regress/sql/numeric.sql
@@ -773,6 +773,7 @@ SELECT '' AS to_char_12, to_char(val, 'F @@ -773,6 +773,7 @@ SELECT '' AS to_char_12, to_char(val, 'F
SELECT '' AS to_char_13, to_char(val, 'FM9999999999990999.990999999999999') FROM num_data; SELECT '' AS to_char_13, to_char(val, 'FM9999999999990999.990999999999999') FROM num_data;
SELECT '' AS to_char_14, to_char(val, 'FM0999999999999999.999909999999999') FROM num_data; SELECT '' AS to_char_14, to_char(val, 'FM0999999999999999.999909999999999') FROM num_data;

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Jun 3 17:36:27 UTC 2020 - Reinhard Max <max@suse.com>
- update to 12.3 (bsc#1171924).
https://www.postgresql.org/about/news/2038/
https://www.postgresql.org/docs/12/release-12-3.html
- Unify the spec file to work across all current PostgreSQL
versions to simplify future maintenance.
------------------------------------------------------------------- -------------------------------------------------------------------
Fri May 15 10:13:58 UTC 2020 - Namor Barcode <z1trus@gmx.com> Fri May 15 10:13:58 UTC 2020 - Namor Barcode <z1trus@gmx.com>
@ -5,6 +14,13 @@ Fri May 15 10:13:58 UTC 2020 - Namor Barcode <z1trus@gmx.com>
https://www.postgresql.org/about/news/2038/ https://www.postgresql.org/about/news/2038/
https://www.postgresql.org/docs/12/release-12-3.html https://www.postgresql.org/docs/12/release-12-3.html
-------------------------------------------------------------------
Tue Mar 31 14:23:52 UTC 2020 - Reinhard Max <max@suse.com>
- Temporarily disable JIT support on SLE until support status of
clang has been clarified.
- We only need clang for LLVM, not clang-devel.
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Feb 27 08:58:37 UTC 2020 - Reinhard Max <max@suse.com> Thu Feb 27 08:58:37 UTC 2020 - Reinhard Max <max@suse.com>

View File

@ -16,9 +16,15 @@
# #
%define pgversion 12.3
%define pgmajor 12 %define pgmajor 12
%define pgname postgresql%pgmajor %define pgsuffix %pgmajor
%define priority %{pgmajor} %define buildlibs 1
%define tarversion %{pgversion}
### CUT HERE ###
%define pgname postgresql%pgsuffix
%define priority %pgsuffix
%define libpq libpq5 %define libpq libpq5
%define libecpg libecpg6 %define libecpg libecpg6
%define libpq_so libpq.so.5 %define libpq_so libpq.so.5
@ -34,37 +40,52 @@
%define pgcontribdir %pgdatadir/contrib %define pgcontribdir %pgdatadir/contrib
%define pgmandir %_mandir %define pgmandir %_mandir
%if "@BUILD_FLAVOR@" == "libs"
Name: %pgname-libs
%define buildmain 0
%define buildlibs 1
%define builddevel 1
%else
Name: %pgname Name: %pgname
%define buildmain 1 %if "@BUILD_FLAVOR@" == "mini"
%define buildlibs 0 %define devel devel-mini
%define builddevel 0 %define mini 1
%else
%define devel devel
%define mini 0
%endif %endif
%if 0%{?suse_version} >= 1300 && %buildmain # Use Python 2 for PostgreSQL 9.x on all platforms and for PostgreSQL 10 on SLE12.
%bcond_without systemd # Use Python 3 for everything else.
%if %pgsuffix < 90 && ( 0%{?is_opensuse} || 0%{?sle_version} >= 150000 || %pgsuffix > 10 )
%define python python3
%else %else
%bcond_with systemd %define python python
%endif
%if 0%{?suse_version} >= 1500 && %buildmain
%bcond_without systemd_notify
%bcond_without llvm
%else
%bcond_with systemd_notify
%bcond_with llvm
%endif %endif
%if %buildmain %if %mini
%bcond_with selinux
%bcond_with icu
%else
BuildRequires: %{python}-devel
BuildRequires: docbook_4
BuildRequires: gettext-devel
BuildRequires: libuuid-devel
BuildRequires: ncurses-devel
BuildRequires: pam-devel
BuildRequires: readline-devel
BuildRequires: tcl-devel
BuildRequires: timezone
BuildRequires: zlib-devel
%bcond_without selinux %bcond_without selinux
%bcond_without icu %bcond_without icu
%if 0%{?suse_version} >= 1300
%bcond_without systemd
%bcond_without systemd_notify
%else %else
%bcond_with selinux %bcond_with systemd
%bcond_with icu %bcond_with systemd_notify
%endif
%if 0%{?is_opensuse} && 0%{?suse_version} >= 1500 && %pgsuffix >= 11 && %pgsuffix < 90
%bcond_without llvm
%else
# LLVM is currently unsupported on SLE, so don't use it
%bcond_with llvm
%endif
%endif %endif
%ifnarch %arm %ifnarch %arm
@ -73,18 +94,10 @@ Name: %pgname
%bcond_with check %bcond_with check
%endif %endif
%if %buildmain %if ( %pgsuffix >= 11 && %pgsuffix < 90 ) || %mini
BuildRequires: docbook_4 %bcond_without server_devel
BuildRequires: gettext-devel %else
BuildRequires: libuuid-devel %bcond_with server_devel
BuildRequires: ncurses-devel
BuildRequires: pam-devel
BuildRequires: python3-devel
BuildRequires: readline-devel
BuildRequires: tcl-devel
BuildRequires: timezone
BuildRequires: zlib-devel
#
%endif %endif
BuildRequires: fdupes BuildRequires: fdupes
@ -95,7 +108,7 @@ BuildRequires: libicu-devel
BuildRequires: libselinux-devel BuildRequires: libselinux-devel
%endif %endif
%if %{with llvm} %if %{with llvm}
BuildRequires: clang-devel BuildRequires: clang
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: llvm-devel BuildRequires: llvm-devel
%endif %endif
@ -115,11 +128,10 @@ BuildRequires: pkgconfig(systemd)
Summary: Basic Clients and Utilities for PostgreSQL Summary: Basic Clients and Utilities for PostgreSQL
License: PostgreSQL License: PostgreSQL
Group: Productivity/Databases/Tools Group: Productivity/Databases/Tools
Version: 12.3 Version: %pgversion
Release: 0 Release: 0
%define pkg_version %{version} Source0: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{tarversion}.tar.bz2
Source0: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{pkg_version}.tar.bz2 Source1: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{tarversion}.tar.bz2.sha256
Source1: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{pkg_version}.tar.bz2.sha256
Source2: baselibs.conf Source2: baselibs.conf
Source3: postgresql-README.SUSE Source3: postgresql-README.SUSE
Source17: postgresql-rpmlintrc Source17: postgresql-rpmlintrc
@ -191,18 +203,65 @@ and functions.
This package provides the runtime library of the embedded SQL C This package provides the runtime library of the embedded SQL C
preprocessor for PostgreSQL. preprocessor for PostgreSQL.
%if %builddevel %package %devel
%package -n %pgname-devel
Summary: PostgreSQL client development header files and libraries Summary: PostgreSQL client development header files and libraries
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Provides: postgresql-devel = %version-%release
Provides: postgresql-devel-implementation = %version-%release Provides: postgresql-devel-implementation = %version-%release
%if %mini
Requires: this-is-only-for-build-envs
Provides: %pgname-devel = %version-%release
%else
Requires: %libecpg >= %version Requires: %libecpg >= %version
Requires: %libpq >= %version Requires: %libpq >= %version
%endif
# Installation of postgresql??-devel is exclusive # Installation of postgresql??-devel is exclusive
Provides: postgresql-devel-exclusive = %pgmajor Provides: postgresql-devel-exclusive = %pgmajor
Conflicts: postgresql-devel-exclusive < %pgmajor Conflicts: postgresql-devel-exclusive < %pgmajor
%description -n %pgname-devel %if %{with server_devel}
%package server-devel
Summary: PostgreSQL server development header files and utilities
Group: Development/Libraries/C and C++
%else
Provides: %pgname-server-devel = %version-%release
%endif
Provides: postgresql-server-devel = %version-%release
Provides: postgresql-server-devel-implementation = %version-%release
Requires(post): postgresql-server-noarch >= %pgmajor
Requires(postun): postgresql-server-noarch >= %pgmajor
Requires: %pgname-devel = %version
Requires: %pgname-server = %version-%release
# Installation of postgresql??-devel is exclusive
Provides: postgresql-server-devel-exclusive = %pgmajor
Conflicts: postgresql-server-devel-exclusive < %pgmajor
%if %{with llvm}
Requires: clang
Requires: llvm
%endif
Requires: libxslt-devel
Requires: openssl-devel
Requires: pam-devel
Requires: readline-devel
Requires: zlib-devel
Requires: pkgconfig(krb5)
%if %{with selinux}
Requires: libselinux-devel
%endif
%if %{with server_devel}
%description server-devel
PostgreSQL is an advanced object-relational database management system
that supports an extended subset of the SQL standard, including
transactions, foreign keys, subqueries, triggers, and user-defined
types and functions.
This package contains the header files and libraries needed to compile
C extensions that link into the PostgreSQL server. For building client
applications, see the postgresql%pgsuffix-devel package.
%endif
%description %devel
PostgreSQL is an advanced object-relational database management system PostgreSQL is an advanced object-relational database management system
that supports an extended subset of the SQL standard, including that supports an extended subset of the SQL standard, including
transactions, foreign keys, subqueries, triggers, and user-defined transactions, foreign keys, subqueries, triggers, and user-defined
@ -215,11 +274,7 @@ need to install this package if you want to develop applications in C
which will interact with a PostgreSQL server. which will interact with a PostgreSQL server.
For building PostgreSQL server extensions, see the For building PostgreSQL server extensions, see the
postgresql%pgmajor-server-devel package. postgresql%pgsuffix-server-devel package.
%endif
%if %buildmain
%package server %package server
Summary: The Programs Needed to Create and Run a PostgreSQL Server Summary: The Programs Needed to Create and Run a PostgreSQL Server
@ -249,42 +304,6 @@ This package includes the programs needed to create and run a
PostgreSQL server, which will in turn allow you to create and maintain PostgreSQL server, which will in turn allow you to create and maintain
PostgreSQL databases. PostgreSQL databases.
%package server-devel
Summary: PostgreSQL server development header files and utilities
Group: Development/Libraries/C and C++
Provides: postgresql-server-devel = %version-%release
Provides: postgresql-server-devel-implementation = %version-%release
Requires(post): postgresql-server-noarch >= %pgmajor
Requires(postun): postgresql-server-noarch >= %pgmajor
Requires: %pgname-devel = %version
Requires: %pgname-server = %version-%release
# Installation of postgresql??-devel is exclusive
Provides: postgresql-server-devel-exclusive = %pgmajor
Conflicts: postgresql-server-devel-exclusive < %pgmajor
%if %{with llvm}
Requires: clang-devel
%endif
Requires: libxslt-devel
Requires: openssl-devel
Requires: pam-devel
Requires: readline-devel
Requires: zlib-devel
Requires: pkgconfig(krb5)
%if %{with selinux}
Requires: libselinux-devel
%endif
%description server-devel
PostgreSQL is an advanced object-relational database management system
that supports an extended subset of the SQL standard, including
transactions, foreign keys, subqueries, triggers, and user-defined
types and functions.
This package contains the header files and libraries needed to compile
C extensions that link into the PostgreSQL server. For building client
applications, see the postgresql%pgmajor-devel package.
%if %{with llvm}
%package llvmjit %package llvmjit
Summary: Just-in-time compilation support for PostgreSQL Summary: Just-in-time compilation support for PostgreSQL
Group: Productivity/Databases/Servers Group: Productivity/Databases/Servers
@ -302,7 +321,6 @@ This package contains support for just-in-time compiling parts of
PostgreSQL queries. Using LLVM it compiles e.g. expressions and tuple PostgreSQL queries. Using LLVM it compiles e.g. expressions and tuple
deforming into native code, with the goal of accelerating analytics deforming into native code, with the goal of accelerating analytics
queries. queries.
%endif
%package test %package test
Summary: The test suite for PostgreSQL Summary: The test suite for PostgreSQL
@ -376,8 +394,8 @@ Summary: The PL/Python Procedural Languages for PostgreSQL
Group: Productivity/Databases/Servers Group: Productivity/Databases/Servers
Provides: postgresql-plpython-implementation = %version-%release Provides: postgresql-plpython-implementation = %version-%release
Requires: %pgname-server = %version-%release Requires: %pgname-server = %version-%release
Requires: %python
Requires: postgresql-plpython-noarch >= %pgmajor Requires: postgresql-plpython-noarch >= %pgmajor
Requires: python
%description plpython %description plpython
PostgreSQL is an advanced object-relational database management system PostgreSQL is an advanced object-relational database management system
@ -413,17 +431,15 @@ and triggers.
PostgreSQL also offers the built-in procedural language PL/SQL which is PostgreSQL also offers the built-in procedural language PL/SQL which is
included in the postgresql-server package. included in the postgresql-server package.
%endif
%prep %prep
%setup -q -n postgresql-%pkg_version %setup -q -n postgresql-%tarversion
# Keep the timestamp of configure, because patching it would otherwise # Keep the timestamp of configure, because patching it would otherwise
# confuse PostgreSQL's build system # confuse PostgreSQL's build system
touch -r configure tmp touch -r configure tmp
%patch1 %patch1
%patch2 %patch2
%patch4 %patch4
%patch6 -p1 %patch6
%patch8 -p1 %patch8 -p1
%patch9 %patch9
touch -r tmp configure touch -r tmp configure
@ -433,7 +449,7 @@ find -name .gitignore -delete
%build %build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects %global _lto_cflags %{_lto_cflags} -ffat-lto-objects
export PYTHON=python3 export PYTHON=%python
%ifarch %arm %ifarch %arm
export USE_ARMV8_CRC32C=0 export USE_ARMV8_CRC32C=0
%endif %endif
@ -448,7 +464,7 @@ PACKAGE_TARNAME=%pgname %configure \
--enable-nls \ --enable-nls \
--enable-thread-safety \ --enable-thread-safety \
--enable-integer-datetimes \ --enable-integer-datetimes \
%if %buildmain %if !%mini
--with-python \ --with-python \
--with-perl \ --with-perl \
--with-tcl \ --with-tcl \
@ -477,9 +493,8 @@ PACKAGE_TARNAME=%pgname %configure \
--with-gssapi \ --with-gssapi \
--with-krb5 \ --with-krb5 \
--with-system-tzdata=/usr/share/zoneinfo --with-system-tzdata=/usr/share/zoneinfo
%if !%buildmain %if %mini
# Disabled smp_mflags as some dependencies are incorrect in the interfaces code are incorrect which leads to failed builds make -C src/interfaces %{?_smp_mflags} PACKAGE_TARNAME=%pgname
make -C src/interfaces # %{?_smp_mflags}
%else %else
make %{?_smp_mflags} PACKAGE_TARNAME=%pgname make %{?_smp_mflags} PACKAGE_TARNAME=%pgname
@ -501,12 +516,20 @@ make check || {
%endif %endif
%install %install
%if %buildmain VLANG=${RPM_PACKAGE_VERSION%%.*}
VSO=${RPM_PACKAGE_VERSION%%%%.*}
%if %mini
make DESTDIR=%buildroot PACKAGE_TARNAME=%pgname -C src/include install
make DESTDIR=%buildroot PACKAGE_TARNAME=%pgname -C src/interfaces install
rm -rf %buildroot%pgincludedir/server
%else
make DESTDIR=%buildroot PACKAGE_TARNAME=%pgname install install-docs make DESTDIR=%buildroot PACKAGE_TARNAME=%pgname install install-docs
%if 0
mv %buildroot%pgincludedir/{server,..} mv %buildroot%pgincludedir/{server,..}
make DESTDIR=%buildroot PACKAGE_TARNAME=%pgname -C src/interfaces uninstall make DESTDIR=%buildroot PACKAGE_TARNAME=%pgname -C src/interfaces uninstall
rm -rf %buildroot%pgincludedir/* rm -rf %buildroot%pgincludedir/*
mv %buildroot%pgincludedir{/../server,} mv %buildroot%pgincludedir{/../server,}
%endif
# {{{ the test package # {{{ the test package
mkdir -p %buildroot%pgtestdir/regress mkdir -p %buildroot%pgtestdir/regress
@ -518,11 +541,6 @@ done
install -m 0644 src/test/regress/{serial,parallel}_schedule %buildroot%pgtestdir/regress install -m 0644 src/test/regress/{serial,parallel}_schedule %buildroot%pgtestdir/regress
# }}} # }}}
%endif %endif
%if %builddevel || %buildlibs
make DESTDIR=%buildroot PACKAGE_TARNAME=%pgname -C src/include install
make DESTDIR=%buildroot PACKAGE_TARNAME=%pgname -C src/interfaces install
rm -rf %buildroot%pgincludedir/server
%endif
# The client libraries go to libdir # The client libraries go to libdir
mkdir -p %buildroot/%_libdir mkdir -p %buildroot/%_libdir
@ -535,7 +553,8 @@ find %buildroot%_libdir/pkgconfig -type f -exec sed -i 's, -L%pglibdir,,' '{}' +
# Don't ship static libraries, # Don't ship static libraries,
# libpgport.a and libpgcommon.a are needed, though. # libpgport.a and libpgcommon.a are needed, though.
rm -f $(ls %buildroot/%_libdir/*.a %buildroot%pglibdir/*.a | grep -F -v -e libpgport.a -e libpgcommon.a) rm -f $(ls %buildroot/%_libdir/*.a %buildroot%pglibdir/*.a | grep -F -v -e libpgport.a -e libpgcommon.a)
%if %buildmain
%if !%mini
# #
# Install and collect the contrib stuff # Install and collect the contrib stuff
# #
@ -552,7 +571,7 @@ cp doc/KNOWN_BUGS doc/MISSING_FEATURES COPYRIGHT \
cp -a %SOURCE3 %buildroot%pgdocdir/README.SUSE cp -a %SOURCE3 %buildroot%pgdocdir/README.SUSE
# Use versioned names for the man pages: # Use versioned names for the man pages:
for f in %buildroot%pgmandir/man*/*; do for f in %buildroot%pgmandir/man*/*; do
mv $f ${f}pg%pgmajor mv $f ${f}pg%pgsuffix
done done
%endif %endif
@ -578,28 +597,70 @@ genlists ()
echo "%ghost $ALTBIN" >> $PKG.files echo "%ghost $ALTBIN" >> $PKG.files
test -e %buildroot$MAN && test -e %buildroot$MAN &&
echo "%doc $MAN" >> $PKG.files echo "%doc $MAN" >> $PKG.files
%find_lang $f-%pgmajor $PKG.files ||: %find_lang $f-$VLANG $PKG.files ||:
done done
} }
%if %buildmain %if !%mini
genlists main \ genlists main \
createdb clusterdb createuser dropdb \ createdb \
dropuser pg_dump pg_dumpall pg_restore pg_rewind psql vacuumdb \ clusterdb \
reindexdb pg_basebackup pg_receivewal pg_isready pg_recvlogical pg_checksums createuser \
%find_lang plpgsql-%pgmajor main.files dropdb \
%find_lang pgscripts-%pgmajor main.files dropuser \
pg_dump \
pg_dumpall \
pg_restore \
pg_rewind \
psql \
vacuumdb \
reindexdb \
pg_basebackup \
%if %pgsuffix < 90
pg_receivewal \
%else
createlang \
droplang \
pg_receivexlog \
%endif
pg_isready \
pg_recvlogical \
%if %pgsuffix == 11
pg_verify_checksums \
%endif
%if %pgsuffix == 12
pg_checksums
%endif
%find_lang plpgsql-$VLANG main.files
%find_lang pgscripts-$VLANG main.files
genlists server \ genlists server \
initdb pg_ctl pg_controldata pg_resetwal pg_waldump postgres postmaster initdb \
pg_ctl \
genlists server-devel \ pg_controldata \
pg_config %if %pgsuffix < 90
pg_resetwal \
pg_waldump \
%else
pg_resetxlog \
%endif
postgres \
postmaster
genlists contrib \ genlists contrib \
oid2name pg_archivecleanup pg_standby pg_test_fsync pg_upgrade \ %if %pgsuffix > 90
pgbench vacuumlo pg_test_timing pg_xlogdump \
%endif
oid2name \
pg_archivecleanup \
pg_standby \
pg_test_fsync \
pg_upgrade \
pgbench \
vacuumlo \
pg_test_timing
for pl in plperl plpython pltcl; do for pl in plperl plpython pltcl; do
%find_lang $pl-%{pgmajor} $pl.lang %find_lang $pl-$VLANG $pl.lang
done done
ln -s /etc/alternatives/postgresql %buildroot/usr/lib/postgresql ln -s /etc/alternatives/postgresql %buildroot/usr/lib/postgresql
touch %buildroot/etc/alternatives/postgresql touch %buildroot/etc/alternatives/postgresql
@ -608,51 +669,72 @@ touch %buildroot/etc/alternatives/postgresql
sed -i '/^LIBS = /s/= .*/=/' %buildroot/%pglibdir/pgxs/src/Makefile.global sed -i '/^LIBS = /s/= .*/=/' %buildroot/%pglibdir/pgxs/src/Makefile.global
%endif %endif
%if %builddevel
# Make sure we can also link agaist newer versions # Make sure we can also link agaist newer versions
pushd %buildroot%_libdir pushd %buildroot%_libdir
for f in *.so; do for f in *.so; do
ln -sf $f.? $f ln -sf $f.? $f
done done
%if 0
for long in *.so.*.*; do
short=${long%%.*}
so=${short%%.*}
ln -sf $long $short
ln -sf $short $so
done
%endif
popd popd
mkdir -p %buildroot%pgmandir/man1 mkdir -p %buildroot%pgmandir/man1
cp -a doc/src/sgml/man1/ecpg.1 %buildroot%pgmandir/man1/ecpg.1pg%pgmajor cp -a doc/src/sgml/man1/ecpg.1 %buildroot%pgmandir/man1/ecpg.1pg%pgsuffix
# No update-alternatives, devel-packages are exclusive %find_lang ecpg-$VLANG devel.files
ln -s %pgbindir/ecpg %buildroot%_bindir/ecpg ln -s %pgbindir/ecpg %buildroot%_bindir/ecpg
%find_lang ecpg-%{pgmajor} devel.files
%if !%mini
%find_lang pg_config-$VLANG server-devel.files
ln -s %pgbindir/pg_config %buildroot%_bindir/pg_config
%endif
%if %{without server_devel}
cat server-devel.files >> devel.files
%endif
# Build up the file lists for the libpq and libecpg packages # Build up the file lists for the libpq and libecpg packages
cat > libpq.files <<EOF cat > libpq.files <<EOF
%defattr(-,root,root) %defattr(-,root,root)
%dir %pgdatadir %dir %pgdatadir
%_libdir/libpq.so.5
%_libdir/libpq.so.5.%pgmajor
%pgdatadir/pg_service.conf.sample %pgdatadir/pg_service.conf.sample
EOF EOF
%find_lang libpq5-%{pgmajor} libpq.files find %buildroot -name 'libpq*.so.*' -printf '/%%P\n' >> libpq.files
%find_lang libpq5-$VLANG libpq.files
cat > libecpg.files <<EOF cat > libecpg.files <<EOF
%defattr(-,root,root) %defattr(-,root,root)
%_libdir/libecpg.so.6
%_libdir/libecpg.so.6.%pgmajor
%_libdir/libecpg_compat.so.3
%_libdir/libecpg_compat.so.3.%pgmajor
%_libdir/libpgtypes.so.3
%_libdir/libpgtypes.so.3.%pgmajor
EOF EOF
%find_lang ecpglib6-%{pgmajor} libecpg.files find %buildroot \( -name 'libecpg*.so.*' -o -name 'libpgtypes.so.*' \) -printf '/%%P\n' >> libecpg.files
%find_lang ecpglib6-$VLANG libecpg.files
%if !%buildlibs %if !%buildlibs
# Delete the contents of the libs and devel packages, if we don't want to build them # Delete the contents of the library packages, if we don't want to build them
awk -v P=%buildroot '/^(%lang|[^%])/{print P $NF}' libpq.files libecpg.files | xargs rm awk -v P=%buildroot '/^(%lang|[^%])/{print P $NF}' libpq.files libecpg.files | xargs rm
%endif %endif
%else # !devel
rm -f %buildroot%pgmandir/man1/ecpg.*
%endif
%fdupes %buildroot %fdupes %buildroot
%if %buildmain %post %devel
/sbin/ldconfig
%if %{with server_devel}
%post server-devel
%endif
/usr/share/postgresql/install-alternatives %priority
%postun %devel
/sbin/ldconfig
%if %{with server_devel}
%postun server-devel
%endif
/usr/share/postgresql/install-alternatives %priority
%if !%mini
%postun %postun
/usr/share/postgresql/install-alternatives %priority /usr/share/postgresql/install-alternatives %priority
@ -713,13 +795,6 @@ fi
%postun contrib %postun contrib
/usr/share/postgresql/install-alternatives %priority /usr/share/postgresql/install-alternatives %priority
%post -n %pgname-server-devel
/usr/share/postgresql/install-alternatives %priority
%postun -n %pgname-server-devel
/usr/share/postgresql/install-alternatives %priority
%endif
%if %buildlibs %if %buildlibs
%post -n %libpq -p /sbin/ldconfig %post -n %libpq -p /sbin/ldconfig
@ -730,8 +805,6 @@ fi
%postun -n %libecpg -p /sbin/ldconfig %postun -n %libecpg -p /sbin/ldconfig
%endif %endif
%if %buildmain
%files -f main.files %files -f main.files
%defattr(-,root,root) %defattr(-,root,root)
%dir %pgbindir %dir %pgbindir
@ -768,7 +841,9 @@ fi
%dir %pgbasedir %dir %pgbasedir
%dir %pgextensiondir %dir %pgextensiondir
%dir %pglibdir %dir %pglibdir
%if %pgsuffix < 90
%pglibdir/pgoutput.so %pglibdir/pgoutput.so
%endif
%pglibdir/plpgsql.so %pglibdir/plpgsql.so
%pglibdir/dict_snowball.so %pglibdir/dict_snowball.so
%pgdatadir/tsearch_data %pgdatadir/tsearch_data
@ -780,7 +855,9 @@ fi
%if %buildlibs %if %buildlibs
%exclude %pgdatadir/pg_service.conf.sample %exclude %pgdatadir/pg_service.conf.sample
%endif %endif
#exclude %pgdatadir/*.pltcl %if %pgsuffix > 90
%exclude %pgdatadir/*.pltcl
%endif
%pglibdir/*_and_*.so %pglibdir/*_and_*.so
%pglibdir/euc2004_sjis2004.so %pglibdir/euc2004_sjis2004.so
%pglibdir/libpqwalreceiver.so %pglibdir/libpqwalreceiver.so
@ -796,18 +873,14 @@ fi
%pglibdir/bitcode/* %pglibdir/bitcode/*
%endif %endif
%files server-devel -f server-devel.files
%defattr(-,root,root)
%pgincludedir
%pglibdir/pgxs
%_libdir/lib*.a
%files pltcl -f pltcl.lang %files pltcl -f pltcl.lang
%defattr(-,root,root) %defattr(-,root,root)
%pgextensiondir/pltcl* %pgextensiondir/pltcl*
%pglibdir/pltcl.so %pglibdir/pltcl.so
#pgdatadir/*.pltcl %if %pgsuffix > 90
#pgbindir/pltcl* %pgdatadir/*.pltcl
%pgbindir/pltcl*
%endif
%files plperl -f plperl.lang %files plperl -f plperl.lang
%defattr(-,root,root) %defattr(-,root,root)
@ -820,17 +893,19 @@ fi
%pglibdir/plpython*.so %pglibdir/plpython*.so
%endif %endif
%if %buildlibs
%if %buildlibs && !%mini
%files -n %libpq -f libpq.files %files -n %libpq -f libpq.files
%files -n %libecpg -f libecpg.files %files -n %libecpg -f libecpg.files
%endif %endif
%if %builddevel %if %buildlibs && %mini
%files %devel -f devel.files -f libpq.files -f libecpg.files
%else
%files %devel -f devel.files
%endif
%files -n %pgname-devel -f devel.files
%defattr(-,root,root) %defattr(-,root,root)
%dir %pgbasedir %dir %pgbasedir
%dir %pgbindir %dir %pgbindir
@ -839,8 +914,22 @@ fi
%_libdir/lib*.so %_libdir/lib*.so
%pgbindir/ecpg %pgbindir/ecpg
%pgincludedir %pgincludedir
%if %{with server_devel}
%exclude %pgincludedir/server
%endif
%doc %pgmandir/man1/ecpg.1* %doc %pgmandir/man1/ecpg.1*
%if !%mini
%if %{with server_devel}
%files server-devel -f server-devel.files
%endif
%defattr(-,root,root)
%_bindir/pg_config
%pgbindir/pg_config
%pgincludedir/server
%pglibdir/pgxs
%_libdir/lib*.a
%doc %pgmandir/man1/pg_config.1*
%endif %endif
%changelog %changelog