]>
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 | |
f1015391 JR |
16 | %ifarch alpha sparc %{x8664} |
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) |
915c83a8 | 28 | %define vnum 3250300 |
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 | |
a8925d97 | 31 | %define tclver 8.6 |
943b1d56 ER |
32 | Summary: SQLite3 library |
33 | Summary(pl.UTF-8): Biblioteka SQLite3 | |
22ef5ab8 | 34 | Name: sqlite3 |
ca3d7890 | 35 | Version: %{ver} |
17f8454c | 36 | Release: 2 |
dd55e3fd | 37 | License: Public Domain |
17b8c9f1 | 38 | Group: Libraries |
65cfa56f | 39 | # Source0Download: http://www.sqlite.org/download.html |
5e9394cf | 40 | Source0: http://www.sqlite.org/2018/sqlite-src-%{vnum}.zip |
915c83a8 | 41 | # Source0-md5: d0fbd4d8a8b99a8b6aa9405dace570c0 |
a3d8a32d | 42 | Patch0: %{name}-sign-function.patch |
298b71bf | 43 | # https://github.com/CanonicalLtd/dqlite/issues/91 |
17f8454c AM |
44 | Patch1: https://github.com/CanonicalLtd/sqlite/releases/download/version-%{ver}%%2Breplication3/sqlite-%{ver}.diff |
45 | # Patch1-md5: a865f0b6a7b72be0b48c3a6ddf4fd4a5 | |
65cfa56f | 46 | URL: http://www.sqlite.org/ |
dd55e3fd | 47 | BuildRequires: autoconf >= 2.50 |
17b8c9f1 | 48 | BuildRequires: automake |
0d754db8 | 49 | %{!?with_readline:BuildRequires: libedit-devel} |
17b8c9f1 | 50 | BuildRequires: libtool |
0d754db8 | 51 | %{?with_readline:BuildRequires: readline-devel} |
6ca4ac16 | 52 | %{?with_load_extension:BuildRequires: sed >= 4.0} |
0e44e992 | 53 | BuildRequires: tcl |
a8925d97 | 54 | %{?with_tcl:BuildRequires: tcl-devel >= %{tclver}} |
086e11d9 | 55 | BuildRequires: unzip |
a1eaf1bc | 56 | Requires: %{name}-libs = %{version}-%{release} |
3b448fcb JB |
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}} | |
17f8454c | 60 | %{?with_wal_replication:Provides: %{name}(wal_replication) = %{version}} |
17b8c9f1 | 61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
62 | ||
9ff1c54d ER |
63 | %define _ulibdir /usr/lib |
64 | ||
17b8c9f1 | 65 | %description |
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 | |
76 | bindings for Tcl/Tk. | |
77 | ||
b7c0e1f2 JR |
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 | |
17b8c9f1 | 88 | bazami danych. |
89 | ||
a1eaf1bc ER |
90 | %package libs |
91 | Summary: Shared library for the sqlite3 embeddable SQL database engine | |
3b448fcb | 92 | Summary(pl.UTF-8): Biblioteka współdzielona osadzalnego silnika baz danych SQL sqlite3 |
a1eaf1bc | 93 | Group: Libraries |
3b448fcb JB |
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}} | |
17f8454c | 97 | %{?with_wal_replication:Provides: %{name}-libs(wal_replication) = %{version}} |
3b448fcb | 98 | Conflicts: sqlite3 < 3.23.1-2 |
a1eaf1bc ER |
99 | |
100 | %description libs | |
3b448fcb JB |
101 | This package contains the SQLite 3 shared library. |
102 | ||
103 | %description libs -l pl.UTF-8 | |
104 | Ten pakiet zawiera bibliotekę współdzieloną SQLite 3. | |
a1eaf1bc | 105 | |
17b8c9f1 | 106 | %package devel |
107 | Summary: Header files for SQLite development | |
e882a99f | 108 | Summary(pl.UTF-8): Pliki nagłówkowe SQLite |
17b8c9f1 | 109 | Group: Development/Libraries |
a1eaf1bc | 110 | Requires: %{name}-libs = %{version}-%{release} |
d70f95dc | 111 | %if %{with unlock_notify} |
3b448fcb | 112 | Provides: %{name}-devel(unlock_notify) = %{version} |
d70f95dc | 113 | %endif |
114 | %if %{with load_extension} | |
3b448fcb | 115 | Provides: %{name}-devel(load_extension) = %{version} |
d70f95dc | 116 | %endif |
e0fdf246 | 117 | %if %{with icu} |
3b448fcb | 118 | Provides: %{name}-devel(icu) = %{version} |
e0fdf246 | 119 | %endif |
17f8454c | 120 | %{?with_wal_replication:Provides: %{name}-devel(wal_replication) = %{version}} |
17b8c9f1 | 121 | |
122 | %description devel | |
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 | |
133 | bindings for Tcl/Tk. | |
134 | ||
135 | This package contains the header files needed to develop programs that | |
136 | use these SQLite. | |
137 | ||
b7c0e1f2 JR |
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 | |
17b8c9f1 | 148 | bazami danych. |
149 | ||
b7c0e1f2 JR |
150 | Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów |
151 | używających biblioteki SQLite. | |
17b8c9f1 | 152 | |
153 | %package static | |
154 | Summary: Static libraries for SQLite development | |
e882a99f | 155 | Summary(pl.UTF-8): Statyczne biblioteki SQLite |
17b8c9f1 | 156 | Group: Development/Libraries |
157 | Requires: %{name}-devel = %{version}-%{release} | |
d70f95dc | 158 | %if %{with unclock_notify} |
d70f95dc | 159 | Provides: %{name}-static(unlock_notify) |
160 | %endif | |
161 | %if %{with load_extension} | |
d70f95dc | 162 | Provides: %{name}-static(load_extension) |
163 | %endif | |
17f8454c | 164 | %{?with_wal_replication:Provides: %{name}-static(wal_replication)} |
17b8c9f1 | 165 | |
166 | %description static | |
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 | |
177 | bindings for Tcl/Tk. | |
178 | ||
179 | This package contains the static SQLite libraries. | |
180 | ||
b7c0e1f2 JR |
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 | |
17b8c9f1 | 191 | bazami danych. |
192 | ||
193 | Pakiet zawiera statyczne biblioteki SQLite. | |
194 | ||
c743401f | 195 | %package -n tcl-%{name} |
8e66772b | 196 | Summary: sqlite3 tcl extension |
e882a99f | 197 | Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl |
8e66772b | 198 | Group: Development/Languages/Tcl |
c743401f AM |
199 | |
200 | %description -n tcl-%{name} | |
201 | sqlite3 tcl extension. | |
202 | ||
b7c0e1f2 | 203 | %description -n tcl-%{name} -l pl.UTF-8 |
c743401f AM |
204 | Rozszerzenie sqlite3 dla Tcl. |
205 | ||
17b8c9f1 | 206 | %prep |
65430f84 | 207 | %setup -q -n sqlite-src-%{vnum} |
30682d5a | 208 | %patch0 -p1 |
17f8454c | 209 | %{?with_wal_replication:%patch1 -p1} |
1cd2f537 | 210 | |
fc29cfbe | 211 | %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in |
faed6cf7 | 212 | |
9a9b0472 | 213 | if [ "$(cat VERSION)" != "%{version}" ]; then |
78ed83ff AM |
214 | echo "Tarball content doesn't match version %{version}." >&2 |
215 | exit 1 | |
216 | fi | |
217 | ||
17b8c9f1 | 218 | %build |
219 | %{__libtoolize} | |
220 | cp -f /usr/share/automake/config.sub . | |
221 | %{__aclocal} | |
16787c3a | 222 | %{__autoconf} --force |
fc29cfbe ER |
223 | append-cppflags() { |
224 | CPPFLAGS="$CPPFLAGS $*" | |
225 | } | |
226 | append-libs() { | |
227 | LIBS="$LIBS $*" | |
228 | } | |
229 | export CPPFLAGS="%{rpmcflags}" | |
230 | export LIBS | |
87af9815 MB |
231 | %if %{with tcl} |
232 | export TCLLIBDIR="%{tcl_sitearch}/sqlite3" | |
233 | %endif | |
e0fdf246 | 234 | |
fc29cfbe ER |
235 | append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE |
236 | ||
7342856f AG |
237 | # Support for optional ORDER BY and LIMIT clause on UPDATE and DELETE statements |
238 | append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT | |
239 | ||
fc29cfbe ER |
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 | |
244 | ||
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 | |
2cf6a747 | 248 | append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS |
61a0da0a | 249 | append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER |
fc29cfbe ER |
250 | |
251 | # Support R*Trees. | |
252 | # http://sqlite.org/rtree.html | |
253 | append-cppflags -DSQLITE_ENABLE_RTREE | |
254 | ||
7342856f AG |
255 | # Support Geopoly module (new as of 3.25.0) |
256 | # https://www.sqlite.org/geopoly.html | |
257 | append-cppflags -DSQLITE_ENABLE_GEOPOLY | |
258 | ||
fc29cfbe ER |
259 | # Support soundex() function. |
260 | # http://sqlite.org/lang_corefunc.html#soundex | |
261 | #append-cppflags -DSQLITE_SOUNDEX | |
262 | ||
806c4314 JR |
263 | # Support dbstat virtual table. |
264 | # https://www.sqlite.org/dbstat.html | |
265 | append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB | |
266 | ||
7342856f AG |
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 | |
270 | ||
fc29cfbe ER |
271 | %if %{with unlock_notify} |
272 | # Support unlock notification. | |
273 | # http://sqlite.org/unlock_notify.html | |
274 | append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY | |
275 | %endif | |
276 | ||
277 | %if %{with icu} | |
278 | append-cppflags -DSQLITE_ENABLE_ICU | |
279 | append-libs "-licui18n -licuuc" | |
280 | %endif | |
281 | ||
282 | %if %{with load_extension} | |
283 | append-libs "-ldl" | |
284 | %endif | |
285 | ||
17f8454c AM |
286 | %if %{with wal_replication} |
287 | # A patched version of SQLite with support for WAL-based replication | |
288 | append-cppflags -DSQLITE_ENABLE_WAL_REPLICATION | |
289 | %endif | |
290 | ||
17b8c9f1 | 291 | %configure \ |
0d754db8 | 292 | %{?with_readline:--disable-editline} \ |
e0fdf246 | 293 | %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \ |
60f66380 | 294 | %{__enable_disable load_extension load-extension} \ |
4522125d MB |
295 | --enable-threadsafe \ |
296 | --enable-fts5 | |
60f66380 | 297 | |
5df4522e | 298 | %{__make} |
1a6aae8d | 299 | |
e16bc4b1 | 300 | %if %{with doc} |
17b8c9f1 | 301 | %{__make} doc |
1a6aae8d | 302 | %endif |
17b8c9f1 | 303 | |
3e5df83c | 304 | %{?with_tests:LC_ALL=C %{__make} test} |
17b8c9f1 | 305 | |
306 | %install | |
307 | rm -rf $RPM_BUILD_ROOT | |
1c91d9d5 | 308 | install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1} |
0d754db8 | 309 | |
17b8c9f1 | 310 | %{__make} install \ |
dd55e3fd | 311 | DESTDIR=$RPM_BUILD_ROOT |
ec30f86a | 312 | |
0d754db8 | 313 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib} |
dd55e3fd | 314 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so |
1c91d9d5 JR |
315 | ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \ |
316 | $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so | |
317 | ||
e0fdf246 | 318 | cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
17b8c9f1 | 319 | |
320 | %clean | |
321 | rm -rf $RPM_BUILD_ROOT | |
322 | ||
a1eaf1bc ER |
323 | %post libs -p /sbin/ldconfig |
324 | %postun libs -p /sbin/ldconfig | |
325 | ||
326 | %files libs | |
327 | %defattr(644,root,root,755) | |
328 | %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.* | |
329 | %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0 | |
17b8c9f1 | 330 | |
331 | %files | |
332 | %defattr(644,root,root,755) | |
a8925d97 | 333 | %doc README.md |
17b8c9f1 | 334 | %attr(755,root,root) %{_bindir}/sqlite3 |
c743401f | 335 | %{_mandir}/man1/sqlite3.1* |
17b8c9f1 | 336 | |
337 | %files devel | |
338 | %defattr(644,root,root,755) | |
7e92c022 JB |
339 | %attr(755,root,root) %{_libdir}/libsqlite3.so |
340 | %{_libdir}/libsqlite3.la | |
17b8c9f1 | 341 | %{_includedir}/sqlite3.h |
ef88c71c | 342 | %{_includedir}/sqlite3ext.h |
7e92c022 | 343 | %{_pkgconfigdir}/sqlite3.pc |
17b8c9f1 | 344 | |
345 | %files static | |
346 | %defattr(644,root,root,755) | |
7e92c022 | 347 | %{_libdir}/libsqlite3.a |
c743401f | 348 | |
1a6aae8d | 349 | %if %{with tcl} |
c743401f AM |
350 | %files -n tcl-%{name} |
351 | %defattr(644,root,root,755) | |
80deaf18 | 352 | %dir %{_libdir}/tcl*/sqlite3 |
7e92c022 JB |
353 | %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so |
354 | %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl | |
1a6aae8d | 355 | %endif |