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_without 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: 57df57686c663a1a910b1148a04db2e5
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: 17ff8c8e6952445accffbf7fb51d1664
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 %{?with_load_extension:BuildRequires: sed >= 4.0}
58 %{?with_tcl:BuildRequires: tcl-devel >= %{tclver}}
60 Requires: %{name}-libs = %{version}-%{release}
61 %{?with_icu:Provides: %{name}(icu) = %{version}}
62 %{?with_load_extension:Provides: %{name}(load_extension) = %{version}}
63 %{?with_unlock_notify:Provides: %{name}(unlock_notify) = %{version}}
64 %{?with_wal_replication:Provides: %{name}(wal_replication) = %{version}}
65 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 %define _ulibdir /usr/lib
70 SQLite is a C library that implements an SQL database engine. A large
71 subset of SQL92 is supported. A complete database is stored in a
72 single disk file. The API is designed for convenience and ease of use.
73 Applications that link against SQLite can enjoy the power and
74 flexiblity of an SQL database without the administrative hassles of
75 supporting a separate database server. Because it omits the
76 client-server interaction overhead and writes directly to disk, SQLite
77 is also faster than the big database servers for most operations. In
78 addition to the C library, the SQLite distribution includes a
79 command-line tool for interacting with SQLite databases and SQLite
82 %description -l pl.UTF-8
83 SQLite jest biblioteką języka C, która implementuje silnik baz danych
84 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
85 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
86 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
87 danych bez konieczności utrzymywania osobnego serwera baz danych.
88 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
89 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
90 bazodanowych przy większości operacji na bazie danych. Dodatkowo
91 oprócz biblioteki języka C, dostarczany jest program do zarządzania
95 Summary: Shared library for the sqlite3 embeddable SQL database engine
96 Summary(pl.UTF-8): Biblioteka współdzielona osadzalnego silnika baz danych SQL sqlite3
98 %{?with_icu:Provides: %{name}-libs(icu) = %{version}}
99 %{?with_load_extension:Provides: %{name}-libs(load_extension) = %{version}}
100 %{?with_unlock_notify:Provides: %{name}-libs(unlock_notify) = %{version}}
101 %{?with_wal_replication:Provides: %{name}-libs(wal_replication) = %{version}}
102 Conflicts: sqlite3 < 3.23.1-2
105 This package contains the SQLite 3 shared library.
107 %description libs -l pl.UTF-8
108 Ten pakiet zawiera bibliotekę współdzieloną SQLite 3.
111 Summary: Header files for SQLite development
112 Summary(pl.UTF-8): Pliki nagłówkowe SQLite
113 Group: Development/Libraries
114 Requires: %{name}-libs = %{version}-%{release}
115 %if %{with unlock_notify}
116 Provides: %{name}-devel(unlock_notify) = %{version}
118 %if %{with load_extension}
119 Provides: %{name}-devel(load_extension) = %{version}
122 Provides: %{name}-devel(icu) = %{version}
124 %{?with_wal_replication:Provides: %{name}-devel(wal_replication) = %{version}}
127 SQLite is a C library that implements an SQL database engine. A large
128 subset of SQL92 is supported. A complete database is stored in a
129 single disk file. The API is designed for convenience and ease of use.
130 Applications that link against SQLite can enjoy the power and
131 flexiblity of an SQL database without the administrative hassles of
132 supporting a separate database server. Because it omits the
133 client-server interaction overhead and writes directly to disk, SQLite
134 is also faster than the big database servers for most operations. In
135 addition to the C library, the SQLite distribution includes a
136 command-line tool for interacting with SQLite databases and SQLite
139 This package contains the header files needed to develop programs that
142 %description devel -l pl.UTF-8
143 SQLite jest biblioteką języka C, która implementuje silnik baz danych
144 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
145 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
146 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
147 danych bez konieczności utrzymywania osobnego serwera baz danych.
148 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
149 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
150 bazodanowych przy większości operacji na bazie danych. Dodatkowo
151 oprócz biblioteki języka C, dostarczany jest program do zarządzania
154 Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów
155 używających biblioteki SQLite.
158 Summary: Static libraries for SQLite development
159 Summary(pl.UTF-8): Statyczne biblioteki SQLite
160 Group: Development/Libraries
161 Requires: %{name}-devel = %{version}-%{release}
162 %if %{with unclock_notify}
163 Provides: %{name}-static(unlock_notify)
165 %if %{with load_extension}
166 Provides: %{name}-static(load_extension)
168 %{?with_wal_replication:Provides: %{name}-static(wal_replication)}
171 SQLite is a C library that implements an SQL database engine. A large
172 subset of SQL92 is supported. A complete database is stored in a
173 single disk file. The API is designed for convenience and ease of use.
174 Applications that link against SQLite can enjoy the power and
175 flexiblity of an SQL database without the administrative hassles of
176 supporting a separate database server. Because it omits the
177 client-server interaction overhead and writes directly to disk, SQLite
178 is also faster than the big database servers for most operations. In
179 addition to the C library, the SQLite distribution includes a
180 command-line tool for interacting with SQLite databases and SQLite
183 This package contains the static SQLite libraries.
185 %description static -l pl.UTF-8
186 SQLite jest biblioteką języka C, która implementuje silnik baz danych
187 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
188 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
189 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
190 danych bez konieczności utrzymywania osobnego serwera baz danych.
191 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
192 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
193 bazodanowych przy większości operacji na bazie danych. Dodatkowo
194 oprócz biblioteki języka C, dostarczany jest program do zarządzania
197 Pakiet zawiera statyczne biblioteki SQLite.
199 %package -n tcl-%{name}
200 Summary: sqlite3 tcl extension
201 Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl
202 Group: Development/Languages/Tcl
204 %description -n tcl-%{name}
205 sqlite3 tcl extension.
207 %description -n tcl-%{name} -l pl.UTF-8
208 Rozszerzenie sqlite3 dla Tcl.
211 %setup -q -n sqlite-src-%{vnum}
213 %{?with_wal_replication:%patch1 -p1}
215 %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in
217 if [ "$(cat VERSION)" != "%{version}" ]; then
218 echo "Tarball content doesn't match version %{version}." >&2
224 cp -f /usr/share/automake/config.sub .
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