Accepting request 741872 from home:darix:branches:server:database:postgresql
initial package OBS-URL: https://build.opensuse.org/request/show/741872 OBS-URL: https://build.opensuse.org/package/show/server:database:postgresql/postgresql12?expand=0&rev=1
This commit is contained in:
commit
f21751e784
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
3
_multibuild
Normal file
3
_multibuild
Normal file
@ -0,0 +1,3 @@
|
||||
<multibuild>
|
||||
<package>libs</package>
|
||||
</multibuild>
|
5
baselibs.conf
Normal file
5
baselibs.conf
Normal file
@ -0,0 +1,5 @@
|
||||
libpq5
|
||||
provides "postgresql-libs-<targettype> = <version>"
|
||||
obsoletes "postgresql-libs-<targettype> < <version>"
|
||||
conflicts "postgresql-libs-<targettype> < 9.1.6"
|
||||
libecpg6
|
3
postgresql-12.0.tar.bz2
Normal file
3
postgresql-12.0.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cda2397215f758b793f741c86be05468257b0e6bcb1a6113882ab5d0df0855c6
|
||||
size 20177458
|
1
postgresql-12.0.tar.bz2.sha256
Normal file
1
postgresql-12.0.tar.bz2.sha256
Normal file
@ -0,0 +1 @@
|
||||
cda2397215f758b793f741c86be05468257b0e6bcb1a6113882ab5d0df0855c6 postgresql-12.0.tar.bz2
|
80
postgresql-README.SUSE
Normal file
80
postgresql-README.SUSE
Normal file
@ -0,0 +1,80 @@
|
||||
Unix-Domain Socket Directory
|
||||
============================
|
||||
|
||||
|
||||
|
||||
Upgrading PostgreSQL on openSUSE and SUSE Linux Enterprise Server
|
||||
=================================================================
|
||||
|
||||
Current versions of PostgreSQL come with the pg_upgrade tool that
|
||||
simplifies and speeds up the migration of a PostgreSQL installation to
|
||||
a new version. Before version 9.1 dump and restore was needed which
|
||||
was much slower.
|
||||
|
||||
pg_upgrade needs to have the server binaries of both versions
|
||||
available. To allow this, we had to change the way PostgreSQL is
|
||||
packaged as well as the naming of the packages, so that two or more
|
||||
versions of PostgreSQL can be installed in parallel. The package
|
||||
names for PostgreSQL contain numbers indicating the major version.
|
||||
|
||||
In PostgreSQL terms for versions up to 9.6 the major version consisted
|
||||
of the first two components of the three-component version number,
|
||||
i.e. 8.3, 8.4, 9.0, or 9.1. So, the packages for Postgresql 9.1 are
|
||||
named postgresql91, postgresql91-server, etc. Inside the packages the
|
||||
files were moved from their standard locations to a versioned location
|
||||
such as /usr/lib/postgresql83/bin or /usr/lib/postgresql91/bin to
|
||||
avoid file conflicts if packages are installed in parallel.
|
||||
|
||||
Starting with version 10 the PostgreSQL project changed their
|
||||
versioning scheme from from three components to two, which means one
|
||||
component for the major version and one for the minor. So, the
|
||||
sequence of major version across the versioning scheme change will be:
|
||||
9.4, 9.5, 9.6, 10, 11, 12. For versions that use the new versioning
|
||||
scheme SUSE only puts the single component major version into the
|
||||
package name, so the postgresql96 package (containg version 9.6
|
||||
according to the old versioning scheme) will be followed by
|
||||
postgresql10, then postgresql11, and so on.
|
||||
|
||||
The update-alternatives mechanism creates and maintains symbolic links
|
||||
that cause one version (by default the highest installed version) to
|
||||
re-appear in the standard locations. By default, database data are
|
||||
stored under /var/lib/pgsql/data on SUSE Linux.
|
||||
|
||||
The following preconditions have to be fulfilled before data migration
|
||||
can be started:
|
||||
|
||||
1. If not already done, the packages of the old PostgreSQL version
|
||||
must be upgraded to the new packaging scheme through a maintenance
|
||||
update.
|
||||
|
||||
2. The packages of the new PostgreSQL major version need to be
|
||||
installed. As pg_upgrade is contained in postgresql91-contrib, that
|
||||
one has to be installed as well, at least until the migration is
|
||||
done.
|
||||
|
||||
3. Unless pg_upgrade is used in link mode, the server must have
|
||||
enough free disk space to temporarily hold a copy of the database
|
||||
files. If the database instance was installed in the default
|
||||
location, the needed space in megabytes can be determined by running
|
||||
the follwing command as root: "du -hs /var/lib/pgsql/data". If space
|
||||
is tight, it might help to run the "VACUUM FULL" SQL command on each
|
||||
database in the instance to be migrated, but be aware that it might
|
||||
take very long.
|
||||
|
||||
The latest upstream documentation for pg_upgrade including step by
|
||||
step instructions for performing a database migration can be found
|
||||
online under https://www.postgresql.org/docs/current/pgupgrade.html ,
|
||||
or locally under
|
||||
file:///usr/share/doc/packages/postgresqlXX/html/pgupgrade.html , if
|
||||
the postgresqlXX-docs package is installed. XX is a place holder for
|
||||
the respective major version here.
|
||||
|
||||
NOTE: The online documentation starts with explaining how you can
|
||||
install PostgreSQL from the upstream sources (which is not necessary
|
||||
when you install the SUSE RPMs) and also uses other directory names
|
||||
(/usr/local instead of the update-alternatives based path as described
|
||||
above).
|
||||
|
||||
For background information about the inner workings of pg_upgrade and
|
||||
a performance comparison with the old dump and restore method, see
|
||||
http://momjian.us/main/writings/pgsql/pg_upgrade.pdf .
|
28
postgresql-conf.patch
Normal file
28
postgresql-conf.patch
Normal file
@ -0,0 +1,28 @@
|
||||
Index: src/backend/utils/misc/postgresql.conf.sample
|
||||
===================================================================
|
||||
--- src/backend/utils/misc/postgresql.conf.sample.orig
|
||||
+++ src/backend/utils/misc/postgresql.conf.sample
|
||||
@@ -416,13 +416,13 @@
|
||||
|
||||
# - Where to Log -
|
||||
|
||||
-#log_destination = 'stderr' # Valid values are combinations of
|
||||
+log_destination = 'stderr' # Valid values are combinations of
|
||||
# stderr, csvlog, syslog, and eventlog,
|
||||
# depending on platform. csvlog
|
||||
# requires logging_collector to be on.
|
||||
|
||||
# This is used when logging to stderr:
|
||||
-#logging_collector = off # Enable capturing of stderr and csvlog
|
||||
+logging_collector = on # Enable capturing of stderr and csvlog
|
||||
# into log files. Required to be on for
|
||||
# csvlogs.
|
||||
# (change requires restart)
|
||||
@@ -514,6 +514,7 @@
|
||||
#log_error_verbosity = default # terse, default, or verbose messages
|
||||
#log_hostname = off
|
||||
#log_line_prefix = '%m [%p] ' # special values:
|
||||
+log_line_prefix = '%m %d %u [%p]'
|
||||
# %a = application name
|
||||
# %u = user name
|
||||
# %d = database name
|
34
postgresql-plperl-keep-rpath.patch
Normal file
34
postgresql-plperl-keep-rpath.patch
Normal file
@ -0,0 +1,34 @@
|
||||
This patch keeps PosgreSQL's configure script from removing the rpath from
|
||||
Perl's linker options, because otherwise the PL/Perl module can't find
|
||||
libperl.so (bsc#578053).
|
||||
|
||||
Index: config/perl.m4
|
||||
===================================================================
|
||||
--- config/perl.m4.orig
|
||||
+++ config/perl.m4
|
||||
@@ -98,9 +98,7 @@ if test "$PORTNAME" = "win32" ; then
|
||||
fi
|
||||
fi
|
||||
else
|
||||
- pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
|
||||
- pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
|
||||
- perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]`
|
||||
+ perl_embed_ldflags=`$PERL -MExtUtils::Embed -e ldopts`
|
||||
fi
|
||||
AC_SUBST(perl_embed_ldflags)dnl
|
||||
if test -z "$perl_embed_ldflags" ; then
|
||||
Index: configure
|
||||
===================================================================
|
||||
--- configure.orig
|
||||
+++ configure
|
||||
@@ -9696,9 +9696,7 @@ if test "$PORTNAME" = "win32" ; then
|
||||
fi
|
||||
fi
|
||||
else
|
||||
- pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
|
||||
- pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
|
||||
- perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"`
|
||||
+ perl_embed_ldflags=`$PERL -MExtUtils::Embed -e ldopts`
|
||||
fi
|
||||
if test -z "$perl_embed_ldflags" ; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
70
postgresql-regress.patch
Normal file
70
postgresql-regress.patch
Normal file
@ -0,0 +1,70 @@
|
||||
Index: src/test/regress/expected/horology.out
|
||||
===================================================================
|
||||
--- src/test/regress/expected/horology.out.orig
|
||||
+++ src/test/regress/expected/horology.out
|
||||
@@ -652,26 +652,26 @@ SELECT (timestamp with time zone 'tomorr
|
||||
(1 row)
|
||||
|
||||
-- timestamp with time zone, interval arithmetic around DST change
|
||||
-SET TIME ZONE 'CST7CDT';
|
||||
-SELECT timestamp with time zone '2005-04-02 12:00-07' + interval '1 day' as "Apr 3, 12:00";
|
||||
+SET TIME ZONE 'CST6CDT';
|
||||
+SELECT timestamp with time zone '2005-04-02 12:00-06' + interval '1 day' as "Apr 3, 12:00";
|
||||
Apr 3, 12:00
|
||||
------------------------------
|
||||
Sun Apr 03 12:00:00 2005 CDT
|
||||
(1 row)
|
||||
|
||||
-SELECT timestamp with time zone '2005-04-02 12:00-07' + interval '24 hours' as "Apr 3, 13:00";
|
||||
+SELECT timestamp with time zone '2005-04-02 12:00-06' + interval '24 hours' as "Apr 3, 13:00";
|
||||
Apr 3, 13:00
|
||||
------------------------------
|
||||
Sun Apr 03 13:00:00 2005 CDT
|
||||
(1 row)
|
||||
|
||||
-SELECT timestamp with time zone '2005-04-03 12:00-06' - interval '1 day' as "Apr 2, 12:00";
|
||||
+SELECT timestamp with time zone '2005-04-03 12:00-05' - interval '1 day' as "Apr 2, 12:00";
|
||||
Apr 2, 12:00
|
||||
------------------------------
|
||||
Sat Apr 02 12:00:00 2005 CST
|
||||
(1 row)
|
||||
|
||||
-SELECT timestamp with time zone '2005-04-03 12:00-06' - interval '24 hours' as "Apr 2, 11:00";
|
||||
+SELECT timestamp with time zone '2005-04-03 12:00-05' - interval '24 hours' as "Apr 2, 11:00";
|
||||
Apr 2, 11:00
|
||||
------------------------------
|
||||
Sat Apr 02 11:00:00 2005 CST
|
||||
Index: src/test/regress/pg_regress.c
|
||||
===================================================================
|
||||
--- src/test/regress/pg_regress.c.orig
|
||||
+++ src/test/regress/pg_regress.c
|
||||
@@ -64,7 +64,7 @@ static char *shellprog = SHELLPROG;
|
||||
*/
|
||||
#ifndef WIN32
|
||||
const char *basic_diff_opts = "";
|
||||
-const char *pretty_diff_opts = "-U3";
|
||||
+const char *pretty_diff_opts = "-U5";
|
||||
#else
|
||||
const char *basic_diff_opts = "-w";
|
||||
const char *pretty_diff_opts = "-w -U3";
|
||||
Index: src/test/regress/sql/horology.sql
|
||||
===================================================================
|
||||
--- src/test/regress/sql/horology.sql.orig
|
||||
+++ src/test/regress/sql/horology.sql
|
||||
@@ -122,11 +122,11 @@ SELECT (timestamp with time zone 'tomorr
|
||||
SELECT (timestamp with time zone 'tomorrow' > 'now') as "True";
|
||||
|
||||
-- timestamp with time zone, interval arithmetic around DST change
|
||||
-SET TIME ZONE 'CST7CDT';
|
||||
-SELECT timestamp with time zone '2005-04-02 12:00-07' + interval '1 day' as "Apr 3, 12:00";
|
||||
-SELECT timestamp with time zone '2005-04-02 12:00-07' + interval '24 hours' as "Apr 3, 13:00";
|
||||
-SELECT timestamp with time zone '2005-04-03 12:00-06' - interval '1 day' as "Apr 2, 12:00";
|
||||
-SELECT timestamp with time zone '2005-04-03 12:00-06' - interval '24 hours' as "Apr 2, 11:00";
|
||||
+SET TIME ZONE 'CST6CDT';
|
||||
+SELECT timestamp with time zone '2005-04-02 12:00-06' + interval '1 day' as "Apr 3, 12:00";
|
||||
+SELECT timestamp with time zone '2005-04-02 12:00-06' + interval '24 hours' as "Apr 3, 13:00";
|
||||
+SELECT timestamp with time zone '2005-04-03 12:00-05' - interval '1 day' as "Apr 2, 12:00";
|
||||
+SELECT timestamp with time zone '2005-04-03 12:00-05' - interval '24 hours' as "Apr 2, 11:00";
|
||||
RESET TIME ZONE;
|
||||
|
||||
|
7
postgresql-rpmlintrc
Normal file
7
postgresql-rpmlintrc
Normal file
@ -0,0 +1,7 @@
|
||||
addFilter("useless-explicit-provides")
|
||||
addFilter("unnecessary-buildrequires")
|
||||
addFilter("patch-not-applied")
|
||||
addFilter("non-standard-uid")
|
||||
addFilter("file-not-in-%lang")
|
||||
addFilter("no-dependency-on")
|
||||
addFilter("no-soname")
|
54
postgresql-testsuite-int8.sql.patch
Normal file
54
postgresql-testsuite-int8.sql.patch
Normal file
@ -0,0 +1,54 @@
|
||||
commit a210bee6273041cf9773383e2dda58a7d7c84be4
|
||||
Author: yac <yac@blesmrt.net>
|
||||
Date: Fri Mar 8 17:56:58 2013 +0100
|
||||
|
||||
+ SET LC_
|
||||
|
||||
Index: postgresql-11beta1/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
|
||||
| -4567890123456789.000
|
||||
(5 rows)
|
||||
|
||||
+SET LC_MONETARY='C';
|
||||
SELECT '' AS to_char_13, to_char(q2, 'L9999999999999999.000') FROM INT8_TBL;
|
||||
to_char_13 | to_char
|
||||
------------+------------------------
|
||||
Index: postgresql-11beta1/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
|
||||
| -24926804.04504742
|
||||
(10 rows)
|
||||
|
||||
+SET LC_MONETARY='C';
|
||||
SELECT '' AS to_char_16, to_char(val, 'L9999999999999999.099999999999999') FROM num_data;
|
||||
to_char_16 | to_char
|
||||
------------+------------------------------------
|
||||
Index: postgresql-11beta1/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
|
||||
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_12, to_char(q2, 'FM9999999999999999.000') FROM INT8_TBL;
|
||||
+SET LC_MONETARY='C';
|
||||
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_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
|
||||
===================================================================
|
||||
--- 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
|
||||
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_15, to_char(val, 'FM9999999990999999.099999999999999') FROM num_data;
|
||||
+SET LC_MONETARY='C';
|
||||
SELECT '' AS to_char_16, to_char(val, 'L9999999999999999.099999999999999') FROM num_data;
|
||||
SELECT '' AS to_char_17, to_char(val, 'FM9999999999999999.99999999999999') FROM num_data;
|
||||
SELECT '' AS to_char_18, to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
|
18
postgresql-testsuite-keep-results-file.patch
Normal file
18
postgresql-testsuite-keep-results-file.patch
Normal file
@ -0,0 +1,18 @@
|
||||
commit 463154c669010cffc0e96b683576f1e879b61d8b
|
||||
Author: yac <yac@blesmrt.net>
|
||||
Date: Mon Mar 11 18:42:39 2013 +0100
|
||||
|
||||
don't unlink the result file
|
||||
|
||||
Index: postgresql-12beta2/src/test/regress/pg_regress.c
|
||||
===================================================================
|
||||
--- postgresql-12beta2.orig/src/test/regress/pg_regress.c
|
||||
+++ postgresql-12beta2/src/test/regress/pg_regress.c
|
||||
@@ -2597,7 +2597,6 @@ regression_main(int argc, char *argv[],
|
||||
else
|
||||
{
|
||||
unlink(difffilename);
|
||||
- unlink(logfilename);
|
||||
}
|
||||
|
||||
if (fail_count != 0)
|
69
postgresql-var-run-socket.patch
Normal file
69
postgresql-var-run-socket.patch
Normal file
@ -0,0 +1,69 @@
|
||||
Change the built-in default socket directory to be /var/run/postgresql.
|
||||
For backwards compatibility with (probably non-libpq-based) clients that
|
||||
might still expect to find the socket in /tmp, also create a socket in
|
||||
/tmp. This is to resolve communication problems with clients operating
|
||||
under systemd's PrivateTmp environment, which won't be using the same
|
||||
global /tmp directory as the server; see bug #825448.
|
||||
|
||||
Note that we apply the socket directory change at the level of the
|
||||
hard-wired defaults in the C code, not by just twiddling the setting in
|
||||
postgresql.conf.sample; this is so that the change will take effect on
|
||||
server package update, without requiring any existing postgresql.conf
|
||||
to be updated. (Of course, a user who dislikes this behavior can still
|
||||
override it via postgresql.conf.)
|
||||
|
||||
|
||||
Index: src/bin/pg_upgrade/test.sh
|
||||
===================================================================
|
||||
--- src/bin/pg_upgrade/test.sh.orig
|
||||
+++ src/bin/pg_upgrade/test.sh
|
||||
@@ -64,7 +64,9 @@ case $testhost in
|
||||
;;
|
||||
esac
|
||||
|
||||
-POSTMASTER_OPTS="-F -c listen_addresses=\"$LISTEN_ADDRESSES\" -k \"$PGHOST\""
|
||||
+# we want the Unix sockets in $temp_root
|
||||
+PGHOST=$temp_root
|
||||
+POSTMASTER_OPTS="-F -c listen_addresses=\"$LISTEN_ADDRESSES\" -k \"$PGHOST\" -c unix_socket_directories='$PGHOST'"
|
||||
export PGHOST
|
||||
|
||||
# don't rely on $PWD here, as old shells don't set it
|
||||
Index: src/backend/utils/misc/guc.c
|
||||
===================================================================
|
||||
--- src/backend/utils/misc/guc.c.orig
|
||||
+++ src/backend/utils/misc/guc.c
|
||||
@@ -3954,7 +3954,7 @@ static struct config_string ConfigureNam
|
||||
},
|
||||
&Unix_socket_directories,
|
||||
#ifdef HAVE_UNIX_SOCKETS
|
||||
- DEFAULT_PGSOCKET_DIR,
|
||||
+ DEFAULT_PGSOCKET_DIR ", /tmp",
|
||||
#else
|
||||
"",
|
||||
#endif
|
||||
Index: src/bin/initdb/initdb.c
|
||||
===================================================================
|
||||
--- src/bin/initdb/initdb.c.orig
|
||||
+++ src/bin/initdb/initdb.c
|
||||
@@ -1103,7 +1103,7 @@ setup_config(void)
|
||||
|
||||
#ifdef HAVE_UNIX_SOCKETS
|
||||
snprintf(repltok, sizeof(repltok), "#unix_socket_directories = '%s'",
|
||||
- DEFAULT_PGSOCKET_DIR);
|
||||
+ DEFAULT_PGSOCKET_DIR ", /tmp");
|
||||
#else
|
||||
snprintf(repltok, sizeof(repltok), "#unix_socket_directories = ''");
|
||||
#endif
|
||||
Index: src/include/pg_config_manual.h
|
||||
===================================================================
|
||||
--- src/include/pg_config_manual.h.orig
|
||||
+++ src/include/pg_config_manual.h
|
||||
@@ -179,7 +179,7 @@
|
||||
* here's where to twiddle it. You can also override this at runtime
|
||||
* with the postmaster's -k switch.
|
||||
*/
|
||||
-#define DEFAULT_PGSOCKET_DIR "/tmp"
|
||||
+#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql"
|
||||
|
||||
/*
|
||||
* This is the default event source for Windows event log.
|
5
postgresql12.changes
Normal file
5
postgresql12.changes
Normal file
@ -0,0 +1,5 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 7 09:03:24 UTC 2019 - Marcus Rueckert <mrueckert@suse.de>
|
||||
|
||||
- initial package for the postgresql 12 branch
|
||||
https://www.postgresql.org/about/news/1976/
|
839
postgresql12.spec
Normal file
839
postgresql12.spec
Normal file
@ -0,0 +1,839 @@
|
||||
#
|
||||
# spec file for package postgresql11
|
||||
#
|
||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
%if 0%{?suse_version} >= 1300
|
||||
%bcond_without systemd
|
||||
%else
|
||||
%bcond_with systemd
|
||||
%endif
|
||||
%if 0%{?suse_version} >= 1500
|
||||
%bcond_without systemd_notify
|
||||
%bcond_without llvm
|
||||
%else
|
||||
%bcond_with systemd_notify
|
||||
%bcond_with llvm
|
||||
%endif
|
||||
|
||||
%bcond_without selinux
|
||||
%bcond_without icu
|
||||
%ifnarch %arm
|
||||
%bcond_without check
|
||||
%else
|
||||
%bcond_with check
|
||||
%endif
|
||||
|
||||
%define pgmajor 12
|
||||
%define pgname postgresql%pgmajor
|
||||
%define priority %{pgmajor}
|
||||
%define libpq libpq5
|
||||
%define libecpg libecpg6
|
||||
%define libpq_so libpq.so.5
|
||||
%define libecpg_so libecpg.so.6
|
||||
%define pgbasedir %_prefix/lib/%pgname
|
||||
%define pgtestdir %pgbasedir/test
|
||||
%define pgbindir %pgbasedir/bin
|
||||
%define pglibdir %pgbasedir/%_lib
|
||||
%define pgincludedir %_includedir/pgsql
|
||||
%define pgdatadir %_datadir/%pgname
|
||||
%define pgdocdir %_docdir/%pgname
|
||||
%define pgextensiondir %pgdatadir/extension
|
||||
%define pgcontribdir %pgdatadir/contrib
|
||||
%define pgmandir %_mandir
|
||||
|
||||
%if "@BUILD_FLAVOR@" == "libs"
|
||||
Name: %pgname-libs
|
||||
%define buildmain 0
|
||||
%define buildlibs 1
|
||||
%define builddevel 1
|
||||
%else
|
||||
Name: %pgname
|
||||
%define buildmain 1
|
||||
%define buildlibs 0
|
||||
%define builddevel 0
|
||||
%endif
|
||||
|
||||
%if %buildmain
|
||||
BuildRequires: docbook_4
|
||||
BuildRequires: gettext-devel
|
||||
BuildRequires: libuuid-devel
|
||||
BuildRequires: ncurses-devel
|
||||
BuildRequires: pam-devel
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: readline-devel
|
||||
BuildRequires: tcl-devel
|
||||
BuildRequires: timezone
|
||||
BuildRequires: zlib-devel
|
||||
#
|
||||
%endif
|
||||
|
||||
BuildRequires: fdupes
|
||||
%if %{with icu}
|
||||
BuildRequires: libicu-devel
|
||||
%endif
|
||||
%if %{with selinux}
|
||||
BuildRequires: libselinux-devel
|
||||
%endif
|
||||
%if %{with llvm}
|
||||
BuildRequires: clang-devel
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: llvm-devel
|
||||
%endif
|
||||
BuildRequires: libxslt-devel
|
||||
BuildRequires: openldap2-devel
|
||||
BuildRequires: openssl-devel
|
||||
BuildRequires: pkg-config
|
||||
%if 0%{?suse_version} == 1110
|
||||
BuildRequires: krb5-devel
|
||||
%else
|
||||
BuildRequires: pkgconfig(krb5)
|
||||
%endif
|
||||
%if %{with systemd_notify}
|
||||
BuildRequires: pkgconfig(libsystemd)
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
%endif
|
||||
#!BuildIgnore: %pgname
|
||||
#!BuildIgnore: %pgname-server
|
||||
#!BuildIgnore: postgresql-implementation
|
||||
#!BuildIgnore: postgresql-server-implementation
|
||||
Summary: Basic Clients and Utilities for PostgreSQL
|
||||
License: PostgreSQL
|
||||
Group: Productivity/Databases/Tools
|
||||
Version: 12.0
|
||||
Release: 0
|
||||
%define pkg_version 12.0
|
||||
Source0: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{pkg_version}.tar.bz2
|
||||
Source1: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{pkg_version}.tar.bz2.sha256
|
||||
Source2: baselibs.conf
|
||||
Source3: postgresql-README.SUSE
|
||||
Source17: postgresql-rpmlintrc
|
||||
Source18: series
|
||||
Patch1: postgresql-conf.patch
|
||||
Patch2: postgresql-regress.patch
|
||||
# PL/Perl needs to be linked with rpath (bsc#578053)
|
||||
Patch4: postgresql-plperl-keep-rpath.patch
|
||||
Patch6: postgresql-testsuite-int8.sql.patch
|
||||
Patch8: postgresql-testsuite-keep-results-file.patch
|
||||
Patch9: postgresql-var-run-socket.patch
|
||||
Url: https://www.postgresql.org/
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Provides: postgresql = %version-%release
|
||||
Provides: postgresql-implementation = %version-%release
|
||||
Requires: %libpq >= %version
|
||||
Requires(post): postgresql-noarch >= %pgmajor
|
||||
Requires(postun): postgresql-noarch >= %pgmajor
|
||||
|
||||
%description
|
||||
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 basic utility and client programs necessary
|
||||
to maintain and work with local or remote PostgreSQL databases as well
|
||||
as manual pages for the SQL commands that PostgreSQL supports. Full
|
||||
HTML documentation for PostgreSQL can be found in the postgresql-docs
|
||||
package.
|
||||
|
||||
%package -n %libpq
|
||||
Summary: Shared Libraries Required for PostgreSQL Clients
|
||||
Group: Productivity/Databases/Clients
|
||||
Provides: postgresql-libs:%_libdir/libpq.so.5
|
||||
Obsoletes: postgresql-libs < %version
|
||||
# bug437293
|
||||
%if "%_lib" == "lib64"
|
||||
Conflicts: %libpq-32bit < %version
|
||||
%endif
|
||||
%ifarch ia64
|
||||
Conflicts: %libpq-x86 < %version
|
||||
%endif
|
||||
%ifarch ppc64
|
||||
Obsoletes: postgresql-libs-64bit
|
||||
%endif
|
||||
|
||||
%description -n %libpq
|
||||
|
||||
PostgreSQL is an advanced object-relational database management system
|
||||
that supports an extended subset of the SQL standard, including
|
||||
transactions, foreign keys, subqueries, triggers, user-defined types
|
||||
and functions.
|
||||
|
||||
This package provides the client library that most PostgreSQL client
|
||||
program or language bindings are using.
|
||||
|
||||
%package -n %libecpg
|
||||
|
||||
Summary: Shared Libraries Required for PostgreSQL Clients
|
||||
Group: Productivity/Databases/Clients
|
||||
Provides: postgresql-libs:%_libdir/libecpg.so.6
|
||||
|
||||
%description -n %libecpg
|
||||
PostgreSQL is an advanced object-relational database management system
|
||||
that supports an extended subset of the SQL standard, including
|
||||
transactions, foreign keys, subqueries, triggers, user-defined types
|
||||
and functions.
|
||||
|
||||
This package provides the runtime library of the embedded SQL C
|
||||
preprocessor for PostgreSQL.
|
||||
|
||||
%if %builddevel
|
||||
%package -n %pgname-devel
|
||||
Summary: PostgreSQL client development header files and libraries
|
||||
Group: Development/Libraries/C and C++
|
||||
Provides: postgresql-devel-implementation = %version-%release
|
||||
Requires: %libecpg >= %version
|
||||
Requires: %libpq >= %version
|
||||
Requires(post): postgresql-noarch >= %pgmajor
|
||||
Requires(postun): postgresql-noarch >= %pgmajor
|
||||
# Installation of postgresql??-devel is exclusive
|
||||
Provides: postgresql-devel-exclusive = %pgmajor
|
||||
Conflicts: postgresql-devel-exclusive < %pgmajor
|
||||
|
||||
%description -n %pgname-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 applications which will directly interact with a PostgreSQL database
|
||||
management server and the ECPG Embedded C Postgres preprocessor. You
|
||||
need to install this package if you want to develop applications in C
|
||||
which will interact with a PostgreSQL server.
|
||||
|
||||
For building PostgreSQL server extensions, see the
|
||||
postgresql%pgmajor-server-devel package.
|
||||
|
||||
%endif
|
||||
|
||||
%if %buildmain
|
||||
|
||||
%package server
|
||||
Summary: The Programs Needed to Create and Run a PostgreSQL Server
|
||||
Group: Productivity/Databases/Servers
|
||||
PreReq: /sbin/chkconfig
|
||||
PreReq: postgresql = %version
|
||||
Requires: glibc-locale
|
||||
Requires: timezone
|
||||
Recommends: %{name}-llvmjit
|
||||
Provides: postgresql-server-implementation = %version-%release
|
||||
Requires: %libpq >= %version
|
||||
Requires(pre): postgresql-server-noarch >= %pgmajor
|
||||
Requires(preun): postgresql-server-noarch >= %pgmajor
|
||||
Requires(postun): postgresql-server-noarch >= %pgmajor
|
||||
Requires(post): postgresql-noarch >= %pgmajor
|
||||
Requires(postun): postgresql-noarch >= %pgmajor
|
||||
|
||||
%description server
|
||||
PostgreSQL is an advanced object-relational database management system
|
||||
that supports an extended subset of the SQL standard, including
|
||||
transactions, foreign keys, sub-queries, triggers, and user-defined
|
||||
types and functions.
|
||||
|
||||
This package includes the programs needed to create and run a
|
||||
PostgreSQL server, which will in turn allow you to create and maintain
|
||||
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
|
||||
|
||||
%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
|
||||
Summary: Just-in-time compilation support for PostgreSQL
|
||||
Group: Productivity/Databases/Servers
|
||||
Provides: postgresql-llvmjit-implementation = %version-%release
|
||||
Requires: %pgname-server = %version-%release
|
||||
Requires: postgresql-llvmjit-noarch >= %pgmajor
|
||||
|
||||
%description llvmjit
|
||||
PostgreSQL is an advanced object-relational database management system
|
||||
that supports an extended subset of the SQL standard, including
|
||||
transactions, foreign keys, sub-queries, triggers, and user-defined
|
||||
types and functions.
|
||||
|
||||
This package contains support for just-in-time compiling parts of
|
||||
PostgreSQL queries. Using LLVM it compiles e.g. expressions and tuple
|
||||
deforming into native code, with the goal of accelerating analytics
|
||||
queries.
|
||||
%endif
|
||||
|
||||
%package test
|
||||
Summary: The test suite for PostgreSQL
|
||||
Group: Productivity/Databases/Servers
|
||||
Provides: postgresql-test-implementation = %version-%release
|
||||
Requires: %pgname-server = %version
|
||||
Requires: postgresql-test-noarch >= %pgmajor
|
||||
|
||||
%description test
|
||||
This package contains the sources and pre-built binaries of various
|
||||
tests for the PostgreSQL database management system, including
|
||||
regression tests and benchmarks.
|
||||
|
||||
%package docs
|
||||
Summary: HTML Documentation for PostgreSQL
|
||||
Group: Productivity/Databases/Tools
|
||||
Provides: postgresql-docs-implementation = %version-%release
|
||||
Requires: postgresql-docs-noarch >= %pgmajor
|
||||
%if 0%{?suse_version} >= 1120
|
||||
BuildArch: noarch
|
||||
%endif
|
||||
|
||||
%description docs
|
||||
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 HTML documentation for PostgreSQL. The start
|
||||
page is: file:///usr/share/doc/packages/%pgname/html/index.html .
|
||||
Manual pages for the PostgreSQL SQL statements can be found in the
|
||||
postgresql package.
|
||||
|
||||
%package contrib
|
||||
Summary: Contributed Extensions and Additions to PostgreSQL
|
||||
Group: Productivity/Databases/Tools
|
||||
Provides: postgresql-contrib-implementation = %version-%release
|
||||
Requires: postgresql-contrib-noarch >= %pgmajor
|
||||
Requires(post): %pgname >= %pgmajor
|
||||
Requires: %pgname >= %pgmajor
|
||||
PreReq: %pgname-server = %version-%release
|
||||
|
||||
%description contrib
|
||||
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.
|
||||
|
||||
The postgresql-contrib package includes extensions and additions that
|
||||
are distributed along with the PostgreSQL sources, but are not (yet)
|
||||
officially part of the PostgreSQL core.
|
||||
|
||||
Documentation for the modules contained in this package can be found in
|
||||
/usr/share/doc/packages/postgresql/contrib.
|
||||
|
||||
%package plperl
|
||||
Summary: The PL/Tcl, PL/Perl, and PL/Python procedural languages for PostgreSQL
|
||||
Group: Productivity/Databases/Servers
|
||||
Provides: postgresql-plperl-implementation = %version-%release
|
||||
Requires: %pgname-server = %version-%release
|
||||
Requires: perl = %perl_version
|
||||
Requires: postgresql-plperl-noarch >= %pgmajor
|
||||
|
||||
%description plperl
|
||||
This package contains the the PL/Tcl, PL/Perl, and PL/Python procedural
|
||||
languages for the back-end. With these modules one can use Perl,
|
||||
Python, and Tcl to write stored procedures, functions and triggers.
|
||||
|
||||
PostgreSQL also offers the builtin procedural language PL/SQL.
|
||||
|
||||
%package plpython
|
||||
Summary: The PL/Python Procedural Languages for PostgreSQL
|
||||
Group: Productivity/Databases/Servers
|
||||
Provides: postgresql-plpython-implementation = %version-%release
|
||||
Requires: %pgname-server = %version-%release
|
||||
Requires: postgresql-plpython-noarch >= %pgmajor
|
||||
Requires: python
|
||||
|
||||
%description plpython
|
||||
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 PL/Python procedural language for PostgreSQL.
|
||||
With this module one can use Python to write stored procedures,
|
||||
functions, and triggers.
|
||||
|
||||
PostgreSQL also offers the built-in procedural language PL/SQL which is
|
||||
included in the postgresql-server package.
|
||||
|
||||
%package pltcl
|
||||
Summary: PL/Tcl Procedural Language for PostgreSQL
|
||||
Group: Productivity/Databases/Tools
|
||||
Provides: postgresql-pltcl-implementation = %version-%release
|
||||
Requires: %pgname-server = %version
|
||||
Requires: postgresql-pltcl-noarch >= %pgmajor
|
||||
Requires: tcl
|
||||
|
||||
%description pltcl
|
||||
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 PL/Tcl procedural language for PostgreSQL.
|
||||
With thie module one can use Tcl to write stored procedures, functions,
|
||||
and triggers.
|
||||
|
||||
PostgreSQL also offers the built-in procedural language PL/SQL which is
|
||||
included in the postgresql-server package.
|
||||
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q -n postgresql-%pkg_version
|
||||
# Keep the timestamp of configure, because patching it would otherwise
|
||||
# confuse PostgreSQL's build system
|
||||
touch -r configure tmp
|
||||
%patch1
|
||||
%patch2
|
||||
%patch4
|
||||
%patch6 -p1
|
||||
%patch8 -p1
|
||||
%patch9
|
||||
touch -r tmp configure
|
||||
rm tmp
|
||||
find src/test/ -name '*.orig' -delete
|
||||
find -name .gitignore -delete
|
||||
|
||||
%build
|
||||
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
|
||||
export PYTHON=python3
|
||||
PACKAGE_TARNAME=%pgname %configure \
|
||||
--bindir=%pgbindir \
|
||||
--libdir=%pglibdir \
|
||||
--includedir=%pgincludedir \
|
||||
--datadir=%pgdatadir \
|
||||
--docdir=%pgdocdir \
|
||||
--mandir=%pgmandir \
|
||||
--disable-rpath \
|
||||
--enable-nls \
|
||||
--enable-thread-safety \
|
||||
--enable-integer-datetimes \
|
||||
%if %buildmain
|
||||
--with-python \
|
||||
--with-perl \
|
||||
--with-tcl \
|
||||
--with-tclconfig=%_libdir \
|
||||
--with-pam \
|
||||
--with-uuid=e2fs \
|
||||
--with-libxml \
|
||||
--with-libxslt \
|
||||
%if %{with systemd_notify}
|
||||
--with-systemd \
|
||||
%endif
|
||||
%if %{with selinux}
|
||||
--with-selinux \
|
||||
%endif
|
||||
%if %{with icu}
|
||||
--with-icu \
|
||||
%endif
|
||||
%if %{with llvm}
|
||||
--with-llvm \
|
||||
%endif
|
||||
%else
|
||||
--without-readline \
|
||||
%endif
|
||||
--with-openssl \
|
||||
--with-ldap \
|
||||
--with-gssapi \
|
||||
--with-krb5 \
|
||||
--with-system-tzdata=/usr/share/zoneinfo
|
||||
%if !%buildmain
|
||||
# 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}
|
||||
%else
|
||||
make %{?_smp_mflags} PACKAGE_TARNAME=%pgname
|
||||
|
||||
%if %{with check}
|
||||
|
||||
%check
|
||||
#
|
||||
# Run the regression tests.
|
||||
#
|
||||
make check || {
|
||||
for f in src/test/regress/log/* {,src/test/regress/}regression.diffs; do
|
||||
if test -f $f; then
|
||||
cat $f
|
||||
fi
|
||||
done
|
||||
exit 1
|
||||
}
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%install
|
||||
%if %buildmain
|
||||
make DESTDIR=%buildroot PACKAGE_TARNAME=%pgname install install-docs
|
||||
mv %buildroot%pgincludedir/{server,..}
|
||||
make DESTDIR=%buildroot PACKAGE_TARNAME=%pgname -C src/interfaces uninstall
|
||||
rm -rf %buildroot%pgincludedir/*
|
||||
mv %buildroot%pgincludedir{/../server,}
|
||||
|
||||
# {{{ the test package
|
||||
mkdir -p %buildroot%pgtestdir/regress
|
||||
install -sm 0755 contrib/spi/{refint.so,autoinc.so} %buildroot%pgtestdir/regress
|
||||
install -sm 0755 src/test/regress/{pg_regress,regress.so} %buildroot%pgtestdir/regress
|
||||
for i in src/test/regress/{data,expected,input,output,sql}; do
|
||||
cp -r $i %buildroot%pgtestdir/regress/
|
||||
done
|
||||
install -m 0644 src/test/regress/{serial,parallel}_schedule %buildroot%pgtestdir/regress
|
||||
# }}}
|
||||
%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
|
||||
mkdir -p %buildroot/%_libdir
|
||||
ls %buildroot%pglibdir/lib* |
|
||||
grep -v walreceiver |
|
||||
xargs mv -t %buildroot/%_libdir
|
||||
mv %buildroot%pglibdir/pkgconfig %buildroot%_libdir
|
||||
find %buildroot%_libdir/pkgconfig -type f -exec sed -i 's, -L%pglibdir,,' '{}' +
|
||||
|
||||
# Don't ship static libraries,
|
||||
# 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)
|
||||
%if %buildmain
|
||||
#
|
||||
# Install and collect the contrib stuff
|
||||
#
|
||||
touch flag; sleep 1 # otherwise we have installed files that are not newer than flag
|
||||
make DESTDIR=%buildroot -C contrib install
|
||||
find %buildroot -type f -cnewer flag -printf "/%%P\n" |
|
||||
grep -v -e %_docdir -e %pgbindir -e %pgincludedir -e %pglibdir/bitcode \
|
||||
> contrib.files
|
||||
rm flag
|
||||
install -d -m 750 %buildroot/var/lib/pgsql
|
||||
install -d -m755 %buildroot%pgdocdir
|
||||
cp doc/KNOWN_BUGS doc/MISSING_FEATURES COPYRIGHT \
|
||||
README HISTORY %buildroot%pgdocdir
|
||||
cp -a %SOURCE3 %buildroot%pgdocdir/README.SUSE
|
||||
# Use versioned names for the man pages:
|
||||
for f in %buildroot%pgmandir/man*/*; do
|
||||
mv $f ${f}pg%pgmajor
|
||||
done
|
||||
%endif
|
||||
|
||||
mkdir -p %buildroot{%_bindir,%_mandir/man1}
|
||||
mkdir -p %buildroot/etc/alternatives
|
||||
genlists ()
|
||||
{
|
||||
# usage: genlists packagename basenames
|
||||
PKG=$1
|
||||
shift
|
||||
for f in $@
|
||||
do
|
||||
BIN=%_bindir/$f
|
||||
ALTBIN=/etc/alternatives/$f
|
||||
PGBIN=%pgbindir/$f
|
||||
MAN=%pgmandir/man1/$f.1*
|
||||
|
||||
touch %buildroot$ALTBIN
|
||||
ln -s $ALTBIN %buildroot$BIN
|
||||
|
||||
echo "$PGBIN" >> $PKG.files
|
||||
echo "$BIN" >> $PKG.files
|
||||
echo "%ghost $ALTBIN" >> $PKG.files
|
||||
test -e %buildroot$MAN &&
|
||||
echo "%doc $MAN" >> $PKG.files
|
||||
%find_lang $f-%pgmajor $PKG.files ||:
|
||||
done
|
||||
}
|
||||
%if %buildmain
|
||||
genlists main \
|
||||
createdb clusterdb createuser dropdb \
|
||||
dropuser pg_dump pg_dumpall pg_restore pg_rewind psql vacuumdb \
|
||||
reindexdb pg_basebackup pg_receivewal pg_isready pg_recvlogical pg_checksums
|
||||
%find_lang plpgsql-%pgmajor main.files
|
||||
%find_lang pgscripts-%pgmajor main.files
|
||||
|
||||
genlists server \
|
||||
initdb pg_ctl pg_controldata pg_resetwal pg_waldump postgres postmaster
|
||||
|
||||
genlists server-devel \
|
||||
pg_config
|
||||
|
||||
genlists contrib \
|
||||
oid2name pg_archivecleanup pg_standby pg_test_fsync pg_upgrade \
|
||||
pgbench vacuumlo pg_test_timing
|
||||
for pl in plperl plpython pltcl; do
|
||||
%find_lang $pl-%{pgmajor} $pl.lang
|
||||
done
|
||||
ln -s /etc/alternatives/postgresql %buildroot/usr/lib/postgresql
|
||||
touch %buildroot/etc/alternatives/postgresql
|
||||
|
||||
# Remove mostly unneeded buildtime requirements for server extensions
|
||||
sed -i '/^LIBS = /s/= .*/=/' %buildroot/%pglibdir/pgxs/src/Makefile.global
|
||||
%endif
|
||||
|
||||
%if %builddevel
|
||||
# Make sure we can also link agaist newer versions
|
||||
pushd %buildroot%_libdir
|
||||
for f in *.so; do
|
||||
ln -sf $f.? $f
|
||||
done
|
||||
popd
|
||||
mkdir -p %buildroot%pgmandir/man1
|
||||
cp -a doc/src/sgml/man1/ecpg.1 %buildroot%pgmandir/man1/ecpg.1pg%pgmajor
|
||||
genlists devel ecpg
|
||||
|
||||
# Build up the file lists for the libpq and libecpg packages
|
||||
cat > libpq.files <<EOF
|
||||
%defattr(-,root,root)
|
||||
%dir %pgdatadir
|
||||
%_libdir/libpq.so.5
|
||||
%_libdir/libpq.so.5.%pgmajor
|
||||
%pgdatadir/pg_service.conf.sample
|
||||
EOF
|
||||
%find_lang libpq5-%{pgmajor} libpq.files
|
||||
|
||||
cat > libecpg.files <<EOF
|
||||
%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
|
||||
%find_lang ecpglib6-%{pgmajor} libecpg.files
|
||||
|
||||
%if !%buildlibs
|
||||
# Delete the contents of the libs and devel packages, if we don't want to build them
|
||||
awk -v P=%buildroot '/^(%lang|[^%])/{print P $NF}' libpq.files libecpg.files | xargs rm
|
||||
%endif
|
||||
%else # !devel
|
||||
rm -f %buildroot%pgmandir/man1/ecpg.*
|
||||
%endif
|
||||
|
||||
%fdupes %buildroot
|
||||
|
||||
%if %buildmain
|
||||
|
||||
%postun
|
||||
/usr/share/postgresql/install-alternatives %priority
|
||||
|
||||
%post
|
||||
/usr/share/postgresql/install-alternatives %priority
|
||||
|
||||
%post server
|
||||
/usr/share/postgresql/install-alternatives %priority
|
||||
|
||||
%preun server
|
||||
# Stop only when we are uninstalling the currently running version
|
||||
test -n "$FIRST_ARG" || FIRST_ARG="$1"
|
||||
if [ "$FIRST_ARG" -eq 0 -a -x /usr/bin/systemctl ]; then
|
||||
%if %{with systemd}
|
||||
%define stop %_stop_on_removal postgresql.service
|
||||
eval $(systemctl show postgresql --property=MainPID)
|
||||
%else
|
||||
%define stop /sbin/init.d postgresql stop
|
||||
MainPID=$(pidof -s postgres) || :
|
||||
%endif
|
||||
if test -n "$MainPID" && test "$MainPID" -ne 0; then
|
||||
BIN=$(readlink -n /proc/$MainPID/exe)
|
||||
DIR=$(dirname ${BIN% *})
|
||||
if test "$DIR" = "%pgbindir" -o "$DIR" = "%_bindir"; then
|
||||
%stop
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
%postun server
|
||||
/usr/share/postgresql/install-alternatives %priority
|
||||
# Restart only when we are updating the currently running version
|
||||
# or from the old packaging scheme
|
||||
test -n "$FIRST_ARG" || FIRST_ARG="$1"
|
||||
if [ "$FIRST_ARG" -ge 1 ]; then
|
||||
%if %{with systemd}
|
||||
%define restart %_restart_on_update postgresql.service
|
||||
eval $(systemctl show postgresql --property=MainPID)
|
||||
%else
|
||||
%define restart /sbin/init.d postgresql restart
|
||||
MainPID=$(pidof -s postgres) || :
|
||||
%endif
|
||||
if test -n "$MainPID" && test "$MainPID" -ne 0 &&
|
||||
readlink -n /proc/$MainPID/exe | grep -Fq " (deleted)"
|
||||
then
|
||||
BIN=$(readlink -n /proc/$MainPID/exe)
|
||||
DIR=$(dirname ${BIN% *})
|
||||
if test "$DIR" = "%pgbindir" -o "$DIR" = "%_bindir"; then
|
||||
%restart
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
%post contrib
|
||||
/usr/share/postgresql/install-alternatives %priority
|
||||
|
||||
%postun contrib
|
||||
/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 %builddevel
|
||||
|
||||
%post -n %pgname-devel
|
||||
/usr/share/postgresql/install-alternatives %priority
|
||||
|
||||
%postun -n %pgname-devel
|
||||
/usr/share/postgresql/install-alternatives %priority
|
||||
%endif
|
||||
|
||||
%if %buildlibs
|
||||
%post -n %libpq -p /sbin/ldconfig
|
||||
|
||||
%postun -n %libpq -p /sbin/ldconfig
|
||||
|
||||
%post -n %libecpg -p /sbin/ldconfig
|
||||
|
||||
%postun -n %libecpg -p /sbin/ldconfig
|
||||
%endif
|
||||
|
||||
%if %buildmain
|
||||
|
||||
%files -f main.files
|
||||
%defattr(-,root,root)
|
||||
%dir %pgbindir
|
||||
%doc %pgmandir/man7/*
|
||||
%docdir %pgdocdir
|
||||
%dir %pgdocdir
|
||||
%pgdocdir/[[:upper:]]*
|
||||
%dir %pglibdir
|
||||
/usr/lib/postgresql
|
||||
%ghost /etc/alternatives/postgresql
|
||||
|
||||
%files test
|
||||
%defattr(-,root,root,-)
|
||||
%pgtestdir
|
||||
|
||||
%files docs
|
||||
%defattr(-,root,root)
|
||||
%doc %pgmandir/man3/*
|
||||
%docdir %pgdocdir
|
||||
%dir %pgdocdir
|
||||
%pgdocdir/html
|
||||
|
||||
%files contrib -f contrib.files
|
||||
%defattr(-,root,root)
|
||||
%docdir %pgdocdir
|
||||
%dir %pgdocdir
|
||||
%pgdocdir/extension
|
||||
%dir %pgdatadir
|
||||
%dir %pgcontribdir
|
||||
/usr/lib/postgresql
|
||||
|
||||
%files server -f server.files
|
||||
%defattr(-,root,root)
|
||||
%dir %pgbasedir
|
||||
%dir %pgextensiondir
|
||||
%dir %pglibdir
|
||||
%pglibdir/pgoutput.so
|
||||
%pglibdir/plpgsql.so
|
||||
%pglibdir/dict_snowball.so
|
||||
%pgdatadir/tsearch_data
|
||||
%exclude %pgdatadir/tsearch_data/*.rules
|
||||
%dir %pgdatadir
|
||||
/usr/lib/postgresql
|
||||
%pgdatadir/timezone*
|
||||
%pgdatadir/*.*
|
||||
%if %buildlibs
|
||||
%exclude %pgdatadir/pg_service.conf.sample
|
||||
%endif
|
||||
#exclude %pgdatadir/*.pltcl
|
||||
%pglibdir/*_and_*.so
|
||||
%pglibdir/euc2004_sjis2004.so
|
||||
%pglibdir/libpqwalreceiver.so
|
||||
%if %{with llvm}
|
||||
%dir %pglibdir/bitcode
|
||||
%endif
|
||||
%pgextensiondir/plpgsql*
|
||||
%attr(750,postgres,postgres) %dir /var/lib/pgsql
|
||||
|
||||
%if %{with llvm}
|
||||
%files llvmjit
|
||||
%pglibdir/llvm*
|
||||
%pglibdir/bitcode/*
|
||||
%endif
|
||||
|
||||
%files server-devel -f server-devel.files
|
||||
%defattr(-,root,root)
|
||||
%pgincludedir
|
||||
%pglibdir/pgxs
|
||||
%_libdir/lib*.a
|
||||
|
||||
%files pltcl -f pltcl.lang
|
||||
%defattr(-,root,root)
|
||||
%pgextensiondir/pltcl*
|
||||
%pglibdir/pltcl.so
|
||||
#pgdatadir/*.pltcl
|
||||
#pgbindir/pltcl*
|
||||
|
||||
%files plperl -f plperl.lang
|
||||
%defattr(-,root,root)
|
||||
%pgextensiondir/plperl*
|
||||
%pglibdir/plperl.so
|
||||
|
||||
%files plpython -f plpython.lang
|
||||
%defattr(-,root,root)
|
||||
%pgextensiondir/plpython*
|
||||
%pglibdir/plpython*.so
|
||||
|
||||
%endif
|
||||
%if %buildlibs
|
||||
|
||||
%files -n %libpq -f libpq.files
|
||||
|
||||
%files -n %libecpg -f libecpg.files
|
||||
|
||||
%endif
|
||||
|
||||
%if %builddevel
|
||||
|
||||
%files -n %pgname-devel -f devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %pgbasedir
|
||||
%dir %pgbindir
|
||||
%_libdir/pkgconfig/*
|
||||
%_libdir/lib*.so
|
||||
%pgincludedir
|
||||
|
||||
%endif
|
||||
|
||||
%changelog
|
Loading…
Reference in New Issue
Block a user