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: dfc2ae0e9b810e9e3db553f71ea832ad
42 Patch0: %{name}-sign-function.patch
43 # https://github.com/CanonicalLtd/dqlite/issues/91
44 %if %{with wal_replication}
45 Patch1: https://github.com/CanonicalLtd/sqlite/releases/download/version-%{ver}%%2Breplication3/sqlite-%{ver}.diff
46 # Patch1-md5: a865f0b6a7b72be0b48c3a6ddf4fd4a5
48 URL: http://www.sqlite.org/
49 BuildRequires: autoconf >= 2.50
50 BuildRequires: automake
51 %{!?with_readline:BuildRequires: libedit-devel}
52 BuildRequires: libtool
53 %{?with_readline:BuildRequires: readline-devel}
54 %{?with_load_extension:BuildRequires: sed >= 4.0}
56 %{?with_tcl:BuildRequires: tcl-devel >= %{tclver}}
58 Requires: %{name}-libs = %{version}-%{release}
59 %{?with_icu:Provides: %{name}(icu) = %{version}}
60 %{?with_load_extension:Provides: %{name}(load_extension) = %{version}}
61 %{?with_unlock_notify:Provides: %{name}(unlock_notify) = %{version}}
62 %{?with_wal_replication:Provides: %{name}(wal_replication) = %{version}}
63 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65 %define _ulibdir /usr/lib
68 SQLite is a C library that implements an SQL database engine. A large
69 subset of SQL92 is supported. A complete database is stored in a
70 single disk file. The API is designed for convenience and ease of use.
71 Applications that link against SQLite can enjoy the power and
72 flexiblity of an SQL database without the administrative hassles of
73 supporting a separate database server. Because it omits the
74 client-server interaction overhead and writes directly to disk, SQLite
75 is also faster than the big database servers for most operations. In
76 addition to the C library, the SQLite distribution includes a
77 command-line tool for interacting with SQLite databases and SQLite
80 %description -l pl.UTF-8
81 SQLite jest biblioteką języka C, która implementuje silnik baz danych
82 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
83 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
84 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
85 danych bez konieczności utrzymywania osobnego serwera baz danych.
86 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
87 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
88 bazodanowych przy większości operacji na bazie danych. Dodatkowo
89 oprócz biblioteki języka C, dostarczany jest program do zarządzania
93 Summary: Shared library for the sqlite3 embeddable SQL database engine
94 Summary(pl.UTF-8): Biblioteka współdzielona osadzalnego silnika baz danych SQL sqlite3
96 %{?with_icu:Provides: %{name}-libs(icu) = %{version}}
97 %{?with_load_extension:Provides: %{name}-libs(load_extension) = %{version}}
98 %{?with_unlock_notify:Provides: %{name}-libs(unlock_notify) = %{version}}
99 %{?with_wal_replication:Provides: %{name}-libs(wal_replication) = %{version}}
100 Conflicts: sqlite3 < 3.23.1-2
103 This package contains the SQLite 3 shared library.
105 %description libs -l pl.UTF-8
106 Ten pakiet zawiera bibliotekę współdzieloną SQLite 3.
109 Summary: Header files for SQLite development
110 Summary(pl.UTF-8): Pliki nagłówkowe SQLite
111 Group: Development/Libraries
112 Requires: %{name}-libs = %{version}-%{release}
113 %if %{with unlock_notify}
114 Provides: %{name}-devel(unlock_notify) = %{version}
116 %if %{with load_extension}
117 Provides: %{name}-devel(load_extension) = %{version}
120 Provides: %{name}-devel(icu) = %{version}
122 %{?with_wal_replication:Provides: %{name}-devel(wal_replication) = %{version}}
125 SQLite is a C library that implements an SQL database engine. A large
126 subset of SQL92 is supported. A complete database is stored in a
127 single disk file. The API is designed for convenience and ease of use.
128 Applications that link against SQLite can enjoy the power and
129 flexiblity of an SQL database without the administrative hassles of
130 supporting a separate database server. Because it omits the
131 client-server interaction overhead and writes directly to disk, SQLite
132 is also faster than the big database servers for most operations. In
133 addition to the C library, the SQLite distribution includes a
134 command-line tool for interacting with SQLite databases and SQLite
137 This package contains the header files needed to develop programs that
140 %description devel -l pl.UTF-8
141 SQLite jest biblioteką języka C, która implementuje silnik baz danych
142 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
143 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
144 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
145 danych bez konieczności utrzymywania osobnego serwera baz danych.
146 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
147 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
148 bazodanowych przy większości operacji na bazie danych. Dodatkowo
149 oprócz biblioteki języka C, dostarczany jest program do zarządzania
152 Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów
153 używających biblioteki SQLite.
156 Summary: Static libraries for SQLite development
157 Summary(pl.UTF-8): Statyczne biblioteki SQLite
158 Group: Development/Libraries
159 Requires: %{name}-devel = %{version}-%{release}
160 %if %{with unclock_notify}
161 Provides: %{name}-static(unlock_notify)
163 %if %{with load_extension}
164 Provides: %{name}-static(load_extension)
166 %{?with_wal_replication:Provides: %{name}-static(wal_replication)}
169 SQLite is a C library that implements an SQL database engine. A large
170 subset of SQL92 is supported. A complete database is stored in a
171 single disk file. The API is designed for convenience and ease of use.
172 Applications that link against SQLite can enjoy the power and
173 flexiblity of an SQL database without the administrative hassles of
174 supporting a separate database server. Because it omits the
175 client-server interaction overhead and writes directly to disk, SQLite
176 is also faster than the big database servers for most operations. In
177 addition to the C library, the SQLite distribution includes a
178 command-line tool for interacting with SQLite databases and SQLite
181 This package contains the static SQLite libraries.
183 %description static -l pl.UTF-8
184 SQLite jest biblioteką języka C, która implementuje silnik baz danych
185 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
186 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
187 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
188 danych bez konieczności utrzymywania osobnego serwera baz danych.
189 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
190 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
191 bazodanowych przy większości operacji na bazie danych. Dodatkowo
192 oprócz biblioteki języka C, dostarczany jest program do zarządzania
195 Pakiet zawiera statyczne biblioteki SQLite.
197 %package -n tcl-%{name}
198 Summary: sqlite3 tcl extension
199 Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl
200 Group: Development/Languages/Tcl
202 %description -n tcl-%{name}
203 sqlite3 tcl extension.
205 %description -n tcl-%{name} -l pl.UTF-8
206 Rozszerzenie sqlite3 dla Tcl.
209 %setup -q -n sqlite-src-%{vnum}
211 %{?with_wal_replication:%patch1 -p1}
213 %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in
215 if [ "$(cat VERSION)" != "%{version}" ]; then
216 echo "Tarball content doesn't match version %{version}." >&2
222 cp -f /usr/share/automake/config.sub .
224 %{__autoconf} --force
226 CPPFLAGS="$CPPFLAGS $*"
231 export CPPFLAGS="%{rpmcflags}"
234 export TCLLIBDIR="%{tcl_sitearch}/sqlite3"
237 append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE
239 # Support for optional ORDER BY and LIMIT clause on UPDATE and DELETE statements
240 append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
242 # Support column metadata functions.
243 # http://sqlite.org/c3ref/column_database_name.html
244 # http://sqlite.org/c3ref/table_column_metadata.html
245 append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
247 # Support Full-Text Search versions 3 and 4.
248 # http://sqlite.org/fts3.html
249 #append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61
250 append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
251 append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER
254 # http://sqlite.org/rtree.html
255 append-cppflags -DSQLITE_ENABLE_RTREE
257 # Support Geopoly module (new as of 3.25.0)
258 # https://www.sqlite.org/geopoly.html
259 append-cppflags -DSQLITE_ENABLE_GEOPOLY
261 # Support soundex() function.
262 # http://sqlite.org/lang_corefunc.html#soundex
263 #append-cppflags -DSQLITE_SOUNDEX
265 # Support dbstat virtual table.
266 # https://www.sqlite.org/dbstat.html
267 append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
269 # Support for session extension (record changes to a changeset).
270 # https://www.sqlite.org/sessionintro.html
271 append-cppflags -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK
273 %if %{with unlock_notify}
274 # Support unlock notification.
275 # http://sqlite.org/unlock_notify.html
276 append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
280 append-cppflags -DSQLITE_ENABLE_ICU
281 append-libs "-licui18n -licuuc"
284 %if %{with load_extension}
288 %if %{with wal_replication}
289 # A patched version of SQLite with support for WAL-based replication
290 append-cppflags -DSQLITE_ENABLE_WAL_REPLICATION
294 %{?with_readline:--disable-editline} \
295 %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \
296 %{__enable_disable load_extension load-extension} \
297 --enable-threadsafe \
306 %{?with_tests:LC_ALL=C %{__make} test}
309 rm -rf $RPM_BUILD_ROOT
310 install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1}
313 DESTDIR=$RPM_BUILD_ROOT
315 %{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
316 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so
317 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \
318 $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so
320 cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1
323 rm -rf $RPM_BUILD_ROOT
325 %post libs -p /sbin/ldconfig
326 %postun libs -p /sbin/ldconfig
329 %defattr(644,root,root,755)
330 %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.*
331 %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0
334 %defattr(644,root,root,755)
336 %attr(755,root,root) %{_bindir}/sqlite3
337 %{_mandir}/man1/sqlite3.1*
340 %defattr(644,root,root,755)
341 %attr(755,root,root) %{_libdir}/libsqlite3.so
342 %{_libdir}/libsqlite3.la
343 %{_includedir}/sqlite3.h
344 %{_includedir}/sqlite3ext.h
345 %{_pkgconfigdir}/sqlite3.pc
348 %defattr(644,root,root,755)
349 %{_libdir}/libsqlite3.a
352 %files -n tcl-%{name}
353 %defattr(644,root,root,755)
354 %dir %{_libdir}/tcl*/sqlite3
355 %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so
356 %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl