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
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: https://www.sqlite.org/2021/sqlite-src-%{vnum}.zip
41 # Source0-md5: c0e7ed93b17a2a86f07437be6c1abdb9
42 URL: https://www.sqlite.org/
43 BuildRequires: autoconf >= 2.50
44 BuildRequires: automake
45 %{!?with_readline:BuildRequires: libedit-devel}
46 BuildRequires: libtool
47 %{?with_readline:BuildRequires: readline-devel}
48 BuildRequires: rpmbuild(macros) >= 1.527
49 %{?with_load_extension:BuildRequires: sed >= 4.0}
51 %{?with_tcl:BuildRequires: tcl-devel >= %{tclver}}
53 Requires: %{name}-libs = %{version}-%{release}
54 %{?with_icu:Provides: %{name}(icu) = %{version}}
55 %{?with_load_extension:Provides: %{name}(load_extension) = %{version}}
56 %{?with_unlock_notify:Provides: %{name}(unlock_notify) = %{version}}
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 %define _ulibdir /usr/lib
62 SQLite is a C library that implements an SQL database engine. A large
63 subset of SQL92 is supported. A complete database is stored in a
64 single disk file. The API is designed for convenience and ease of use.
65 Applications that link against SQLite can enjoy the power and
66 flexiblity of an SQL database without the administrative hassles of
67 supporting a separate database server. Because it omits the
68 client-server interaction overhead and writes directly to disk, SQLite
69 is also faster than the big database servers for most operations. In
70 addition to the C library, the SQLite distribution includes a
71 command-line tool for interacting with SQLite databases and SQLite
74 %description -l pl.UTF-8
75 SQLite jest biblioteką języka C, która implementuje silnik baz danych
76 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
77 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
78 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
79 danych bez konieczności utrzymywania osobnego serwera baz danych.
80 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
81 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
82 bazodanowych przy większości operacji na bazie danych. Dodatkowo
83 oprócz biblioteki języka C, dostarczany jest program do zarządzania
87 Summary: Shared library for the sqlite3 embeddable SQL database engine
88 Summary(pl.UTF-8): Biblioteka współdzielona osadzalnego silnika baz danych SQL sqlite3
90 %{?with_icu:Provides: %{name}-libs(icu) = %{version}}
91 %{?with_load_extension:Provides: %{name}-libs(load_extension) = %{version}}
92 %{?with_unlock_notify:Provides: %{name}-libs(unlock_notify) = %{version}}
93 Conflicts: sqlite3 < 3.23.1-2
96 This package contains the SQLite 3 shared library.
98 %description libs -l pl.UTF-8
99 Ten pakiet zawiera bibliotekę współdzieloną SQLite 3.
102 Summary: Header files for SQLite development
103 Summary(pl.UTF-8): Pliki nagłówkowe SQLite
104 Group: Development/Libraries
105 Requires: %{name}-libs = %{version}-%{release}
106 %if %{with unlock_notify}
107 Provides: %{name}-devel(unlock_notify) = %{version}
109 %if %{with load_extension}
110 Provides: %{name}-devel(load_extension) = %{version}
113 Provides: %{name}-devel(icu) = %{version}
117 SQLite is a C library that implements an SQL database engine. A large
118 subset of SQL92 is supported. A complete database is stored in a
119 single disk file. The API is designed for convenience and ease of use.
120 Applications that link against SQLite can enjoy the power and
121 flexiblity of an SQL database without the administrative hassles of
122 supporting a separate database server. Because it omits the
123 client-server interaction overhead and writes directly to disk, SQLite
124 is also faster than the big database servers for most operations. In
125 addition to the C library, the SQLite distribution includes a
126 command-line tool for interacting with SQLite databases and SQLite
129 This package contains the header files needed to develop programs that
132 %description devel -l pl.UTF-8
133 SQLite jest biblioteką języka C, która implementuje silnik baz danych
134 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
135 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
136 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
137 danych bez konieczności utrzymywania osobnego serwera baz danych.
138 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
139 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
140 bazodanowych przy większości operacji na bazie danych. Dodatkowo
141 oprócz biblioteki języka C, dostarczany jest program do zarządzania
144 Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów
145 używających biblioteki SQLite.
148 Summary: Static libraries for SQLite development
149 Summary(pl.UTF-8): Statyczne biblioteki SQLite
150 Group: Development/Libraries
151 Requires: %{name}-devel = %{version}-%{release}
152 %if %{with unclock_notify}
153 Provides: %{name}-static(unlock_notify)
155 %if %{with load_extension}
156 Provides: %{name}-static(load_extension)
160 SQLite is a C library that implements an SQL database engine. A large
161 subset of SQL92 is supported. A complete database is stored in a
162 single disk file. The API is designed for convenience and ease of use.
163 Applications that link against SQLite can enjoy the power and
164 flexiblity of an SQL database without the administrative hassles of
165 supporting a separate database server. Because it omits the
166 client-server interaction overhead and writes directly to disk, SQLite
167 is also faster than the big database servers for most operations. In
168 addition to the C library, the SQLite distribution includes a
169 command-line tool for interacting with SQLite databases and SQLite
172 This package contains the static SQLite libraries.
174 %description static -l pl.UTF-8
175 SQLite jest biblioteką języka C, która implementuje silnik baz danych
176 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
177 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
178 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
179 danych bez konieczności utrzymywania osobnego serwera baz danych.
180 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
181 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
182 bazodanowych przy większości operacji na bazie danych. Dodatkowo
183 oprócz biblioteki języka C, dostarczany jest program do zarządzania
186 Pakiet zawiera statyczne biblioteki SQLite.
188 %package -n tcl-%{name}
189 Summary: sqlite3 tcl extension
190 Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl
191 Group: Development/Languages/Tcl
193 %description -n tcl-%{name}
194 sqlite3 tcl extension.
196 %description -n tcl-%{name} -l pl.UTF-8
197 Rozszerzenie sqlite3 dla Tcl.
200 %setup -q -n sqlite-src-%{vnum}
202 %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in
204 if [ "$(cat VERSION)" != "%{version}" ]; then
205 echo "Tarball content doesn't match version %{version}." >&2
212 %{__autoconf} --force
214 CPPFLAGS="$CPPFLAGS $*"
219 export CPPFLAGS="%{rpmcflags}"
222 export TCLLIBDIR="%{tcl_sitearch}/sqlite3"
225 append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE
227 # Support for optional ORDER BY and LIMIT clause on UPDATE and DELETE statements
228 append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
230 # Support column metadata functions.
231 # http://sqlite.org/c3ref/column_database_name.html
232 # http://sqlite.org/c3ref/table_column_metadata.html
233 append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
235 # Support Full-Text Search versions 3 and 4.
236 # http://sqlite.org/fts3.html
237 #append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61
238 append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
239 append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER
242 # http://sqlite.org/rtree.html
243 append-cppflags -DSQLITE_ENABLE_RTREE
245 # Support Geopoly module (new as of 3.25.0)
246 # https://www.sqlite.org/geopoly.html
247 append-cppflags -DSQLITE_ENABLE_GEOPOLY
249 # Support soundex() function.
250 # http://sqlite.org/lang_corefunc.html#soundex
251 #append-cppflags -DSQLITE_SOUNDEX
253 # Support dbstat virtual table.
254 # https://www.sqlite.org/dbstat.html
255 append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
257 # Support for session extension (record changes to a changeset).
258 # https://www.sqlite.org/sessionintro.html
259 append-cppflags -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK
261 %if %{with unlock_notify}
262 # Support unlock notification.
263 # http://sqlite.org/unlock_notify.html
264 append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
268 append-cppflags -DSQLITE_ENABLE_ICU
269 append-libs "-licui18n -licuuc"
272 %if %{with load_extension}
277 %{?with_readline:--disable-editline} \
278 %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \
279 %{__enable_disable load_extension load-extension} \
280 %{__enable_disable json1} \
281 --enable-threadsafe \
290 %{?with_tests:LC_ALL=C %{__make} test}
293 rm -rf $RPM_BUILD_ROOT
294 install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1}
297 DESTDIR=$RPM_BUILD_ROOT
299 %{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
300 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so
301 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \
302 $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so
304 cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1
307 rm -rf $RPM_BUILD_ROOT
309 %post libs -p /sbin/ldconfig
310 %postun libs -p /sbin/ldconfig
313 %defattr(644,root,root,755)
314 %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.*
315 %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0
318 %defattr(644,root,root,755)
320 %attr(755,root,root) %{_bindir}/sqlite3
321 %{_mandir}/man1/sqlite3.1*
324 %defattr(644,root,root,755)
325 %attr(755,root,root) %{_libdir}/libsqlite3.so
326 %{_libdir}/libsqlite3.la
327 %{_includedir}/sqlite3.h
328 %{_includedir}/sqlite3ext.h
329 %{_pkgconfigdir}/sqlite3.pc
332 %defattr(644,root,root,755)
333 %{_libdir}/libsqlite3.a
336 %files -n tcl-%{name}
337 %defattr(644,root,root,755)
338 %dir %{_libdir}/tcl*/sqlite3
339 %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so
340 %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl