]>
Commit | Line | Data |
---|---|---|
c743401f | 1 | # TODO: |
f1015391 JR |
2 | # - some tests fail with tcl8.5, it's tcl fault, |
3 | # if someone REALLY cares (s)he can look into it | |
a1eaf1bc | 4 | # - sqlite binary is linked statically with sqlite library |
17b8c9f1 | 5 | # |
6 | # Conditional build: | |
d12e8042 | 7 | %bcond_with tests # run tests |
0d754db8 | 8 | %bcond_with readline # readline (GPL) instead of libedit |
dd55e3fd | 9 | %bcond_without tcl # Tcl extension |
d12e8042 JB |
10 | %bcond_without doc # disable documentation building |
11 | %bcond_without unlock_notify # disable unlock notify API | |
60f66380 | 12 | %bcond_without load_extension # enable load extension API |
cd683928 | 13 | %bcond_with icu # ICU tokenizer support |
17f8454c | 14 | %bcond_without wal_replication # WAL replication support |
5df4522e | 15 | |
017ee24e | 16 | %ifarch %{x8664} |
f1015391 JR |
17 | %undefine with_tests |
18 | %endif | |
19 | ||
20 | # disabling tcl currently breaks making test target, | |
21 | # some hack in Makefile needs to be done | |
5df4522e | 22 | %if %{without tcl} |
f1015391 JR |
23 | %undefine with_tests |
24 | %endif | |
25 | ||
bd752bde | 26 | # sqlite3 version with zero padded without any dots (3 08 10 01 is 3.8.10.1) |
ea9e16e8 | 27 | # but trailing 00 means no 4rd part (3 11 01 00 is 3.11.1) |
15c2a20c | 28 | %define vnum 3300000 |
9a9b0472 | 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)} |
2742ec36 | 30 | |
a1370bcb | 31 | # wal replication version |
66b9b603 | 32 | %define walver 3.29.0 |
a1370bcb | 33 | |
a8925d97 | 34 | %define tclver 8.6 |
943b1d56 ER |
35 | Summary: SQLite3 library |
36 | Summary(pl.UTF-8): Biblioteka SQLite3 | |
22ef5ab8 | 37 | Name: sqlite3 |
ca3d7890 | 38 | Version: %{ver} |
15c2a20c | 39 | Release: 1 |
dd55e3fd | 40 | License: Public Domain |
17b8c9f1 | 41 | Group: Libraries |
65cfa56f | 42 | # Source0Download: http://www.sqlite.org/download.html |
2652c235 | 43 | Source0: https://www.sqlite.org/2019/sqlite-src-%{vnum}.zip |
15c2a20c | 44 | # Source0-md5: d6f8f11b12ea3e1bdf3332bcc0b97117 |
a3d8a32d | 45 | Patch0: %{name}-sign-function.patch |
298b71bf | 46 | # https://github.com/CanonicalLtd/dqlite/issues/91 |
7467d964 | 47 | Patch1: https://github.com/CanonicalLtd/sqlite/releases/download/version-%{walver}+replication3/sqlite-%{walver}.diff |
66b9b603 | 48 | # Patch1-md5: 6707a179ad80076f290a54e424c488c8 |
2652c235 | 49 | URL: https://www.sqlite.org/ |
dd55e3fd | 50 | BuildRequires: autoconf >= 2.50 |
17b8c9f1 | 51 | BuildRequires: automake |
0d754db8 | 52 | %{!?with_readline:BuildRequires: libedit-devel} |
17b8c9f1 | 53 | BuildRequires: libtool |
0d754db8 | 54 | %{?with_readline:BuildRequires: readline-devel} |
6ca4ac16 | 55 | %{?with_load_extension:BuildRequires: sed >= 4.0} |
0e44e992 | 56 | BuildRequires: tcl |
a8925d97 | 57 | %{?with_tcl:BuildRequires: tcl-devel >= %{tclver}} |
086e11d9 | 58 | BuildRequires: unzip |
a1eaf1bc | 59 | Requires: %{name}-libs = %{version}-%{release} |
3b448fcb JB |
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}} | |
17f8454c | 63 | %{?with_wal_replication:Provides: %{name}(wal_replication) = %{version}} |
17b8c9f1 | 64 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
65 | ||
9ff1c54d ER |
66 | %define _ulibdir /usr/lib |
67 | ||
17b8c9f1 | 68 | %description |
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 | |
79 | bindings for Tcl/Tk. | |
80 | ||
b7c0e1f2 JR |
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 | |
17b8c9f1 | 91 | bazami danych. |
92 | ||
a1eaf1bc ER |
93 | %package libs |
94 | Summary: Shared library for the sqlite3 embeddable SQL database engine | |
3b448fcb | 95 | Summary(pl.UTF-8): Biblioteka współdzielona osadzalnego silnika baz danych SQL sqlite3 |
a1eaf1bc | 96 | Group: Libraries |
3b448fcb JB |
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}} | |
17f8454c | 100 | %{?with_wal_replication:Provides: %{name}-libs(wal_replication) = %{version}} |
3b448fcb | 101 | Conflicts: sqlite3 < 3.23.1-2 |
a1eaf1bc ER |
102 | |
103 | %description libs | |
3b448fcb JB |
104 | This package contains the SQLite 3 shared library. |
105 | ||
106 | %description libs -l pl.UTF-8 | |
107 | Ten pakiet zawiera bibliotekę współdzieloną SQLite 3. | |
a1eaf1bc | 108 | |
17b8c9f1 | 109 | %package devel |
110 | Summary: Header files for SQLite development | |
e882a99f | 111 | Summary(pl.UTF-8): Pliki nagłówkowe SQLite |
17b8c9f1 | 112 | Group: Development/Libraries |
a1eaf1bc | 113 | Requires: %{name}-libs = %{version}-%{release} |
d70f95dc | 114 | %if %{with unlock_notify} |
3b448fcb | 115 | Provides: %{name}-devel(unlock_notify) = %{version} |
d70f95dc | 116 | %endif |
117 | %if %{with load_extension} | |
3b448fcb | 118 | Provides: %{name}-devel(load_extension) = %{version} |
d70f95dc | 119 | %endif |
e0fdf246 | 120 | %if %{with icu} |
3b448fcb | 121 | Provides: %{name}-devel(icu) = %{version} |
e0fdf246 | 122 | %endif |
17f8454c | 123 | %{?with_wal_replication:Provides: %{name}-devel(wal_replication) = %{version}} |
17b8c9f1 | 124 | |
125 | %description devel | |
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 | |
136 | bindings for Tcl/Tk. | |
137 | ||
138 | This package contains the header files needed to develop programs that | |
139 | use these SQLite. | |
140 | ||
b7c0e1f2 JR |
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 | |
17b8c9f1 | 151 | bazami danych. |
152 | ||
b7c0e1f2 JR |
153 | Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów |
154 | używających biblioteki SQLite. | |
17b8c9f1 | 155 | |
156 | %package static | |
157 | Summary: Static libraries for SQLite development | |
e882a99f | 158 | Summary(pl.UTF-8): Statyczne biblioteki SQLite |
17b8c9f1 | 159 | Group: Development/Libraries |
160 | Requires: %{name}-devel = %{version}-%{release} | |
d70f95dc | 161 | %if %{with unclock_notify} |
d70f95dc | 162 | Provides: %{name}-static(unlock_notify) |
163 | %endif | |
164 | %if %{with load_extension} | |
d70f95dc | 165 | Provides: %{name}-static(load_extension) |
166 | %endif | |
17f8454c | 167 | %{?with_wal_replication:Provides: %{name}-static(wal_replication)} |
17b8c9f1 | 168 | |
169 | %description static | |
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 | |
180 | bindings for Tcl/Tk. | |
181 | ||
182 | This package contains the static SQLite libraries. | |
183 | ||
b7c0e1f2 JR |
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 | |
17b8c9f1 | 194 | bazami danych. |
195 | ||
196 | Pakiet zawiera statyczne biblioteki SQLite. | |
197 | ||
c743401f | 198 | %package -n tcl-%{name} |
8e66772b | 199 | Summary: sqlite3 tcl extension |
e882a99f | 200 | Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl |
8e66772b | 201 | Group: Development/Languages/Tcl |
c743401f AM |
202 | |
203 | %description -n tcl-%{name} | |
204 | sqlite3 tcl extension. | |
205 | ||
b7c0e1f2 | 206 | %description -n tcl-%{name} -l pl.UTF-8 |
c743401f AM |
207 | Rozszerzenie sqlite3 dla Tcl. |
208 | ||
17b8c9f1 | 209 | %prep |
65430f84 | 210 | %setup -q -n sqlite-src-%{vnum} |
30682d5a | 211 | %patch0 -p1 |
17f8454c | 212 | %{?with_wal_replication:%patch1 -p1} |
1cd2f537 | 213 | |
fc29cfbe | 214 | %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in |
faed6cf7 | 215 | |
9a9b0472 | 216 | if [ "$(cat VERSION)" != "%{version}" ]; then |
78ed83ff AM |
217 | echo "Tarball content doesn't match version %{version}." >&2 |
218 | exit 1 | |
219 | fi | |
220 | ||
17b8c9f1 | 221 | %build |
222 | %{__libtoolize} | |
223 | cp -f /usr/share/automake/config.sub . | |
224 | %{__aclocal} | |
16787c3a | 225 | %{__autoconf} --force |
fc29cfbe ER |
226 | append-cppflags() { |
227 | CPPFLAGS="$CPPFLAGS $*" | |
228 | } | |
229 | append-libs() { | |
230 | LIBS="$LIBS $*" | |
231 | } | |
232 | export CPPFLAGS="%{rpmcflags}" | |
233 | export LIBS | |
87af9815 MB |
234 | %if %{with tcl} |
235 | export TCLLIBDIR="%{tcl_sitearch}/sqlite3" | |
236 | %endif | |
e0fdf246 | 237 | |
fc29cfbe ER |
238 | append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE |
239 | ||
7342856f AG |
240 | # Support for optional ORDER BY and LIMIT clause on UPDATE and DELETE statements |
241 | append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT | |
242 | ||
fc29cfbe ER |
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 | |
247 | ||
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 | |
2cf6a747 | 251 | append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS |
61a0da0a | 252 | append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER |
fc29cfbe ER |
253 | |
254 | # Support R*Trees. | |
255 | # http://sqlite.org/rtree.html | |
256 | append-cppflags -DSQLITE_ENABLE_RTREE | |
257 | ||
7342856f AG |
258 | # Support Geopoly module (new as of 3.25.0) |
259 | # https://www.sqlite.org/geopoly.html | |
260 | append-cppflags -DSQLITE_ENABLE_GEOPOLY | |
261 | ||
fc29cfbe ER |
262 | # Support soundex() function. |
263 | # http://sqlite.org/lang_corefunc.html#soundex | |
264 | #append-cppflags -DSQLITE_SOUNDEX | |
265 | ||
806c4314 JR |
266 | # Support dbstat virtual table. |
267 | # https://www.sqlite.org/dbstat.html | |
268 | append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB | |
269 | ||
7342856f AG |
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 | |
273 | ||
fc29cfbe ER |
274 | %if %{with unlock_notify} |
275 | # Support unlock notification. | |
276 | # http://sqlite.org/unlock_notify.html | |
277 | append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY | |
278 | %endif | |
279 | ||
280 | %if %{with icu} | |
281 | append-cppflags -DSQLITE_ENABLE_ICU | |
282 | append-libs "-licui18n -licuuc" | |
283 | %endif | |
284 | ||
285 | %if %{with load_extension} | |
286 | append-libs "-ldl" | |
287 | %endif | |
288 | ||
17f8454c AM |
289 | %if %{with wal_replication} |
290 | # A patched version of SQLite with support for WAL-based replication | |
291 | append-cppflags -DSQLITE_ENABLE_WAL_REPLICATION | |
292 | %endif | |
293 | ||
17b8c9f1 | 294 | %configure \ |
0d754db8 | 295 | %{?with_readline:--disable-editline} \ |
e0fdf246 | 296 | %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \ |
60f66380 | 297 | %{__enable_disable load_extension load-extension} \ |
4522125d MB |
298 | --enable-threadsafe \ |
299 | --enable-fts5 | |
60f66380 | 300 | |
5df4522e | 301 | %{__make} |
1a6aae8d | 302 | |
e16bc4b1 | 303 | %if %{with doc} |
17b8c9f1 | 304 | %{__make} doc |
1a6aae8d | 305 | %endif |
17b8c9f1 | 306 | |
3e5df83c | 307 | %{?with_tests:LC_ALL=C %{__make} test} |
17b8c9f1 | 308 | |
309 | %install | |
310 | rm -rf $RPM_BUILD_ROOT | |
1c91d9d5 | 311 | install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1} |
0d754db8 | 312 | |
17b8c9f1 | 313 | %{__make} install \ |
dd55e3fd | 314 | DESTDIR=$RPM_BUILD_ROOT |
ec30f86a | 315 | |
0d754db8 | 316 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib} |
dd55e3fd | 317 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so |
1c91d9d5 JR |
318 | ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \ |
319 | $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so | |
320 | ||
e0fdf246 | 321 | cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
17b8c9f1 | 322 | |
323 | %clean | |
324 | rm -rf $RPM_BUILD_ROOT | |
325 | ||
a1eaf1bc ER |
326 | %post libs -p /sbin/ldconfig |
327 | %postun libs -p /sbin/ldconfig | |
328 | ||
329 | %files libs | |
330 | %defattr(644,root,root,755) | |
331 | %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.* | |
332 | %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0 | |
17b8c9f1 | 333 | |
334 | %files | |
335 | %defattr(644,root,root,755) | |
a8925d97 | 336 | %doc README.md |
17b8c9f1 | 337 | %attr(755,root,root) %{_bindir}/sqlite3 |
c743401f | 338 | %{_mandir}/man1/sqlite3.1* |
17b8c9f1 | 339 | |
340 | %files devel | |
341 | %defattr(644,root,root,755) | |
7e92c022 JB |
342 | %attr(755,root,root) %{_libdir}/libsqlite3.so |
343 | %{_libdir}/libsqlite3.la | |
17b8c9f1 | 344 | %{_includedir}/sqlite3.h |
ef88c71c | 345 | %{_includedir}/sqlite3ext.h |
7e92c022 | 346 | %{_pkgconfigdir}/sqlite3.pc |
17b8c9f1 | 347 | |
348 | %files static | |
349 | %defattr(644,root,root,755) | |
7e92c022 | 350 | %{_libdir}/libsqlite3.a |
c743401f | 351 | |
1a6aae8d | 352 | %if %{with tcl} |
c743401f AM |
353 | %files -n tcl-%{name} |
354 | %defattr(644,root,root,755) | |
80deaf18 | 355 | %dir %{_libdir}/tcl*/sqlite3 |
7e92c022 JB |
356 | %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so |
357 | %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl | |
1a6aae8d | 358 | %endif |