2 # - some tests fail with tcl8.5, it's tcl fault,
3 # if someone REALLY cares (s)he can look into it
4 # - sqlite binary is linked statically with sqlite library
7 %bcond_with tests # run tests
8 %bcond_with readline # readline (GPL) instead of libedit
9 %bcond_without tcl # Tcl extension
10 %bcond_without doc # disable documentation building
11 %bcond_without unlock_notify # disable unlock notify API
12 %bcond_without load_extension # enable load extension API
13 %bcond_with icu # ICU tokenizer support
14 %bcond_without json1 # json1 extension
15 %bcond_with wal_replication # WAL replication support
21 # disabling tcl currently breaks making test target,
22 # some hack in Makefile needs to be done
27 # sqlite3 version with zero padded without any dots (3 08 10 01 is 3.8.10.1)
28 # but trailing 00 means no 4rd part (3 11 01 00 is 3.11.1)
30 %define ver %{lua:vn=rpm.expand("%vnum");v="";for i in string.gmatch(string.format("%08d", vn), "..") do v=v.."."..i:gsub("^0", "");end;v=v:gsub("^.",""):gsub("\.0$","");print(v)}
32 # wal replication version
36 Summary: SQLite3 library
37 Summary(pl.UTF-8): Biblioteka SQLite3
41 License: Public Domain
43 # Source0Download: http://www.sqlite.org/download.html
44 Source0: https://www.sqlite.org/2020/sqlite-src-%{vnum}.zip
45 # Source0-md5: ce61b97012ab111d1ccd7f2d97922ec7
46 Patch0: %{name}-sign-function.patch
47 # https://github.com/CanonicalLtd/dqlite/issues/91
48 Patch1: https://github.com/CanonicalLtd/sqlite/releases/download/version-%{walver}+replication4/sqlite-%{walver}.diff
49 # Patch1-md5: 26055e71b9e58cb765b9744626d453f9
50 URL: https://www.sqlite.org/
51 BuildRequires: autoconf >= 2.50
52 BuildRequires: automake
53 %{!?with_readline:BuildRequires: libedit-devel}
54 BuildRequires: libtool
55 %{?with_readline:BuildRequires: readline-devel}
56 BuildRequires: rpmbuild(macros) >= 1.527
57 %{?with_load_extension:BuildRequires: sed >= 4.0}
59 %{?with_tcl:BuildRequires: tcl-devel >= %{tclver}}
61 Requires: %{name}-libs = %{version}-%{release}
62 %{?with_icu:Provides: %{name}(icu) = %{version}}
63 %{?with_load_extension:Provides: %{name}(load_extension) = %{version}}
64 %{?with_unlock_notify:Provides: %{name}(unlock_notify) = %{version}}
65 %{?with_wal_replication:Provides: %{name}(wal_replication) = %{version}}
66 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68 %define _ulibdir /usr/lib
71 SQLite is a C library that implements an SQL database engine. A large
72 subset of SQL92 is supported. A complete database is stored in a
73 single disk file. The API is designed for convenience and ease of use.
74 Applications that link against SQLite can enjoy the power and
75 flexiblity of an SQL database without the administrative hassles of
76 supporting a separate database server. Because it omits the
77 client-server interaction overhead and writes directly to disk, SQLite
78 is also faster than the big database servers for most operations. In
79 addition to the C library, the SQLite distribution includes a
80 command-line tool for interacting with SQLite databases and SQLite
83 %description -l pl.UTF-8
84 SQLite jest biblioteką języka C, która implementuje silnik baz danych
85 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
86 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
87 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
88 danych bez konieczności utrzymywania osobnego serwera baz danych.
89 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
90 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
91 bazodanowych przy większości operacji na bazie danych. Dodatkowo
92 oprócz biblioteki języka C, dostarczany jest program do zarządzania
96 Summary: Shared library for the sqlite3 embeddable SQL database engine
97 Summary(pl.UTF-8): Biblioteka współdzielona osadzalnego silnika baz danych SQL sqlite3
99 %{?with_icu:Provides: %{name}-libs(icu) = %{version}}
100 %{?with_load_extension:Provides: %{name}-libs(load_extension) = %{version}}
101 %{?with_unlock_notify:Provides: %{name}-libs(unlock_notify) = %{version}}
102 %{?with_wal_replication:Provides: %{name}-libs(wal_replication) = %{version}}
103 Conflicts: sqlite3 < 3.23.1-2
106 This package contains the SQLite 3 shared library.
108 %description libs -l pl.UTF-8
109 Ten pakiet zawiera bibliotekę współdzieloną SQLite 3.
112 Summary: Header files for SQLite development
113 Summary(pl.UTF-8): Pliki nagłówkowe SQLite
114 Group: Development/Libraries
115 Requires: %{name}-libs = %{version}-%{release}
116 %if %{with unlock_notify}
117 Provides: %{name}-devel(unlock_notify) = %{version}
119 %if %{with load_extension}
120 Provides: %{name}-devel(load_extension) = %{version}
123 Provides: %{name}-devel(icu) = %{version}
125 %{?with_wal_replication:Provides: %{name}-devel(wal_replication) = %{version}}
128 SQLite is a C library that implements an SQL database engine. A large
129 subset of SQL92 is supported. A complete database is stored in a
130 single disk file. The API is designed for convenience and ease of use.
131 Applications that link against SQLite can enjoy the power and
132 flexiblity of an SQL database without the administrative hassles of
133 supporting a separate database server. Because it omits the
134 client-server interaction overhead and writes directly to disk, SQLite
135 is also faster than the big database servers for most operations. In
136 addition to the C library, the SQLite distribution includes a
137 command-line tool for interacting with SQLite databases and SQLite
140 This package contains the header files needed to develop programs that
143 %description devel -l pl.UTF-8
144 SQLite jest biblioteką języka C, która implementuje silnik baz danych
145 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
146 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
147 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
148 danych bez konieczności utrzymywania osobnego serwera baz danych.
149 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
150 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
151 bazodanowych przy większości operacji na bazie danych. Dodatkowo
152 oprócz biblioteki języka C, dostarczany jest program do zarządzania
155 Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów
156 używających biblioteki SQLite.
159 Summary: Static libraries for SQLite development
160 Summary(pl.UTF-8): Statyczne biblioteki SQLite
161 Group: Development/Libraries
162 Requires: %{name}-devel = %{version}-%{release}
163 %if %{with unclock_notify}
164 Provides: %{name}-static(unlock_notify)
166 %if %{with load_extension}
167 Provides: %{name}-static(load_extension)
169 %{?with_wal_replication:Provides: %{name}-static(wal_replication)}
172 SQLite is a C library that implements an SQL database engine. A large
173 subset of SQL92 is supported. A complete database is stored in a
174 single disk file. The API is designed for convenience and ease of use.
175 Applications that link against SQLite can enjoy the power and
176 flexiblity of an SQL database without the administrative hassles of
177 supporting a separate database server. Because it omits the
178 client-server interaction overhead and writes directly to disk, SQLite
179 is also faster than the big database servers for most operations. In
180 addition to the C library, the SQLite distribution includes a
181 command-line tool for interacting with SQLite databases and SQLite
184 This package contains the static SQLite libraries.
186 %description static -l pl.UTF-8
187 SQLite jest biblioteką języka C, która implementuje silnik baz danych
188 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
189 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
190 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
191 danych bez konieczności utrzymywania osobnego serwera baz danych.
192 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
193 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
194 bazodanowych przy większości operacji na bazie danych. Dodatkowo
195 oprócz biblioteki języka C, dostarczany jest program do zarządzania
198 Pakiet zawiera statyczne biblioteki SQLite.
200 %package -n tcl-%{name}
201 Summary: sqlite3 tcl extension
202 Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl
203 Group: Development/Languages/Tcl
205 %description -n tcl-%{name}
206 sqlite3 tcl extension.
208 %description -n tcl-%{name} -l pl.UTF-8
209 Rozszerzenie sqlite3 dla Tcl.
212 %setup -q -n sqlite-src-%{vnum}
214 %{?with_wal_replication:%patch1 -p1}
216 %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in
218 if [ "$(cat VERSION)" != "%{version}" ]; then
219 echo "Tarball content doesn't match version %{version}." >&2
226 %{__autoconf} --force
228 CPPFLAGS="$CPPFLAGS $*"
233 export CPPFLAGS="%{rpmcflags}"
236 export TCLLIBDIR="%{tcl_sitearch}/sqlite3"
239 append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE
241 # Support for optional ORDER BY and LIMIT clause on UPDATE and DELETE statements
242 append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
244 # Support column metadata functions.
245 # http://sqlite.org/c3ref/column_database_name.html
246 # http://sqlite.org/c3ref/table_column_metadata.html
247 append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
249 # Support Full-Text Search versions 3 and 4.
250 # http://sqlite.org/fts3.html
251 #append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61
252 append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
253 append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER
256 # http://sqlite.org/rtree.html
257 append-cppflags -DSQLITE_ENABLE_RTREE
259 # Support Geopoly module (new as of 3.25.0)
260 # https://www.sqlite.org/geopoly.html
261 append-cppflags -DSQLITE_ENABLE_GEOPOLY
263 # Support soundex() function.
264 # http://sqlite.org/lang_corefunc.html#soundex
265 #append-cppflags -DSQLITE_SOUNDEX
267 # Support dbstat virtual table.
268 # https://www.sqlite.org/dbstat.html
269 append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
271 # Support for session extension (record changes to a changeset).
272 # https://www.sqlite.org/sessionintro.html
273 append-cppflags -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK
275 %if %{with unlock_notify}
276 # Support unlock notification.
277 # http://sqlite.org/unlock_notify.html
278 append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
282 append-cppflags -DSQLITE_ENABLE_ICU
283 append-libs "-licui18n -licuuc"
286 %if %{with load_extension}
290 %if %{with wal_replication}
291 # A patched version of SQLite with support for WAL-based replication
292 append-cppflags -DSQLITE_ENABLE_WAL_REPLICATION
296 %{?with_readline:--disable-editline} \
297 %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \
298 %{__enable_disable load_extension load-extension} \
299 %{__enable_disable json1} \
300 --enable-threadsafe \
309 %{?with_tests:LC_ALL=C %{__make} test}
312 rm -rf $RPM_BUILD_ROOT
313 install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1}
316 DESTDIR=$RPM_BUILD_ROOT
318 %{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
319 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so
320 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \
321 $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so
323 cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1
326 rm -rf $RPM_BUILD_ROOT
328 %post libs -p /sbin/ldconfig
329 %postun libs -p /sbin/ldconfig
332 %defattr(644,root,root,755)
333 %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.*
334 %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0
337 %defattr(644,root,root,755)
339 %attr(755,root,root) %{_bindir}/sqlite3
340 %{_mandir}/man1/sqlite3.1*
343 %defattr(644,root,root,755)
344 %attr(755,root,root) %{_libdir}/libsqlite3.so
345 %{_libdir}/libsqlite3.la
346 %{_includedir}/sqlite3.h
347 %{_includedir}/sqlite3ext.h
348 %{_pkgconfigdir}/sqlite3.pc
351 %defattr(644,root,root,755)
352 %{_libdir}/libsqlite3.a
355 %files -n tcl-%{name}
356 %defattr(644,root,root,755)
357 %dir %{_libdir}/tcl*/sqlite3
358 %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so
359 %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl