From 066df9cec13bf1d82fe2888f6b445056deba4951 Mon Sep 17 00:00:00 2001 From: JinWang An Date: Tue, 20 Oct 2020 01:54:09 +0900 Subject: [PATCH] Bump to sqlite 3.33.0 Change-Id: Idbd990fb4b6e4afdfb1438e35581c03d75fa5847 Signed-off-by: JinWang An --- autogen.sh | 5 ++ packaging/baselibs.conf | 3 + packaging/sqlite.changes | 9 +++ packaging/sqlite.manifest | 5 ++ packaging/sqlite.spec | 118 ++++++++++++++++++++++++++++ packaging/sqlite_default_flag.patch | 24 ++++++ packaging/sqlite_journal_mode_persist.patch | 16 ++++ 7 files changed, 180 insertions(+) create mode 100755 autogen.sh create mode 100644 packaging/baselibs.conf create mode 100644 packaging/sqlite.changes create mode 100644 packaging/sqlite.manifest create mode 100644 packaging/sqlite.spec create mode 100644 packaging/sqlite_default_flag.patch create mode 100644 packaging/sqlite_journal_mode_persist.patch diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..227e169 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,5 @@ +aclocal +#autoheader +autoconf +libtoolize --force --copy +automake --add-missing diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf new file mode 100644 index 0000000..2eb7c88 --- /dev/null +++ b/packaging/baselibs.conf @@ -0,0 +1,3 @@ +libsqlite + obsoletes "sqlite- <= " + provides "sqlite- = " diff --git a/packaging/sqlite.changes b/packaging/sqlite.changes new file mode 100644 index 0000000..0ca15dc --- /dev/null +++ b/packaging/sqlite.changes @@ -0,0 +1,9 @@ +* Thu Apr 11 2013 Anas Nashif submit/trunk/20130319.034032@4baf1c1 +- enable thread safe option + +* Sun Mar 17 2013 Anas Nashif submit/trunk/20130104.051124@7fc6e9d +- Update package groups + +* Thu Jan 03 2013 Anas Nashif upstream/3.7.14@aad28b0 +- devel package requires exec + diff --git a/packaging/sqlite.manifest b/packaging/sqlite.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/packaging/sqlite.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/sqlite.spec b/packaging/sqlite.spec new file mode 100644 index 0000000..b9a419e --- /dev/null +++ b/packaging/sqlite.spec @@ -0,0 +1,118 @@ +%global tarversion 3330000 + +Name: sqlite +Version: 3.33.0 +Release: 0 +License: Public-Domain +Summary: Embeddable SQL Database Engine +Url: http://www.sqlite.org/ +Group: System/Database +Source0: sqlite-autoconf-%{tarversion}.tar.gz +Source1: baselibs.conf +Source2: sqlite_journal_mode_persist.patch +Source3: sqlite_default_flag.patch +Source1001: sqlite.manifest +BuildRequires: pkgconfig(pkg-config) +Requires: libsqlite = %{version} +Provides: sqlite3 + +%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 libsqlite +Summary: Shared libraries for the Embeddable SQL Database Engine +Group: System/Database +Provides: libsqlite3 + +%description -n libsqlite +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 +Requires: glibc-devel +Requires: libsqlite = %{version} +Requires: sqlite +Provides: sqlite3-devel = %{version} +Obsoletes: sqlite3-devel < %{version} +Conflicts: sqlcipher-devel + +%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. + +%prep +%setup -q -n sqlite-autoconf-%tarversion +cp %{SOURCE1001} . +%{__patch} -p1 < %{SOURCE2} +%{__patch} -p1 < %{SOURCE3} + +%build +CFLAGS=`echo %{optflags} |sed -e 's/-ffast-math//g'` +CFLAGS+=" -fPIE" +LDFLAGS+=" -pie" +%{?asan:CFLAGS+=" -lpthread -ldl "} +chmod +x autogen.sh +%autogen +%configure -disable-dependency-tracking \ + --enable-shared=yes \ + --enable-static=no \ + --enable-threadsafe \ + --enable-fts5 + +make + +%install +%make_install + +%post -n libsqlite -p /sbin/ldconfig + +%postun -n libsqlite -p /sbin/ldconfig + +%files +%manifest %{name}.manifest +%defattr(-,root,root) +%{_bindir}/sqlite3 + +%files -n libsqlite +%manifest %{name}.manifest +%defattr(-,root,root) +%{_libdir}/libsqlite*.so.* + +%files devel +%manifest %{name}.manifest +%defattr(-,root,root) +%{_includedir}/*.h +%{_libdir}/libsqlite*.so +%{_libdir}/pkgconfig/sqlite3.pc + +%docs_package diff --git a/packaging/sqlite_default_flag.patch b/packaging/sqlite_default_flag.patch new file mode 100644 index 0000000..4b78d9c --- /dev/null +++ b/packaging/sqlite_default_flag.patch @@ -0,0 +1,24 @@ +diff --git a/Makefile.am b/Makefile.am +index 20af743..8c76d57 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,5 +1,18 @@ + +-AM_CFLAGS = @BUILD_CFLAGS@ ++AM_CFLAGS = @BUILD_CFLAGS@ \ ++ -DSQLITE_ENABLE_COLUMN_METADATA \ ++ -DSQLITE_ENABLE_MEMORY_MANAGEMENT \ ++ -DSQLITE_DEFAULT_AUTOVACUUM=1 \ ++ -DSQLITE_DEFAULT_PAGE_SIZE=4096 \ ++ -Dfdatasync=fdatasync \ ++ -DSQLITE_TIZEN_FEATURE \ ++ -DSQLITE_TEMP_STORE=2 \ ++ -DHAVE_USLEEP=1 \ ++ -DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=4194304 \ ++ -DSQLITE_DEFAULT_FILE_FORMAT=4 \ ++ -DSQLITE_POWERSAFE_OVERWRITE=1 \ ++ -DSQLITE_ENABLE_ATOMIC_WRITE ++ + lib_LTLIBRARIES = libsqlite3.la + libsqlite3_la_SOURCES = sqlite3.c + libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 diff --git a/packaging/sqlite_journal_mode_persist.patch b/packaging/sqlite_journal_mode_persist.patch new file mode 100644 index 0000000..7b11bcc --- /dev/null +++ b/packaging/sqlite_journal_mode_persist.patch @@ -0,0 +1,16 @@ +diff --git a/sqlite3.c b/sqlite3.c +index 8fd740b..ce02d70 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -55804,6 +55804,11 @@ act_like_temp_file: + }else if( memDb || memJM ){ + pPager->journalMode = PAGER_JOURNALMODE_MEMORY; + } ++#ifdef SQLITE_TIZEN_FEATURE ++ else { ++ pPager->journalMode = PAGER_JOURNALMODE_PERSIST; ++ } ++#endif + /* pPager->xBusyHandler = 0; */ + /* pPager->pBusyHandlerArg = 0; */ + pPager->xReiniter = xReinit; -- 2.7.4