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 wal_replication # WAL replication support
16 %ifarch alpha sparc %{x8664}
20 # disabling tcl currently breaks making test target,
21 # some hack in Makefile needs to be done
26 # sqlite3 version with zero padded without any dots (3 08 10 01 is 3.8.10.1)
27 # but trailing 00 means no 4rd part (3 11 01 00 is 3.11.1)
29 %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 Summary: SQLite3 library
33 Summary(pl.UTF-8): Biblioteka SQLite3
37 License: Public Domain
39 # Source0Download: http://www.sqlite.org/download.html
40 Source0: http://www.sqlite.org/2018/sqlite-src-%{vnum}.zip
41 # Source0-md5: d0fbd4d8a8b99a8b6aa9405dace570c0
42 Patch0: %{name}-sign-function.patch
43 # https://github.com/CanonicalLtd/dqlite/issues/91
44 Patch1: https://github.com/CanonicalLtd/sqlite/releases/download/version-%{ver}%%2Breplication3/sqlite-%{ver}.diff
45 # Patch1-md5: a865f0b6a7b72be0b48c3a6ddf4fd4a5
46 URL: http://www.sqlite.org/
47 BuildRequires: autoconf >= 2.50
48 BuildRequires: automake
49 %{!?with_readline:BuildRequires: libedit-devel}
50 BuildRequires: libtool
51 %{?with_readline:BuildRequires: readline-devel}
52 %{?with_load_extension:BuildRequires: sed >= 4.0}
54 %{?with_tcl:BuildRequires: tcl-devel >= %{tclver}}
56 Requires: %{name}-libs = %{version}-%{release}
57 %{?with_icu:Provides: %{name}(icu) = %{version}}
58 %{?with_load_extension:Provides: %{name}(load_extension) = %{version}}
59 %{?with_unlock_notify:Provides: %{name}(unlock_notify) = %{version}}
60 %{?with_wal_replication:Provides: %{name}(wal_replication) = %{version}}
61 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63 %define _ulibdir /usr/lib
66 SQLite is a C library that implements an SQL database engine. A large
67 subset of SQL92 is supported. A complete database is stored in a
68 single disk file. The API is designed for convenience and ease of use.
69 Applications that link against SQLite can enjoy the power and
70 flexiblity of an SQL database without the administrative hassles of
71 supporting a separate database server. Because it omits the
72 client-server interaction overhead and writes directly to disk, SQLite
73 is also faster than the big database servers for most operations. In
74 addition to the C library, the SQLite distribution includes a
75 command-line tool for interacting with SQLite databases and SQLite
78 %description -l pl.UTF-8
79 SQLite jest biblioteką języka C, która implementuje silnik baz danych
80 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
81 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
82 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
83 danych bez konieczności utrzymywania osobnego serwera baz danych.
84 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
85 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
86 bazodanowych przy większości operacji na bazie danych. Dodatkowo
87 oprócz biblioteki języka C, dostarczany jest program do zarządzania
91 Summary: Shared library for the sqlite3 embeddable SQL database engine
92 Summary(pl.UTF-8): Biblioteka współdzielona osadzalnego silnika baz danych SQL sqlite3
94 %{?with_icu:Provides: %{name}-libs(icu) = %{version}}
95 %{?with_load_extension:Provides: %{name}-libs(load_extension) = %{version}}
96 %{?with_unlock_notify:Provides: %{name}-libs(unlock_notify) = %{version}}
97 %{?with_wal_replication:Provides: %{name}-libs(wal_replication) = %{version}}
98 Conflicts: sqlite3 < 3.23.1-2
101 This package contains the SQLite 3 shared library.
103 %description libs -l pl.UTF-8
104 Ten pakiet zawiera bibliotekę współdzieloną SQLite 3.
107 Summary: Header files for SQLite development
108 Summary(pl.UTF-8): Pliki nagłówkowe SQLite
109 Group: Development/Libraries
110 Requires: %{name}-libs = %{version}-%{release}
111 %if %{with unlock_notify}
112 Provides: %{name}-devel(unlock_notify) = %{version}
114 %if %{with load_extension}
115 Provides: %{name}-devel(load_extension) = %{version}
118 Provides: %{name}-devel(icu) = %{version}
120 %{?with_wal_replication:Provides: %{name}-devel(wal_replication) = %{version}}
123 SQLite is a C library that implements an SQL database engine. A large
124 subset of SQL92 is supported. A complete database is stored in a
125 single disk file. The API is designed for convenience and ease of use.
126 Applications that link against SQLite can enjoy the power and
127 flexiblity of an SQL database without the administrative hassles of
128 supporting a separate database server. Because it omits the
129 client-server interaction overhead and writes directly to disk, SQLite
130 is also faster than the big database servers for most operations. In
131 addition to the C library, the SQLite distribution includes a
132 command-line tool for interacting with SQLite databases and SQLite
135 This package contains the header files needed to develop programs that
138 %description devel -l pl.UTF-8
139 SQLite jest biblioteką języka C, która implementuje silnik baz danych
140 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
141 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
142 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
143 danych bez konieczności utrzymywania osobnego serwera baz danych.
144 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
145 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
146 bazodanowych przy większości operacji na bazie danych. Dodatkowo
147 oprócz biblioteki języka C, dostarczany jest program do zarządzania
150 Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów
151 używających biblioteki SQLite.
154 Summary: Static libraries for SQLite development
155 Summary(pl.UTF-8): Statyczne biblioteki SQLite
156 Group: Development/Libraries
157 Requires: %{name}-devel = %{version}-%{release}
158 %if %{with unclock_notify}
159 Provides: %{name}-static(unlock_notify)
161 %if %{with load_extension}
162 Provides: %{name}-static(load_extension)
164 %{?with_wal_replication:Provides: %{name}-static(wal_replication)}
167 SQLite is a C library that implements an SQL database engine. A large
168 subset of SQL92 is supported. A complete database is stored in a
169 single disk file. The API is designed for convenience and ease of use.
170 Applications that link against SQLite can enjoy the power and
171 flexiblity of an SQL database without the administrative hassles of
172 supporting a separate database server. Because it omits the
173 client-server interaction overhead and writes directly to disk, SQLite
174 is also faster than the big database servers for most operations. In
175 addition to the C library, the SQLite distribution includes a
176 command-line tool for interacting with SQLite databases and SQLite
179 This package contains the static SQLite libraries.
181 %description static -l pl.UTF-8
182 SQLite jest biblioteką języka C, która implementuje silnik baz danych
183 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
184 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
185 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
186 danych bez konieczności utrzymywania osobnego serwera baz danych.
187 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
188 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
189 bazodanowych przy większości operacji na bazie danych. Dodatkowo
190 oprócz biblioteki języka C, dostarczany jest program do zarządzania
193 Pakiet zawiera statyczne biblioteki SQLite.
195 %package -n tcl-%{name}
196 Summary: sqlite3 tcl extension
197 Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl
198 Group: Development/Languages/Tcl
200 %description -n tcl-%{name}
201 sqlite3 tcl extension.
203 %description -n tcl-%{name} -l pl.UTF-8
204 Rozszerzenie sqlite3 dla Tcl.
207 %setup -q -n sqlite-src-%{vnum}
209 %{?with_wal_replication:%patch1 -p1}
211 %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in
213 if [ "$(cat VERSION)" != "%{version}" ]; then
214 echo "Tarball content doesn't match version %{version}." >&2
220 cp -f /usr/share/automake/config.sub .
222 %{__autoconf} --force
224 CPPFLAGS="$CPPFLAGS $*"
229 export CPPFLAGS="%{rpmcflags}"
232 export TCLLIBDIR="%{tcl_sitearch}/sqlite3"
235 append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE
237 # Support for optional ORDER BY and LIMIT clause on UPDATE and DELETE statements
238 append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
240 # Support column metadata functions.
241 # http://sqlite.org/c3ref/column_database_name.html
242 # http://sqlite.org/c3ref/table_column_metadata.html
243 append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
245 # Support Full-Text Search versions 3 and 4.
246 # http://sqlite.org/fts3.html
247 #append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61
248 append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
249 append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER
252 # http://sqlite.org/rtree.html
253 append-cppflags -DSQLITE_ENABLE_RTREE
255 # Support Geopoly module (new as of 3.25.0)
256 # https://www.sqlite.org/geopoly.html
257 append-cppflags -DSQLITE_ENABLE_GEOPOLY
259 # Support soundex() function.
260 # http://sqlite.org/lang_corefunc.html#soundex
261 #append-cppflags -DSQLITE_SOUNDEX
263 # Support dbstat virtual table.
264 # https://www.sqlite.org/dbstat.html
265 append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
267 # Support for session extension (record changes to a changeset).
268 # https://www.sqlite.org/sessionintro.html
269 append-cppflags -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK
271 %if %{with unlock_notify}
272 # Support unlock notification.
273 # http://sqlite.org/unlock_notify.html
274 append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
278 append-cppflags -DSQLITE_ENABLE_ICU
279 append-libs "-licui18n -licuuc"
282 %if %{with load_extension}
286 %if %{with wal_replication}
287 # A patched version of SQLite with support for WAL-based replication
288 append-cppflags -DSQLITE_ENABLE_WAL_REPLICATION
292 %{?with_readline:--disable-editline} \
293 %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \
294 %{__enable_disable load_extension load-extension} \
295 --enable-threadsafe \
304 %{?with_tests:LC_ALL=C %{__make} test}
307 rm -rf $RPM_BUILD_ROOT
308 install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1}
311 DESTDIR=$RPM_BUILD_ROOT
313 %{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
314 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so
315 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \
316 $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so
318 cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1
321 rm -rf $RPM_BUILD_ROOT
323 %post libs -p /sbin/ldconfig
324 %postun libs -p /sbin/ldconfig
327 %defattr(644,root,root,755)
328 %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.*
329 %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0
332 %defattr(644,root,root,755)
334 %attr(755,root,root) %{_bindir}/sqlite3
335 %{_mandir}/man1/sqlite3.1*
338 %defattr(644,root,root,755)
339 %attr(755,root,root) %{_libdir}/libsqlite3.so
340 %{_libdir}/libsqlite3.la
341 %{_includedir}/sqlite3.h
342 %{_includedir}/sqlite3ext.h
343 %{_pkgconfigdir}/sqlite3.pc
346 %defattr(644,root,root,755)
347 %{_libdir}/libsqlite3.a
350 %files -n tcl-%{name}
351 %defattr(644,root,root,755)
352 %dir %{_libdir}/tcl*/sqlite3
353 %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so
354 %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl