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
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)}
31 # wal replication version
35 Summary: SQLite3 library
36 Summary(pl.UTF-8): Biblioteka SQLite3
40 License: Public Domain
42 # Source0Download: http://www.sqlite.org/download.html
43 Source0: https://www.sqlite.org/2019/sqlite-src-%{vnum}.zip
44 # Source0-md5: a090a543b1d17178627f280f0fe07324
45 Patch0: %{name}-sign-function.patch
46 # https://github.com/CanonicalLtd/dqlite/issues/91
47 Patch1: https://github.com/CanonicalLtd/sqlite/releases/download/version-%{walver}+replication3/sqlite-%{walver}.diff
48 # Patch1-md5: 117f94e914198df90aac081262bdd146
49 URL: https://www.sqlite.org/
50 BuildRequires: autoconf >= 2.50
51 BuildRequires: automake
52 %{!?with_readline:BuildRequires: libedit-devel}
53 BuildRequires: libtool
54 %{?with_readline:BuildRequires: readline-devel}
55 %{?with_load_extension:BuildRequires: sed >= 4.0}
57 %{?with_tcl:BuildRequires: tcl-devel >= %{tclver}}
59 Requires: %{name}-libs = %{version}-%{release}
60 %{?with_icu:Provides: %{name}(icu) = %{version}}
61 %{?with_load_extension:Provides: %{name}(load_extension) = %{version}}
62 %{?with_unlock_notify:Provides: %{name}(unlock_notify) = %{version}}
63 %{?with_wal_replication:Provides: %{name}(wal_replication) = %{version}}
64 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66 %define _ulibdir /usr/lib
69 SQLite is a C library that implements an SQL database engine. A large
70 subset of SQL92 is supported. A complete database is stored in a
71 single disk file. The API is designed for convenience and ease of use.
72 Applications that link against SQLite can enjoy the power and
73 flexiblity of an SQL database without the administrative hassles of
74 supporting a separate database server. Because it omits the
75 client-server interaction overhead and writes directly to disk, SQLite
76 is also faster than the big database servers for most operations. In
77 addition to the C library, the SQLite distribution includes a
78 command-line tool for interacting with SQLite databases and SQLite
81 %description -l pl.UTF-8
82 SQLite jest biblioteką języka C, która implementuje silnik baz danych
83 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
84 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
85 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
86 danych bez konieczności utrzymywania osobnego serwera baz danych.
87 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
88 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
89 bazodanowych przy większości operacji na bazie danych. Dodatkowo
90 oprócz biblioteki języka C, dostarczany jest program do zarządzania
94 Summary: Shared library for the sqlite3 embeddable SQL database engine
95 Summary(pl.UTF-8): Biblioteka współdzielona osadzalnego silnika baz danych SQL sqlite3
97 %{?with_icu:Provides: %{name}-libs(icu) = %{version}}
98 %{?with_load_extension:Provides: %{name}-libs(load_extension) = %{version}}
99 %{?with_unlock_notify:Provides: %{name}-libs(unlock_notify) = %{version}}
100 %{?with_wal_replication:Provides: %{name}-libs(wal_replication) = %{version}}
101 Conflicts: sqlite3 < 3.23.1-2
104 This package contains the SQLite 3 shared library.
106 %description libs -l pl.UTF-8
107 Ten pakiet zawiera bibliotekę współdzieloną SQLite 3.
110 Summary: Header files for SQLite development
111 Summary(pl.UTF-8): Pliki nagłówkowe SQLite
112 Group: Development/Libraries
113 Requires: %{name}-libs = %{version}-%{release}
114 %if %{with unlock_notify}
115 Provides: %{name}-devel(unlock_notify) = %{version}
117 %if %{with load_extension}
118 Provides: %{name}-devel(load_extension) = %{version}
121 Provides: %{name}-devel(icu) = %{version}
123 %{?with_wal_replication:Provides: %{name}-devel(wal_replication) = %{version}}
126 SQLite is a C library that implements an SQL database engine. A large
127 subset of SQL92 is supported. A complete database is stored in a
128 single disk file. The API is designed for convenience and ease of use.
129 Applications that link against SQLite can enjoy the power and
130 flexiblity of an SQL database without the administrative hassles of
131 supporting a separate database server. Because it omits the
132 client-server interaction overhead and writes directly to disk, SQLite
133 is also faster than the big database servers for most operations. In
134 addition to the C library, the SQLite distribution includes a
135 command-line tool for interacting with SQLite databases and SQLite
138 This package contains the header files needed to develop programs that
141 %description devel -l pl.UTF-8
142 SQLite jest biblioteką języka C, która implementuje silnik baz danych
143 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
144 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
145 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
146 danych bez konieczności utrzymywania osobnego serwera baz danych.
147 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
148 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
149 bazodanowych przy większości operacji na bazie danych. Dodatkowo
150 oprócz biblioteki języka C, dostarczany jest program do zarządzania
153 Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów
154 używających biblioteki SQLite.
157 Summary: Static libraries for SQLite development
158 Summary(pl.UTF-8): Statyczne biblioteki SQLite
159 Group: Development/Libraries
160 Requires: %{name}-devel = %{version}-%{release}
161 %if %{with unclock_notify}
162 Provides: %{name}-static(unlock_notify)
164 %if %{with load_extension}
165 Provides: %{name}-static(load_extension)
167 %{?with_wal_replication:Provides: %{name}-static(wal_replication)}
170 SQLite is a C library that implements an SQL database engine. A large
171 subset of SQL92 is supported. A complete database is stored in a
172 single disk file. The API is designed for convenience and ease of use.
173 Applications that link against SQLite can enjoy the power and
174 flexiblity of an SQL database without the administrative hassles of
175 supporting a separate database server. Because it omits the
176 client-server interaction overhead and writes directly to disk, SQLite
177 is also faster than the big database servers for most operations. In
178 addition to the C library, the SQLite distribution includes a
179 command-line tool for interacting with SQLite databases and SQLite
182 This package contains the static SQLite libraries.
184 %description static -l pl.UTF-8
185 SQLite jest biblioteką języka C, która implementuje silnik baz danych
186 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
187 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
188 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
189 danych bez konieczności utrzymywania osobnego serwera baz danych.
190 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
191 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
192 bazodanowych przy większości operacji na bazie danych. Dodatkowo
193 oprócz biblioteki języka C, dostarczany jest program do zarządzania
196 Pakiet zawiera statyczne biblioteki SQLite.
198 %package -n tcl-%{name}
199 Summary: sqlite3 tcl extension
200 Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl
201 Group: Development/Languages/Tcl
203 %description -n tcl-%{name}
204 sqlite3 tcl extension.
206 %description -n tcl-%{name} -l pl.UTF-8
207 Rozszerzenie sqlite3 dla Tcl.
210 %setup -q -n sqlite-src-%{vnum}
212 %{?with_wal_replication:%patch1 -p1}
214 %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in
216 if [ "$(cat VERSION)" != "%{version}" ]; then
217 echo "Tarball content doesn't match version %{version}." >&2
223 cp -f /usr/share/automake/config.sub .
225 %{__autoconf} --force
227 CPPFLAGS="$CPPFLAGS $*"
232 export CPPFLAGS="%{rpmcflags}"
235 export TCLLIBDIR="%{tcl_sitearch}/sqlite3"
238 append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE
240 # Support for optional ORDER BY and LIMIT clause on UPDATE and DELETE statements
241 append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
243 # Support column metadata functions.
244 # http://sqlite.org/c3ref/column_database_name.html
245 # http://sqlite.org/c3ref/table_column_metadata.html
246 append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
248 # Support Full-Text Search versions 3 and 4.
249 # http://sqlite.org/fts3.html
250 #append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61
251 append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
252 append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER
255 # http://sqlite.org/rtree.html
256 append-cppflags -DSQLITE_ENABLE_RTREE
258 # Support Geopoly module (new as of 3.25.0)
259 # https://www.sqlite.org/geopoly.html
260 append-cppflags -DSQLITE_ENABLE_GEOPOLY
262 # Support soundex() function.
263 # http://sqlite.org/lang_corefunc.html#soundex
264 #append-cppflags -DSQLITE_SOUNDEX
266 # Support dbstat virtual table.
267 # https://www.sqlite.org/dbstat.html
268 append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
270 # Support for session extension (record changes to a changeset).
271 # https://www.sqlite.org/sessionintro.html
272 append-cppflags -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK
274 %if %{with unlock_notify}
275 # Support unlock notification.
276 # http://sqlite.org/unlock_notify.html
277 append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
281 append-cppflags -DSQLITE_ENABLE_ICU
282 append-libs "-licui18n -licuuc"
285 %if %{with load_extension}
289 %if %{with wal_replication}
290 # A patched version of SQLite with support for WAL-based replication
291 append-cppflags -DSQLITE_ENABLE_WAL_REPLICATION
295 %{?with_readline:--disable-editline} \
296 %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \
297 %{__enable_disable load_extension load-extension} \
298 --enable-threadsafe \
307 %{?with_tests:LC_ALL=C %{__make} test}
310 rm -rf $RPM_BUILD_ROOT
311 install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1}
314 DESTDIR=$RPM_BUILD_ROOT
316 %{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
317 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so
318 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \
319 $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so
321 cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1
324 rm -rf $RPM_BUILD_ROOT
326 %post libs -p /sbin/ldconfig
327 %postun libs -p /sbin/ldconfig
330 %defattr(644,root,root,755)
331 %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.*
332 %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0
335 %defattr(644,root,root,755)
337 %attr(755,root,root) %{_bindir}/sqlite3
338 %{_mandir}/man1/sqlite3.1*
341 %defattr(644,root,root,755)
342 %attr(755,root,root) %{_libdir}/libsqlite3.so
343 %{_libdir}/libsqlite3.la
344 %{_includedir}/sqlite3.h
345 %{_includedir}/sqlite3ext.h
346 %{_pkgconfigdir}/sqlite3.pc
349 %defattr(644,root,root,755)
350 %{_libdir}/libsqlite3.a
353 %files -n tcl-%{name}
354 %defattr(644,root,root,755)
355 %dir %{_libdir}/tcl*/sqlite3
356 %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so
357 %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl