From d781fbc335c75a47fa4b07fb5c0d4d7bb35faae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= <41448637+mkgrgis@users.noreply.github.com> Date: Mon, 24 Jul 2023 08:23:41 +0300 Subject: [PATCH 1/3] Add RPM specifiacation Create rpm.spec Based on * https://rpm-software-management.github.io/rpm/manual/spec.html * https://github.com/scj643/sqlite_fdw/tree/master * rpm.spec from https://rhel.pkgs.org/9/postgresql-14-x86_64/sqlite_fdw_14-2.3.0-1.rhel9.x86_64.rpm.html Thanks to https://github.com/scj643 and https://github.com/devrimgunduz --- rpm.spec | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 rpm.spec diff --git a/rpm.spec b/rpm.spec new file mode 100644 index 00000000..27b7bb52 --- /dev/null +++ b/rpm.spec @@ -0,0 +1,125 @@ +%global sname sqlite_fdw + +Summary: SQLite Foreign Data Wrapper for PostgreSQL +Name: %{sname}_%{pgmajorversion} +Version: 2.3.0 +Release: 1%{?dist} +License: PostgreSQL https://github.com/pgspider/sqlite_fdw/blob/master/License +URL: https://github.com/pgspider/%{sname} +Source0: ${HOME}/rpmbuild/SOURCES +# https://github.com/pgspider/%{sname}/archive/v%{version}.tar.gz +BuildRequires: sqlite-devel postgresql%{pgmajorversion}-devel libpq-devel make postgresql%{pgmajorversion}-server +Requires: postgresql%{pgmajorversion}-server +%if 0%{?fedora} >= 27 +Requires: sqlite-libs +%endif +%if 0%{?rhel} <= 7 +Requires: sqlite +%endif + +Obsoletes: %{sname}%{pgmajorversion} < 1.3.0-2 + +%description +SQLite Foreign Data Wrapper for PostgreSQL + +%if %llvm +%package llvmjit +Summary: Just-in-time compilation support for sqlite_fdw +Requires: %{name}%{?_isa} = %{version}-%{release} +%if 0%{?rhel} && 0%{?rhel} == 7 +%ifarch aarch64 +Requires: llvm-toolset-7.0-llvm >= 7.0.1 +%else +Requires: llvm5.0 >= 5.0 +%endif +%endif +%if 0%{?suse_version} >= 1315 && 0%{?suse_version} <= 1499 +BuildRequires: llvm6-devel clang6-devel +Requires: llvm6 +%endif +%if 0%{?suse_version} >= 1500 +BuildRequires: llvm13-devel clang13-devel +Requires: llvm13 +%endif +%if 0%{?fedora} || 0%{?rhel} >= 8 +Requires: llvm => 13.0 +%endif + +%description llvmjit +This packages provides JIT support for sqlite_fdw +%endif + +%prep +%setup -q -n %{sname}-%{version} + +%build +USE_PGXS=1 PATH=%{pginstdir}/bin/:$PATH %{__make} %{?_smp_mflags} + +%install +%{__rm} -rf %{buildroot} +USE_PGXS=1 PATH=%{pginstdir}/bin/:$PATH %{__make} %{?_smp_mflags} install DESTDIR=%{buildroot} +# Install README and howto file under PostgreSQL installation directory: +%{__install} -d %{buildroot}%{pginstdir}/doc/extension +%{__install} -m 644 README.md %{buildroot}%{pginstdir}/doc/extension/README-%{sname}.md +%{__rm} -f %{buildroot}%{pginstdir}/doc/extension/README.md + +%clean +%{__rm} -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%{pginstdir}/lib/*.so +%{pginstdir}/share/extension/*.sql +%{pginstdir}/share/extension/*.control +%{pginstdir}/doc/extension/README-%{sname}.md + +%license License +%doc README.md + +%if %llvm +%files llvmjit + %{pginstdir}/lib/bitcode/%{sname}*.bc + %{pginstdir}/lib/bitcode/%{sname}/*.bc +%endif + +%changelog + +* 17 Jan 2023 t-kataym - 2.3.0 +- Support PostgreSQL 15.0 +- Bug fix of error handling in case of sqlite busy + +* 26 Sep 2022 t-kataym - 2.2.0 +- Support PostgreSQL 15beta4 +- Support push down CASE expressions + +* 22 Dec 2021 t-kataym - 2.1.1 +- Support Insert/Update with generated column +- Support check invalid options +- Bug fixings: + - Fix issue #44 on GitHub (FTS Virtual Table crash) + - Fix memory leak + +* 24 Sep 2021 hrkuma - 2.1.0 +- Support version 14 related features +- Support TRUNCATE +- Support Bulk Insert +- Support keep connection control and connection cache information +- Refactored tests + +* 26 May 2021 hrkuma - 2.0.0 +- Support JOIN pushdown (LEFT,RIGHT,INNER) +- Support direct modification (UPDATE/DELETE) +- Support pushdown nest functions +- Support pushdown scalar operator ANY/ALL (ARRAY) +- Support pushdown ON CONFLICT DO NOTHING +- Refactored tests +- Bug fixings +- Don't push down lower/upper function +- Fix processing for DATE data type +- Do not prepare SQL statement during EXPLAIN + +* Thu Jan 14 2021 hrkuma - 1.3.1 +- Support function pushdown in the target list (for PGSpider) +- Support Windows build using Visual Studio project +- Fix FETCH ... WITH TIES issue +- Fix sqlite_fdw does not bind the correct numeric value when it is sub-query From 7465d03243f84f6eda2d6ce739516657882ae3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= <41448637+mkgrgis@users.noreply.github.com> Date: Mon, 14 Apr 2025 19:14:08 +0300 Subject: [PATCH 2/3] Update rpm.spec Some fixes --- rpm.spec | 47 +++++++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/rpm.spec b/rpm.spec index 27b7bb52..ecaddca3 100644 --- a/rpm.spec +++ b/rpm.spec @@ -2,7 +2,7 @@ Summary: SQLite Foreign Data Wrapper for PostgreSQL Name: %{sname}_%{pgmajorversion} -Version: 2.3.0 +Version: 2.5.0 Release: 1%{?dist} License: PostgreSQL https://github.com/pgspider/sqlite_fdw/blob/master/License URL: https://github.com/pgspider/%{sname} @@ -22,33 +22,6 @@ Obsoletes: %{sname}%{pgmajorversion} < 1.3.0-2 %description SQLite Foreign Data Wrapper for PostgreSQL -%if %llvm -%package llvmjit -Summary: Just-in-time compilation support for sqlite_fdw -Requires: %{name}%{?_isa} = %{version}-%{release} -%if 0%{?rhel} && 0%{?rhel} == 7 -%ifarch aarch64 -Requires: llvm-toolset-7.0-llvm >= 7.0.1 -%else -Requires: llvm5.0 >= 5.0 -%endif -%endif -%if 0%{?suse_version} >= 1315 && 0%{?suse_version} <= 1499 -BuildRequires: llvm6-devel clang6-devel -Requires: llvm6 -%endif -%if 0%{?suse_version} >= 1500 -BuildRequires: llvm13-devel clang13-devel -Requires: llvm13 -%endif -%if 0%{?fedora} || 0%{?rhel} >= 8 -Requires: llvm => 13.0 -%endif - -%description llvmjit -This packages provides JIT support for sqlite_fdw -%endif - %prep %setup -q -n %{sname}-%{version} @@ -84,6 +57,24 @@ USE_PGXS=1 PATH=%{pginstdir}/bin/:$PATH %{__make} %{?_smp_mflags} install DESTDI %changelog +* 10 Dec 2024 t-kataym - 2.5.0 + * Support PostgreSQL 17.0 + * Add CI environment using GitHub Actions + * Add force_readonly option (#78), readonly mode for SQLite database + * Support uuid (#82,#95) + * Support bit and varbit (#83) + * Support bool as mixed affinity column (#88) + * NaN detecting (#100) + * Support ∞ values for numeric context (#97) + * Support mixed (selected) affinity for UPDATE (#95) + + * 27Sep 2023 t-kataym - 2.4.0 + * Support PosgreSQL 16.0 + * Add text transformations for pg DB encoding, encodings support + * Add updatable option on different levels + * Improve error message + * Fix bugs + * 17 Jan 2023 t-kataym - 2.3.0 - Support PostgreSQL 15.0 - Bug fix of error handling in case of sqlite busy From 2c9263241c707f476a375b51ae349e5015a5724d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= <41448637+mkgrgis@users.noreply.github.com> Date: Wed, 21 May 2025 16:21:08 +0300 Subject: [PATCH 3/3] Update rpm.spec, for "without gis support" variant Based on confirmed by real RPM creating process file variant from https://github.com/pgsty/rpm/blob/main/rpmbuild/SPECS/sqlite_fdw.spec --- rpm.spec | 116 +++++++++++++++++-------------------------------------- 1 file changed, 35 insertions(+), 81 deletions(-) diff --git a/rpm.spec b/rpm.spec index ecaddca3..5175cb4b 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,26 +1,47 @@ %global sname sqlite_fdw +%global pginstdir /usr/pgsql-%{pgmajorversion} + +%{!?llvm:%global llvm 1} Summary: SQLite Foreign Data Wrapper for PostgreSQL Name: %{sname}_%{pgmajorversion} -Version: 2.5.0 -Release: 1%{?dist} -License: PostgreSQL https://github.com/pgspider/sqlite_fdw/blob/master/License +Version: 2.5.1 +Release: 2PIGSTY%{?dist} +License: PostgreSQL URL: https://github.com/pgspider/%{sname} -Source0: ${HOME}/rpmbuild/SOURCES -# https://github.com/pgspider/%{sname}/archive/v%{version}.tar.gz -BuildRequires: sqlite-devel postgresql%{pgmajorversion}-devel libpq-devel make postgresql%{pgmajorversion}-server +Source0: %{sname}-%{version}.tar.gz +BuildRequires: postgresql%{pgmajorversion}-devel +BuildRequires: postgresql%{pgmajorversion}-server sqlite-devel +BuildRequires: libspatialite-devel Requires: postgresql%{pgmajorversion}-server -%if 0%{?fedora} >= 27 -Requires: sqlite-libs -%endif -%if 0%{?rhel} <= 7 -Requires: sqlite -%endif -Obsoletes: %{sname}%{pgmajorversion} < 1.3.0-2 +%if 0%{?suse_version} >= 1500 +# Unfortunately SLES 15 ships the libraries with -devel subpackage: +Requires: sqlite3-devel >= 3.7 +%else +# All other sane distributions have a separate -libs subpackage: +Requires: sqlite-libs >= 3.7 +%endif %description -SQLite Foreign Data Wrapper for PostgreSQL +This PostgreSQL extension is a Foreign Data Wrapper for SQLite. + +%if %llvm +%package llvmjit +Summary: Just-in-time compilation support for sqlite_fdw +Requires: %{name}%{?_isa} = %{version}-%{release} +%if 0%{?suse_version} >= 1500 +BuildRequires: llvm17-devel clang17-devel +Requires: llvm17 +%endif +%if 0%{?fedora} || 0%{?rhel} >= 8 +BuildRequires: llvm-devel >= 17.0 clang-devel >= 17.0 +Requires: llvm => 17.0 +%endif + +%description llvmjit +This package provides JIT support for %{sname} +%endif %prep %setup -q -n %{sname}-%{version} @@ -31,14 +52,10 @@ USE_PGXS=1 PATH=%{pginstdir}/bin/:$PATH %{__make} %{?_smp_mflags} %install %{__rm} -rf %{buildroot} USE_PGXS=1 PATH=%{pginstdir}/bin/:$PATH %{__make} %{?_smp_mflags} install DESTDIR=%{buildroot} -# Install README and howto file under PostgreSQL installation directory: %{__install} -d %{buildroot}%{pginstdir}/doc/extension %{__install} -m 644 README.md %{buildroot}%{pginstdir}/doc/extension/README-%{sname}.md %{__rm} -f %{buildroot}%{pginstdir}/doc/extension/README.md -%clean -%{__rm} -rf %{buildroot} - %files %defattr(-,root,root,-) %{pginstdir}/lib/*.so @@ -46,71 +63,8 @@ USE_PGXS=1 PATH=%{pginstdir}/bin/:$PATH %{__make} %{?_smp_mflags} install DESTDI %{pginstdir}/share/extension/*.control %{pginstdir}/doc/extension/README-%{sname}.md -%license License -%doc README.md - %if %llvm %files llvmjit %{pginstdir}/lib/bitcode/%{sname}*.bc %{pginstdir}/lib/bitcode/%{sname}/*.bc %endif - -%changelog - -* 10 Dec 2024 t-kataym - 2.5.0 - * Support PostgreSQL 17.0 - * Add CI environment using GitHub Actions - * Add force_readonly option (#78), readonly mode for SQLite database - * Support uuid (#82,#95) - * Support bit and varbit (#83) - * Support bool as mixed affinity column (#88) - * NaN detecting (#100) - * Support ∞ values for numeric context (#97) - * Support mixed (selected) affinity for UPDATE (#95) - - * 27Sep 2023 t-kataym - 2.4.0 - * Support PosgreSQL 16.0 - * Add text transformations for pg DB encoding, encodings support - * Add updatable option on different levels - * Improve error message - * Fix bugs - -* 17 Jan 2023 t-kataym - 2.3.0 -- Support PostgreSQL 15.0 -- Bug fix of error handling in case of sqlite busy - -* 26 Sep 2022 t-kataym - 2.2.0 -- Support PostgreSQL 15beta4 -- Support push down CASE expressions - -* 22 Dec 2021 t-kataym - 2.1.1 -- Support Insert/Update with generated column -- Support check invalid options -- Bug fixings: - - Fix issue #44 on GitHub (FTS Virtual Table crash) - - Fix memory leak - -* 24 Sep 2021 hrkuma - 2.1.0 -- Support version 14 related features -- Support TRUNCATE -- Support Bulk Insert -- Support keep connection control and connection cache information -- Refactored tests - -* 26 May 2021 hrkuma - 2.0.0 -- Support JOIN pushdown (LEFT,RIGHT,INNER) -- Support direct modification (UPDATE/DELETE) -- Support pushdown nest functions -- Support pushdown scalar operator ANY/ALL (ARRAY) -- Support pushdown ON CONFLICT DO NOTHING -- Refactored tests -- Bug fixings -- Don't push down lower/upper function -- Fix processing for DATE data type -- Do not prepare SQL statement during EXPLAIN - -* Thu Jan 14 2021 hrkuma - 1.3.1 -- Support function pushdown in the target list (for PGSpider) -- Support Windows build using Visual Studio project -- Fix FETCH ... WITH TIES issue -- Fix sqlite_fdw does not bind the correct numeric value when it is sub-query