From 0e04f8fc5eed175e60aa1cd01b6fae38e3a163ac Mon Sep 17 00:00:00 2001 From: DistroBaker Date: Fri, 30 Oct 2020 15:07:00 +0100 Subject: [PATCH] Merged update from upstream sources This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/libecpg.git#82d1535e954a3a86ae227645fa1db1cbaa1adfa2 --- .gitignore | 1 + README.md | 3 + generate-sources.sh | 12 ++ libecpg-10.5-no-compat-lib.patch | 16 +++ libecpg-10.5-rpm-pgsql.patch | 72 ++++++++++++ libecpg-10.5-var-run-socket.patch | 53 +++++++++ libecpg-12.2-dependency-build.patch | 13 +++ libecpg-12.2-external-libpq.patch | 35 ++++++ libecpg.spec | 167 ++++++++++++++++++++++++++++ sources | 2 + 10 files changed, 374 insertions(+) create mode 100644 README.md create mode 100755 generate-sources.sh create mode 100644 libecpg-10.5-no-compat-lib.patch create mode 100644 libecpg-10.5-rpm-pgsql.patch create mode 100644 libecpg-10.5-var-run-socket.patch create mode 100644 libecpg-12.2-dependency-build.patch create mode 100644 libecpg-12.2-external-libpq.patch create mode 100644 libecpg.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..d83a125 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/postgresql-*.tar.bz2* diff --git a/README.md b/README.md new file mode 100644 index 0000000..0abf671 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# libecpg + +The libecpg package \ No newline at end of file diff --git a/generate-sources.sh b/generate-sources.sh new file mode 100755 index 0000000..1d53682 --- /dev/null +++ b/generate-sources.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +rm sources +set -e +spectool -S *.spec | cut -d' ' -f2 \ + | grep -E -e 'postgresql-.*\.tar\.*' -e 'postgresql.*\.pdf' | sort | \ +while read line +do + base=`basename "$line"` + echo " * handling $base" + sha512sum --tag "$base" >> sources +done diff --git a/libecpg-10.5-no-compat-lib.patch b/libecpg-10.5-no-compat-lib.patch new file mode 100644 index 0000000..d1d64e0 --- /dev/null +++ b/libecpg-10.5-no-compat-lib.patch @@ -0,0 +1,16 @@ +Nothing ever depended on libecpg_compat.so.3 in Fedora, so don't build +it now, at least till somebody explicitly requests that. + +diff --git a/src/interfaces/ecpg/Makefile b/src/interfaces/ecpg/Makefile +index 41460a1..cc3dd37 100644 +--- a/src/interfaces/ecpg/Makefile ++++ b/src/interfaces/ecpg/Makefile +@@ -2,7 +2,7 @@ subdir = src/interfaces/ecpg + top_builddir = ../../.. + include $(top_builddir)/src/Makefile.global + +-SUBDIRS = include pgtypeslib ecpglib compatlib preproc ++SUBDIRS = include pgtypeslib ecpglib preproc + + # Suppress parallel build of subdirectories to avoid a bug in GNU make 3.82, cf + # http://savannah.gnu.org/bugs/?30653 diff --git a/libecpg-10.5-rpm-pgsql.patch b/libecpg-10.5-rpm-pgsql.patch new file mode 100644 index 0000000..aec64ac --- /dev/null +++ b/libecpg-10.5-rpm-pgsql.patch @@ -0,0 +1,72 @@ +For the RPMs, we want the custom installation directories to end in +/pgsql not /postgresql. This is historical but not worth changing. + +Notice that this patch also makes the appending of /pgsql unconditional. +This is to avoid unexpected behavior if the RPM is built in a working +directory whose path happens to include "postgres" or "pgsql" already. +However, datadir and sysconfdir are already set up in the specfile's +configure call, so we do not have to append anything to them. + + +diff -Naur postgresql-9.0.1.orig/src/Makefile.global.in postgresql-9.0.1/src/Makefile.global.in +--- postgresql-9.0.1.orig/src/Makefile.global.in 2010-10-01 10:25:44.000000000 -0400 ++++ postgresql-9.0.1/src/Makefile.global.in 2010-10-11 11:52:05.224975308 -0400 +@@ -55,8 +55,7 @@ + # Installation directories + # + # These are set by the equivalent --xxxdir configure options. We +-# append "postgresql" to some of them, if the string does not already +-# contain "pgsql" or "postgres", in order to avoid directory clutter. ++# append "pgsql" to some of them, in order to avoid directory clutter. + # + # In a PGXS build, we cannot use the values inserted into Makefile.global + # by configure, since the installation tree may have been relocated. +@@ -74,45 +73,23 @@ + bindir := @bindir@ + + datadir := @datadir@ +-ifeq "$(findstring pgsql, $(datadir))" "" +-ifeq "$(findstring postgres, $(datadir))" "" +-override datadir := $(datadir)/postgresql +-endif +-endif + + sysconfdir := @sysconfdir@ +-ifeq "$(findstring pgsql, $(sysconfdir))" "" +-ifeq "$(findstring postgres, $(sysconfdir))" "" +-override sysconfdir := $(sysconfdir)/postgresql +-endif +-endif + + libdir := @libdir@ + + pkglibdir = $(libdir) +-ifeq "$(findstring pgsql, $(pkglibdir))" "" +-ifeq "$(findstring postgres, $(pkglibdir))" "" +-override pkglibdir := $(pkglibdir)/postgresql +-endif +-endif ++override pkglibdir := $(pkglibdir)/pgsql + + includedir := @includedir@ + + pkgincludedir = $(includedir) +-ifeq "$(findstring pgsql, $(pkgincludedir))" "" +-ifeq "$(findstring postgres, $(pkgincludedir))" "" +-override pkgincludedir := $(pkgincludedir)/postgresql +-endif +-endif ++override pkgincludedir := $(pkgincludedir)/pgsql + + mandir := @mandir@ + + docdir := @docdir@ +-ifeq "$(findstring pgsql, $(docdir))" "" +-ifeq "$(findstring postgres, $(docdir))" "" +-override docdir := $(docdir)/postgresql +-endif +-endif ++override docdir := $(docdir)/pgsql + + htmldir := @htmldir@ + diff --git a/libecpg-10.5-var-run-socket.patch b/libecpg-10.5-var-run-socket.patch new file mode 100644 index 0000000..8e3b193 --- /dev/null +++ b/libecpg-10.5-var-run-socket.patch @@ -0,0 +1,53 @@ +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.) + +diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c +index 9481f2d..75532c7 100644 +--- a/src/backend/utils/misc/guc.c ++++ b/src/backend/utils/misc/guc.c +@@ -3196,7 +3196,7 @@ static struct config_string ConfigureNamesString[] = + }, + &Unix_socket_directories, + #ifdef HAVE_UNIX_SOCKETS +- DEFAULT_PGSOCKET_DIR, ++ DEFAULT_PGSOCKET_DIR ", /tmp", + #else + "", + #endif +diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c +index feeff9e..3e3d784 100644 +--- a/src/bin/initdb/initdb.c ++++ b/src/bin/initdb/initdb.c +@@ -1234,7 +1234,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 +diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h +index e278fa0..9ee15d4 100644 +--- a/src/include/pg_config_manual.h ++++ b/src/include/pg_config_manual.h +@@ -169,7 +169,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. diff --git a/libecpg-12.2-dependency-build.patch b/libecpg-12.2-dependency-build.patch new file mode 100644 index 0000000..bdad581 --- /dev/null +++ b/libecpg-12.2-dependency-build.patch @@ -0,0 +1,13 @@ +diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile +index 32a9fdfb7b..899de131da 100644 +--- a/src/interfaces/libpq/Makefile ++++ b/src/interfaces/libpq/Makefile +@@ -76,8 +76,6 @@ SHLIB_PREREQS = submake-libpgport + + SHLIB_EXPORTS = exports.txt + +-all: all-lib +- + # Shared library stuff + include $(top_srcdir)/src/Makefile.shlib + backend_src = $(top_srcdir)/src/backend diff --git a/libecpg-12.2-external-libpq.patch b/libecpg-12.2-external-libpq.patch new file mode 100644 index 0000000..668c771 --- /dev/null +++ b/libecpg-12.2-external-libpq.patch @@ -0,0 +1,35 @@ +We don't build/install interfaces by upstream's implicit rules. +This patch is used on two places; postgresql.spec and libecpg.spec -- keep those +in sync! +Related: rhbz#1618698 +diff -ur postgresql-12.2/src/Makefile postgresql-12.2_patch/src/Makefile +--- postgresql-12.2/src/Makefile 2020-02-10 23:14:51.000000000 +0100 ++++ postgresql-12.2_patch/src/Makefile 2020-03-02 12:49:45.530666894 +0100 +@@ -20,7 +20,6 @@ + backend/utils/mb/conversion_procs \ + backend/snowball \ + include \ +- interfaces \ + backend/replication/libpqwalreceiver \ + backend/replication/pgoutput \ + fe_utils \ +diff -ur postgresql-12.2/src/Makefile.global.in postgresql-12.2_patch/src/Makefile.global.in +--- postgresql-12.2/src/Makefile.global.in 2020-02-10 23:14:51.000000000 +0100 ++++ postgresql-12.2_patch/src/Makefile.global.in 2020-03-02 12:47:40.970583609 +0100 +@@ -550,7 +550,7 @@ + # How to link to libpq. (This macro may be used as-is by backend extensions. + # Client-side code should go through libpq_pgport or libpq_pgport_shlib, + # instead.) +-libpq = -L$(libpq_builddir) -lpq ++libpq = -lpq + + # libpq_pgport is for use by client executables (not libraries) that use libpq. + # We force clients to pull symbols from the non-shared libraries libpgport +@@ -580,7 +580,6 @@ + # Commonly used submake targets + + submake-libpq: | submake-generated-headers +- $(MAKE) -C $(libpq_builddir) all + + submake-libpgport: | submake-generated-headers + $(MAKE) -C $(top_builddir)/src/port all diff --git a/libecpg.spec b/libecpg.spec new file mode 100644 index 0000000..4909631 --- /dev/null +++ b/libecpg.spec @@ -0,0 +1,167 @@ +%global majorversion 12 + +Summary: ECPG - Embedded SQL in C +Name: libecpg +Version: %majorversion.4 +Release: 1%{?dist} + +License: PostgreSQL +Url: http://www.postgresql.org/ + +Source0: https://ftp.postgresql.org/pub/source/v%version/postgresql-%version.tar.bz2 +Source1: https://ftp.postgresql.org/pub/source/v%version/postgresql-%version.tar.bz2.sha256 + + +# Comments for these patches are in the patch files. +Patch1: libecpg-10.5-rpm-pgsql.patch +Patch2: libecpg-10.5-var-run-socket.patch +Patch3: libecpg-12.2-external-libpq.patch +Patch4: libecpg-10.5-no-compat-lib.patch +Patch5: libecpg-12.2-dependency-build.patch + +BuildRequires: gcc +BuildRequires: glibc-devel bison flex gawk +BuildRequires: zlib-devel +BuildRequires: openssl-devel +BuildRequires: krb5-devel +BuildRequires: openldap-devel +BuildRequires: libpq-devel +BuildRequires: gettext +BuildRequires: multilib-rpm-config + +%description +An embedded SQL program consists of code written in an ordinary programming +language, in this case C, mixed with SQL commands in specially marked sections. +To build the program, the source code (*.pgc) is first passed through the +embedded SQL preprocessor, which converts it to an ordinary C program (*.c), and +afterwards it can be processed by a C compiler. + + +%package devel +Summary: Development files for ECPG - Embedded SQL in C +Requires: %name%{?_isa} = %version-%release +Requires: libpgtypes%{?_isa} = %version-%release + +%description devel +ECPG development files. You will need to install this package to build any +package or any clients that use the ECPG to connect to a PostgreSQL server. + + +%package -n libpgtypes +Summary: Map PostgreSQL database types to C equivalents + +%description -n libpgtypes +The pgtypes library maps PostgreSQL database types to C equivalents that can be +used in C programs. It also offers functions to do basic calculations with those +types within C, i.e., without the help of the PostgreSQL server. + + +%prep +( cd "$(dirname "%SOURCE1")" ; sha256sum -c "%SOURCE1" ) +%autosetup -n postgresql-%version -p1 + +# remove .gitignore files to ensure none get into the RPMs (bug #642210) +find . -type f -name .gitignore | xargs rm + + +%build +# We don't build server nor client (e.g. /bin/psql) binaries in this package, so +# we can disable some configure options. +%configure \ + --disable-rpath \ + --with-ldap \ + --with-openssl \ + --with-gssapi \ + --enable-nls \ + --without-readline \ + --datadir=%_datadir/pgsql + +%make_build -C "src/interfaces/ecpg" + + +%install +%make_install -C "src/interfaces/ecpg" + +# remove files not to be packaged +find $RPM_BUILD_ROOT -name '*.a' -delete + +%multilib_fix_c_header --file "%{_includedir}/ecpg_config.h" + +# function from postgresql.spec +find_lang_bins () +{ + lstfile=$1 ; shift + cp /dev/null "$lstfile" + for binary; do + %find_lang "$binary"-%majorversion + cat "$binary"-%majorversion.lang >>"$lstfile" + done +} + +find_lang_bins %name.lst ecpglib6 +find_lang_bins %name-devel.lst ecpg + + +%files -f %name.lst +%license COPYRIGHT +%_libdir/libecpg.so.6* + + +%files -n libpgtypes +%license COPYRIGHT +%_libdir/libpgtypes.so.3* + + +%files devel -f %name-devel.lst +%_bindir/ecpg +%_libdir/libecpg.so +%_libdir/libpgtypes.so +%_libdir/pkgconfig/libecpg.pc +%_libdir/pkgconfig/libpgtypes.pc +%_includedir/ecpg*.h +%_includedir/pgsql/informix +%_includedir/pgtypes*.h +%_includedir/sql3types.h +%_includedir/sqlca.h +%_includedir/sqlda*.h + + +%changelog +* Tue Aug 25 2020 Patrik Novotný - 12.4-1 +- Rebase to upstream release 12.4 + +* Tue Jul 28 2020 Fedora Release Engineering - 12.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon May 18 2020 Patrik Novotný - 12.3-1 +- Rebase to upstream release 12.3 + +* Mon Mar 2 2020 Filip Januš - 12.2-1 +- Rebase onto: 12.2 +- update of patch(libecpg-10.5-external-libpq.patch) was needed +- add upstream patch libecpg-12.2-dependency-build.patch + https://www.postgresql.org/message-id/20200321221303.GA17979%40momjian.us + +* Wed Jan 29 2020 Fedora Release Engineering - 11.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Jul 25 2019 Fedora Release Engineering - 11.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Feb 14 2019 Pavel Raiskup - 11.2-1 +- latest upstream release, per release notes: + https://www.postgresql.org/docs/11/static/release-11-1.html + https://www.postgresql.org/docs/11/static/release-11-2.html + +* Fri Feb 01 2019 Fedora Release Engineering - 11.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Wed Oct 17 2018 Pavel Raiskup - 11.0-1 +- latest upstream release, per release notes: + https://www.postgresql.org/docs/11/static/release-11.html + +* Thu Aug 30 2018 Pavel Raiskup - 10.5-1 +- slight simplification before review + +* Thu Aug 16 2018 Pavel Raiskup - 10.5-0.1 +- initial packaging diff --git a/sources b/sources new file mode 100644 index 0000000..c8ee27a --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (postgresql-12.4.tar.bz2) = 36daf10878ca153370829178786dd6ee366ab4d4d6dc9c527536740fdb14b688ae4c33f850eb4243a7667d23f87e4bfd1ddee0755447ad4f3996e423e391c2f3 +SHA512 (postgresql-12.4.tar.bz2.sha256) = d5c6d9c6cf189f0ef9c4ebac18782f25c0ff8420d0b063217f4ac250cca4706ec782e983326ffcb23258bcd5bf17b481e53d84aeb85b5744bfd90ea1bd33431a