- Add sqlite3-6216bfcb.patch to fix a test suite regression in

3.47.0 on s390x. Only the test was broken, not the code itself.
  https://sqlite.org/forum/forumpost/7b2bab04c5

OBS-URL: https://build.opensuse.org/package/show/server:database/sqlite3?expand=0&rev=342
This commit is contained in:
Reinhard Max 2024-12-16 16:12:19 +00:00 committed by Git OBS Bridge
commit a619ae7e47
12 changed files with 4110 additions and 0 deletions

23
.gitattributes vendored Normal file
View 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
View File

@ -0,0 +1 @@
.osc

3
baselibs.conf Normal file
View File

@ -0,0 +1,3 @@
libsqlite3-0
obsoletes "sqlite-<targettype> <= <version>"
provides "sqlite-<targettype> = <version>"

3
sqlite-doc-3460000.zip Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5ec9651bbfab7d3bf0a295f4d9be7d861e9968ea993438f05b579d8a75fe1e6f
size 10842823

3
sqlite-doc-3460100.zip Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e969131f93ca79fbc64d57724a1035735881555a52600dbe69c69eab72c9fcd1
size 10851427

3
sqlite-doc-3470200.zip Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6dcca89a6749029fba81bc0f4188cbd4f78acb48d6a3eadc6d548af9117c3f41
size 10957830

3
sqlite-src-3460000.zip Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:070362109beb6899f65797571b98b8824c8f437f5b2926f88ee068d98ef368ec
size 14275927

3
sqlite-src-3460100.zip Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:def3fc292eb9ecc444f6c1950e5c79d8462ed5e7b3d605fd6152d145e1d5abb4
size 14276926

3
sqlite-src-3470200.zip Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e6a471f1238225f34c2c48c5601b54024cc538044368230f59ff0672be1fc623
size 14421983

46
sqlite3-6216bfcb.patch Normal file
View File

@ -0,0 +1,46 @@
Index: test/fts3corrupt4.test
==================================================================
--- test/fts3corrupt4.test
+++ test/fts3corrupt4.test
@@ -4401,14 +4401,36 @@
do_catchsql_test 25.5 {
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x%1 FROM c WHERE x<599237)
INSERT INTO t1( a ) SELECT randomblob(3000) FROM t2 ;
} {0 {}}
-do_catchsql_test 25.6 {
- INSERT INTO t1(t1) SELECT x FROM t2;
- INSERT INTO t1(t1) SELECT x FROM t2;
-} {1 {database disk image is malformed}}
+if {$tcl_platform(byteOrder)=="littleEndian"} {
+ # The SQLITE_CORRUPT error depends on the specific random byte
+ # sequence generated by SQLite's PRNG. But the SQLite PRNG
+ # uses ChaCha20, which generates a different byte sequence on
+ # big-endian and little-endian platforms. The SQLITE_CORRUPT
+ # error only comes up when the pseudo-random byte sequence is
+ # the one generated on little-endian platforms.
+ #
+ # See Forum thread:
+ # https://sqlite.org/forum/forumpost/b5f89d813babfd88
+ #
+ do_catchsql_test 25.6a {
+ INSERT INTO t1(t1) SELECT x FROM t2;
+ } {1 {database disk image is malformed}}
+ do_catchsql_test 25.6b {
+ INSERT INTO t1(t1) SELECT x FROM t2;
+ } {1 {database disk image is malformed}}
+} else {
+ do_catchsql_test 25.6a {
+ INSERT INTO t1(t1) SELECT x FROM t2;
+ } {0 {}}
+ do_catchsql_test 25.6b {
+ INSERT INTO t1(t1) SELECT x FROM t2;
+ } {0 {}}
+}
+
#-------------------------------------------------------------------------
reset_db
do_test 26.0 {
sqlite3 db {}

3798
sqlite3.changes Normal file

File diff suppressed because it is too large Load Diff

221
sqlite3.spec Normal file
View File

@ -0,0 +1,221 @@
#
# spec file for package sqlite3
#
# Copyright (c) 2024 SUSE LLC
#
# 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/
#
%define oname sqlite
%define tarversion 3470200
%define docversion 3470200
%bcond_with icu
%bcond_without check
Name: sqlite3
Version: 3.47.2
Release: 0
Summary: Embeddable SQL Database Engine
License: SUSE-Public-Domain
Group: Productivity/Databases/Servers
URL: https://www.sqlite.org/
Source0: https://www.sqlite.org/2023/sqlite-src-%{tarversion}.zip
Source1: baselibs.conf
Source2: https://www.sqlite.org/2023/sqlite-doc-%{docversion}.zip
Patch0: sqlite3-6216bfcb.patch
BuildRequires: automake
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: readline-devel
BuildRequires: tcl-devel
BuildRequires: unzip
%if 0%{suse_version} < 1500
# As of 2021 we still need to be able to compile this on SLE-12
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: zlib-devel
%global make_build make
%else
BuildRequires: pkgconfig(zlib)
%endif
Provides: %{oname} = %{version}
Obsoletes: %{oname} < %{version}
%if %{with icu}
BuildRequires: libicu-devel
%endif
%{?suse_build_hwcaps_libs}
%description
SQLite is a C library that implements an embeddable SQL database
engine. Programs that link with the SQLite library can have SQL
database access without running a separate RDBMS process.
SQLite is not a client library used to connect to a big database
server. SQLite is a server and the SQLite library reads and writes
directly to and from the database files on disk.
SQLite can be used via the sqlite command line tool or via any
application that supports the Qt database plug-ins.
%package -n libsqlite3-0
Summary: Shared libraries for the Embeddable SQL Database Engine
Group: Development/Libraries/C and C++
%description -n libsqlite3-0
This package contains the shared libraries for the Embeddable SQL
Database Engine.
SQLite is a C library that implements an embeddable SQL database
engine. Programs that link with the SQLite library can have SQL
database access without running a separate RDBMS process.
SQLite is not a client library used to connect to a big database
server. SQLite is a server and the SQLite library reads and writes
directly to and from the database files on disk.
SQLite can be used via the sqlite command line tool or via any
application that supports the Qt database plug-ins.
%package devel
Summary: Embeddable SQL Database Engine
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libsqlite3-0 = %{version}
Suggests: %{name}-doc
Provides: %{oname}-devel = %{version}
Obsoletes: %{oname}-devel < %{version}
%description devel
SQLite is a C library that implements an embeddable SQL database
engine. Programs that link with the SQLite library can have SQL
database access without running a separate RDBMS process.
SQLite is not a client library used to connect to a big database
server; SQLite is the server. The SQLite library reads and writes
directly to and from the database files on disk.
SQLite can be used via the sqlite command-line tool or via any
application which supports the Qt database plug-ins.
%package tcl
Summary: Tcl binding for SQLite
Group: Development/Libraries/Tcl
%description tcl
This package contains laguage bindings from the Tcl programming
language SQLite.
SQLite is a C library that implements an embeddable SQL database
engine. Programs that link with the SQLite library can have SQL
database access without running a separate RDBMS process.
%package doc
Summary: Documentation for %{name}
Group: Documentation/Other
BuildArch: noarch
%description doc
Contains HTML documentation for SQLite: SQL Syntax, C/C++ API and
other documentation found on sqlite.org. The files can be found in
%{_docdir}/%{name}-doc.
%prep
# Version and %tarversion need to match, but %docversion might be different,
IFS=. read a b c d <<< "%version"
if [ "%tarversion" != $(printf "%1d%02d%02d%02d" $a $b $c $d) ]
then
echo "Version %version does not match tarversion %tarversion."
exit 1
fi
%autosetup -p0 -n sqlite-src-%{tarversion} -a2
rm -v sqlite-doc-%{docversion}/releaselog/current.html
ln -sv `echo %{docversion} | sed "s/\./_/g"`.html sqlite-doc-%{docversion}/releaselog/current.html
find -type f -name sqlite.css~ -delete
cmp sqlite-doc-%{docversion}/fileformat{,2}.html && ln -sf fileformat.html sqlite-doc-%{docversion}/fileformat2.html
%build
export TCLLIBDIR=%tcl_archdir/sqlite%version
export CC=gcc
export CC_FOR_BUILD=gcc
export CFLAGS="%{optflags} \
-DSQLITE_ENABLE_API_ARMOR \
-DSQLITE_ENABLE_COLUMN_METADATA \
-DSQLITE_ENABLE_DBSTAT_VTAB \
-DSQLITE_ENABLE_HIDDEN_COLUMNS \
-DSQLITE_ENABLE_FTS3 \
-DSQLITE_ENABLE_FTS4 \
-DSQLITE_ENABLE_FTS5 \
%if %{with icu}
-DSQLITE_ENABLE_ICU \
%endif
-DSQLITE_ENABLE_JSON1 \
-DSQLITE_ENABLE_RBU \
-DSQLITE_ENABLE_RTREE \
-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT \
-DSQLITE_SOUNDEX \
-DSQLITE_ENABLE_UNLOCK_NOTIFY \
-DSQLITE_SECURE_DELETE \
-DSQLITE_ENABLE_MATH_FUNCTIONS \
-DSQLITE_STRICT_SUBTYPE=1 \
"
%configure \
--disable-static \
--enable-readline \
--enable-fts3 \
--enable-fts4 \
--enable-fts5 \
--enable-update-limit \
--enable-rtree \
--enable-session
%make_build sqlite3.c
%make_build
%if %{with check}
%check
%make_build test
%endif
%install
%make_install
#mkdir -p %{buildroot}/%{_mandir}/man{1,n}/
install -Dp -m 0644 -t %{buildroot}/%{_mandir}/man1 sqlite3.1
install -Dp -m 0644 -t %{buildroot}/%{_mandir}/mann autoconf/tea/doc/sqlite3.n
# tcl bindings are provided by tcl itself
#rm -rf %{buildroot}%{_libdir}/tcl/tcl8.?/sqlite3*
find %{buildroot} -type f -name "*.la" -delete -print
%post -n libsqlite3-0 -p /sbin/ldconfig
%postun -n libsqlite3-0 -p /sbin/ldconfig
%files
%{_bindir}/sqlite3
%{_mandir}/man1/sqlite3.1%{?ext_man}
%files -n libsqlite3-0
%{_libdir}/libsqlite3.so.*
%files devel
%{_includedir}/sqlite3.h
%{_includedir}/sqlite3ext.h
%{_libdir}/libsqlite3.so
%{_libdir}/pkgconfig/sqlite3.pc
%files tcl
%tcl_archdir/*
%doc %_mandir/mann/*
%files doc
%doc sqlite-doc-%{docversion}/*
%changelog