mongo_fdw: Do not run autogen.sh, so that we depend on the libraries in the operating...
authorDevrim Gunduz <devrim@gunduz.org>
Tue, 28 Oct 2025 08:56:19 +0000 (11:56 +0300)
committerDevrim Gunduz <devrim@gunduz.org>
Tue, 28 Oct 2025 08:56:19 +0000 (11:56 +0300)
rpm/redhat/main/non-common/mongo_fdw/EL-10/mongo_fdw-makefile-rpm.patch [new symlink]
rpm/redhat/main/non-common/mongo_fdw/EL-8/mongo_fdw-makefile-rpm.patch [new symlink]
rpm/redhat/main/non-common/mongo_fdw/EL-9/mongo_fdw-makefile-rpm.patch [new symlink]
rpm/redhat/main/non-common/mongo_fdw/F-41/mongo_fdw-makefile-rpm.patch [new symlink]
rpm/redhat/main/non-common/mongo_fdw/F-42/mongo_fdw-makefile-rpm.patch [new symlink]
rpm/redhat/main/non-common/mongo_fdw/F-43/mongo_fdw-makefile-rpm.patch [new symlink]
rpm/redhat/main/non-common/mongo_fdw/main/mongo_fdw-makefile-rpm.patch [new file with mode: 0644]
rpm/redhat/main/non-common/mongo_fdw/main/mongo_fdw.spec

diff --git a/rpm/redhat/main/non-common/mongo_fdw/EL-10/mongo_fdw-makefile-rpm.patch b/rpm/redhat/main/non-common/mongo_fdw/EL-10/mongo_fdw-makefile-rpm.patch
new file mode 120000 (symlink)
index 0000000..9f09408
--- /dev/null
@@ -0,0 +1 @@
+../main/mongo_fdw-makefile-rpm.patch
\ No newline at end of file
diff --git a/rpm/redhat/main/non-common/mongo_fdw/EL-8/mongo_fdw-makefile-rpm.patch b/rpm/redhat/main/non-common/mongo_fdw/EL-8/mongo_fdw-makefile-rpm.patch
new file mode 120000 (symlink)
index 0000000..9f09408
--- /dev/null
@@ -0,0 +1 @@
+../main/mongo_fdw-makefile-rpm.patch
\ No newline at end of file
diff --git a/rpm/redhat/main/non-common/mongo_fdw/EL-9/mongo_fdw-makefile-rpm.patch b/rpm/redhat/main/non-common/mongo_fdw/EL-9/mongo_fdw-makefile-rpm.patch
new file mode 120000 (symlink)
index 0000000..9f09408
--- /dev/null
@@ -0,0 +1 @@
+../main/mongo_fdw-makefile-rpm.patch
\ No newline at end of file
diff --git a/rpm/redhat/main/non-common/mongo_fdw/F-41/mongo_fdw-makefile-rpm.patch b/rpm/redhat/main/non-common/mongo_fdw/F-41/mongo_fdw-makefile-rpm.patch
new file mode 120000 (symlink)
index 0000000..9f09408
--- /dev/null
@@ -0,0 +1 @@
+../main/mongo_fdw-makefile-rpm.patch
\ No newline at end of file
diff --git a/rpm/redhat/main/non-common/mongo_fdw/F-42/mongo_fdw-makefile-rpm.patch b/rpm/redhat/main/non-common/mongo_fdw/F-42/mongo_fdw-makefile-rpm.patch
new file mode 120000 (symlink)
index 0000000..9f09408
--- /dev/null
@@ -0,0 +1 @@
+../main/mongo_fdw-makefile-rpm.patch
\ No newline at end of file
diff --git a/rpm/redhat/main/non-common/mongo_fdw/F-43/mongo_fdw-makefile-rpm.patch b/rpm/redhat/main/non-common/mongo_fdw/F-43/mongo_fdw-makefile-rpm.patch
new file mode 120000 (symlink)
index 0000000..9f09408
--- /dev/null
@@ -0,0 +1 @@
+../main/mongo_fdw-makefile-rpm.patch
\ No newline at end of file
diff --git a/rpm/redhat/main/non-common/mongo_fdw/main/mongo_fdw-makefile-rpm.patch b/rpm/redhat/main/non-common/mongo_fdw/main/mongo_fdw-makefile-rpm.patch
new file mode 100644 (file)
index 0000000..93202cb
--- /dev/null
@@ -0,0 +1,17 @@
+--- Makefile.old       2025-10-28 11:14:11.952389716 +0300
++++ Makefile   2025-10-28 11:14:26.381469823 +0300
+@@ -11,10 +11,10 @@
+ # on another platform, change env_posix.os in MONGO_OBJS with the appropriate
+ # environment object file.
+ #
+-LIBJSON = json-c
+-LIBJSON_OBJS =  $(LIBJSON)/json_util.o $(LIBJSON)/json_object.o $(LIBJSON)/json_tokener.o \
+-                                $(LIBJSON)/json_object_iterator.o $(LIBJSON)/printbuf.o $(LIBJSON)/linkhash.o \
+-                                $(LIBJSON)/arraylist.o $(LIBJSON)/random_seed.o $(LIBJSON)/debug.o $(LIBJSON)/strerror_override.o
++#LIBJSON = json-c
++#LIBJSON_OBJS =  $(LIBJSON)/json_util.o $(LIBJSON)/json_object.o $(LIBJSON)/json_tokener.o \
++#                                $(LIBJSON)/json_object_iterator.o $(LIBJSON)/printbuf.o $(LIBJSON)/linkhash.o \
++#                                $(LIBJSON)/arraylist.o $(LIBJSON)/random_seed.o $(LIBJSON)/debug.o $(LIBJSON)/strerror_override.o
+ MONGO_INCLUDE = $(shell pkg-config --cflags libmongoc-1.0)
+ PG_CPPFLAGS = --std=c99 $(MONGO_INCLUDE) -I$(LIBJSON)
index 1a6cb41f59f353e31ec9e63855c6a0ca4842aa7d..14bc02076bb3481bc5a64c388f9ac257e376db90 100644 (file)
 Summary:       PostgreSQL foreign data wrapper for MongoDB
 Name:          %{sname}_%{pgmajorversion}
 Version:       %{mongofdwmajver}.%{mongofdwmidver}.%{mongofdwminver}
-Release:       1PGDG%{?dist}
+Release:       2PGDG%{?dist}
 License:       LGPLv3
 URL:           https://github.com/EnterpriseDB/%{sname}
 Source0:       https://github.com/EnterpriseDB/%{sname}/archive/REL-%{relver}.tar.gz
 Source1:       %{sname}-config.h
+Patch0:                %{sname}-makefile-rpm.patch
 
 BuildRequires: postgresql%{pgmajorversion}-devel
 
 %if 0%{?suse_version} >= 1499
-Requires:              libsnappy1 libbson-1_0-0 libmongoc-1_0-0
+Requires:              libsnappy1 libbson-1_0-0 libmongoc-1_0-0 libjson-c5
 BuildRequires:         snappy-devel libbson-1_0-0-devel libmongoc-1_0-0-devel
-BuildRequires:         libopenssl-devel
 %else
 Requires:      snappy
 Requires:      mongo-c-driver-libs libbson
-BuildRequires: mongo-c-driver-devel snappy-devel
-BuildRequires: openssl-devel cyrus-sasl-devel krb5-devel
+BuildRequires: mongo-c-driver-devel snappy-devel json-c-devel
+BuildRequires: cyrus-sasl-devel krb5-devel
 BuildRequires: libbson-devel
 %endif
+%if 0%{?suse_version} == 1500
+Requires:      libopenssl1_1
+BuildRequires: libopenssl-1_1-devel
+%endif
+%if 0%{?suse_version} == 1600
+Requires:      libopenssl3
+BuildRequires: libopenssl-3-devel
+%endif
+%if 0%{?fedora} >= 41 || 0%{?rhel} >= 8
+Requires:      openssl-libs >= 1.1.1k
+BuildRequires: openssl-devel
+%endif
 
 Requires:      postgresql%{pgmajorversion}-server cyrus-sasl-lib
 
@@ -60,9 +72,9 @@ This package provides JIT support for mongo_fdw
 
 %prep
 %setup -q -n %{sname}-REL-%{relver}
+%patch -P0 -p0
 
 %build
-sh autogen.sh
 
 %if 0%{?suse_version}
 %if 0%{?suse_version} >= 1499
@@ -80,6 +92,8 @@ sed -i "s:\(^#include \"bson.h\"\):#include <bson.h>:g" mongo_fdw.h
 sed -i "s:\(^#include \"bson.h\"\)://\1:g" mongo_wrapper.h
 %endif
 
+export LIBJSON=%{_includedir}/json-c
+
 PATH=%{pginstdir}/bin:$PATH %{__make} -f Makefile USE_PGXS=1 %{?_smp_mflags}
 
 %install
@@ -107,10 +121,13 @@ PATH=%{pginstdir}/bin:$PATH %{__make} -f Makefile USE_PGXS=1 %{?_smp_mflags} ins
 %files llvmjit
    %{pginstdir}/lib/bitcode/%{sname}*.bc
    %{pginstdir}/lib/bitcode/%{sname}/*.bc
-   %{pginstdir}/lib/bitcode/%{sname}/json-c/*.bc
 %endif
 
 %changelog
+* Tue Oct 28 2025 Devrim Gunduz <devrim@gunduz.org> - 5.5.3-2PGDG
+- Do not run autogen.sh, so that we depend on the libraries in the
+  operating system.
+
 * Mon Oct 6 2025 Devrim Gunduz <devrim@gunduz.org> - 5.5.3-1PGDG
 - Update to 5.5.3 per changes described at:
   https://github.com/EnterpriseDB/mongo_fdw/releases/tag/REL-5_5_3