]>
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 |
f38b1e08 | 14 | %bcond_without json1 # json1 extension |
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) |
e5c81f27 | 28 | %define vnum 3350500 |
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} |
e7803f5c | 36 | Release: 1 |
dd55e3fd | 37 | License: Public Domain |
17b8c9f1 | 38 | Group: Libraries |
65cfa56f | 39 | # Source0Download: http://www.sqlite.org/download.html |
23fb7c7f | 40 | Source0: https://www.sqlite.org/2021/sqlite-src-%{vnum}.zip |
e5c81f27 | 41 | # Source0-md5: da016edc2bf53fba31e346b8ea81de42 |
2652c235 | 42 | URL: https://www.sqlite.org/ |
dd55e3fd | 43 | BuildRequires: autoconf >= 2.50 |
17b8c9f1 | 44 | BuildRequires: automake |
0d754db8 | 45 | %{!?with_readline:BuildRequires: libedit-devel} |
17b8c9f1 | 46 | BuildRequires: libtool |
0d754db8 | 47 | %{?with_readline:BuildRequires: readline-devel} |
9e8479e5 | 48 | BuildRequires: rpmbuild(macros) >= 1.527 |
6ca4ac16 | 49 | %{?with_load_extension:BuildRequires: sed >= 4.0} |
0e44e992 | 50 | BuildRequires: tcl |
a8925d97 | 51 | %{?with_tcl:BuildRequires: tcl-devel >= %{tclver}} |
086e11d9 | 52 | BuildRequires: unzip |
a1eaf1bc | 53 | Requires: %{name}-libs = %{version}-%{release} |
3b448fcb JB |
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}} | |
17b8c9f1 | 57 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
58 | ||
9ff1c54d ER |
59 | %define _ulibdir /usr/lib |
60 | ||
17b8c9f1 | 61 | %description |
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 | |
72 | bindings for Tcl/Tk. | |
73 | ||
b7c0e1f2 JR |
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 | |
17b8c9f1 | 84 | bazami danych. |
85 | ||
a1eaf1bc ER |
86 | %package libs |
87 | Summary: Shared library for the sqlite3 embeddable SQL database engine | |
3b448fcb | 88 | Summary(pl.UTF-8): Biblioteka współdzielona osadzalnego silnika baz danych SQL sqlite3 |
a1eaf1bc | 89 | Group: Libraries |
3b448fcb JB |
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 | |
a1eaf1bc ER |
94 | |
95 | %description libs | |
3b448fcb JB |
96 | This package contains the SQLite 3 shared library. |
97 | ||
98 | %description libs -l pl.UTF-8 | |
99 | Ten pakiet zawiera bibliotekę współdzieloną SQLite 3. | |
a1eaf1bc | 100 | |
17b8c9f1 | 101 | %package devel |
102 | Summary: Header files for SQLite development | |
e882a99f | 103 | Summary(pl.UTF-8): Pliki nagłówkowe SQLite |
17b8c9f1 | 104 | Group: Development/Libraries |
a1eaf1bc | 105 | Requires: %{name}-libs = %{version}-%{release} |
d70f95dc | 106 | %if %{with unlock_notify} |
3b448fcb | 107 | Provides: %{name}-devel(unlock_notify) = %{version} |
d70f95dc | 108 | %endif |
109 | %if %{with load_extension} | |
3b448fcb | 110 | Provides: %{name}-devel(load_extension) = %{version} |
d70f95dc | 111 | %endif |
e0fdf246 | 112 | %if %{with icu} |
3b448fcb | 113 | Provides: %{name}-devel(icu) = %{version} |
e0fdf246 | 114 | %endif |
17b8c9f1 | 115 | |
116 | %description devel | |
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 | |
127 | bindings for Tcl/Tk. | |
128 | ||
129 | This package contains the header files needed to develop programs that | |
130 | use these SQLite. | |
131 | ||
b7c0e1f2 JR |
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 | |
17b8c9f1 | 142 | bazami danych. |
143 | ||
b7c0e1f2 JR |
144 | Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów |
145 | używających biblioteki SQLite. | |
17b8c9f1 | 146 | |
147 | %package static | |
148 | Summary: Static libraries for SQLite development | |
e882a99f | 149 | Summary(pl.UTF-8): Statyczne biblioteki SQLite |
17b8c9f1 | 150 | Group: Development/Libraries |
151 | Requires: %{name}-devel = %{version}-%{release} | |
d70f95dc | 152 | %if %{with unclock_notify} |
d70f95dc | 153 | Provides: %{name}-static(unlock_notify) |
154 | %endif | |
155 | %if %{with load_extension} | |
d70f95dc | 156 | Provides: %{name}-static(load_extension) |
157 | %endif | |
17b8c9f1 | 158 | |
159 | %description static | |
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 | |
170 | bindings for Tcl/Tk. | |
171 | ||
172 | This package contains the static SQLite libraries. | |
173 | ||
b7c0e1f2 JR |
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 | |
17b8c9f1 | 184 | bazami danych. |
185 | ||
186 | Pakiet zawiera statyczne biblioteki SQLite. | |
187 | ||
c743401f | 188 | %package -n tcl-%{name} |
8e66772b | 189 | Summary: sqlite3 tcl extension |
e882a99f | 190 | Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl |
8e66772b | 191 | Group: Development/Languages/Tcl |
c743401f AM |
192 | |
193 | %description -n tcl-%{name} | |
194 | sqlite3 tcl extension. | |
195 | ||
b7c0e1f2 | 196 | %description -n tcl-%{name} -l pl.UTF-8 |
c743401f AM |
197 | Rozszerzenie sqlite3 dla Tcl. |
198 | ||
17b8c9f1 | 199 | %prep |
65430f84 | 200 | %setup -q -n sqlite-src-%{vnum} |
1cd2f537 | 201 | |
fc29cfbe | 202 | %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in |
faed6cf7 | 203 | |
9a9b0472 | 204 | if [ "$(cat VERSION)" != "%{version}" ]; then |
78ed83ff AM |
205 | echo "Tarball content doesn't match version %{version}." >&2 |
206 | exit 1 | |
207 | fi | |
208 | ||
17b8c9f1 | 209 | %build |
210 | %{__libtoolize} | |
17b8c9f1 | 211 | %{__aclocal} |
16787c3a | 212 | %{__autoconf} --force |
fc29cfbe ER |
213 | append-cppflags() { |
214 | CPPFLAGS="$CPPFLAGS $*" | |
215 | } | |
216 | append-libs() { | |
217 | LIBS="$LIBS $*" | |
218 | } | |
219 | export CPPFLAGS="%{rpmcflags}" | |
220 | export LIBS | |
87af9815 MB |
221 | %if %{with tcl} |
222 | export TCLLIBDIR="%{tcl_sitearch}/sqlite3" | |
223 | %endif | |
e0fdf246 | 224 | |
fc29cfbe ER |
225 | append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE |
226 | ||
7342856f AG |
227 | # Support for optional ORDER BY and LIMIT clause on UPDATE and DELETE statements |
228 | append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT | |
229 | ||
fc29cfbe ER |
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 | |
234 | ||
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 | |
2cf6a747 | 238 | append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS |
61a0da0a | 239 | append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER |
fc29cfbe ER |
240 | |
241 | # Support R*Trees. | |
242 | # http://sqlite.org/rtree.html | |
243 | append-cppflags -DSQLITE_ENABLE_RTREE | |
244 | ||
7342856f AG |
245 | # Support Geopoly module (new as of 3.25.0) |
246 | # https://www.sqlite.org/geopoly.html | |
247 | append-cppflags -DSQLITE_ENABLE_GEOPOLY | |
248 | ||
fc29cfbe ER |
249 | # Support soundex() function. |
250 | # http://sqlite.org/lang_corefunc.html#soundex | |
251 | #append-cppflags -DSQLITE_SOUNDEX | |
252 | ||
806c4314 JR |
253 | # Support dbstat virtual table. |
254 | # https://www.sqlite.org/dbstat.html | |
255 | append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB | |
256 | ||
7342856f AG |
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 | |
260 | ||
fc29cfbe ER |
261 | %if %{with unlock_notify} |
262 | # Support unlock notification. | |
263 | # http://sqlite.org/unlock_notify.html | |
264 | append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY | |
265 | %endif | |
266 | ||
267 | %if %{with icu} | |
268 | append-cppflags -DSQLITE_ENABLE_ICU | |
269 | append-libs "-licui18n -licuuc" | |
270 | %endif | |
271 | ||
272 | %if %{with load_extension} | |
273 | append-libs "-ldl" | |
274 | %endif | |
275 | ||
17b8c9f1 | 276 | %configure \ |
0d754db8 | 277 | %{?with_readline:--disable-editline} \ |
e0fdf246 | 278 | %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \ |
60f66380 | 279 | %{__enable_disable load_extension load-extension} \ |
f38b1e08 | 280 | %{__enable_disable json1} \ |
4522125d MB |
281 | --enable-threadsafe \ |
282 | --enable-fts5 | |
60f66380 | 283 | |
5df4522e | 284 | %{__make} |
1a6aae8d | 285 | |
e16bc4b1 | 286 | %if %{with doc} |
17b8c9f1 | 287 | %{__make} doc |
1a6aae8d | 288 | %endif |
17b8c9f1 | 289 | |
3e5df83c | 290 | %{?with_tests:LC_ALL=C %{__make} test} |
17b8c9f1 | 291 | |
292 | %install | |
293 | rm -rf $RPM_BUILD_ROOT | |
1c91d9d5 | 294 | install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1} |
0d754db8 | 295 | |
17b8c9f1 | 296 | %{__make} install \ |
dd55e3fd | 297 | DESTDIR=$RPM_BUILD_ROOT |
ec30f86a | 298 | |
0d754db8 | 299 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib} |
dd55e3fd | 300 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so |
1c91d9d5 JR |
301 | ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \ |
302 | $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so | |
303 | ||
e0fdf246 | 304 | cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
17b8c9f1 | 305 | |
306 | %clean | |
307 | rm -rf $RPM_BUILD_ROOT | |
308 | ||
a1eaf1bc ER |
309 | %post libs -p /sbin/ldconfig |
310 | %postun libs -p /sbin/ldconfig | |
311 | ||
312 | %files libs | |
313 | %defattr(644,root,root,755) | |
314 | %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.* | |
315 | %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0 | |
17b8c9f1 | 316 | |
317 | %files | |
318 | %defattr(644,root,root,755) | |
a8925d97 | 319 | %doc README.md |
17b8c9f1 | 320 | %attr(755,root,root) %{_bindir}/sqlite3 |
c743401f | 321 | %{_mandir}/man1/sqlite3.1* |
17b8c9f1 | 322 | |
323 | %files devel | |
324 | %defattr(644,root,root,755) | |
7e92c022 JB |
325 | %attr(755,root,root) %{_libdir}/libsqlite3.so |
326 | %{_libdir}/libsqlite3.la | |
17b8c9f1 | 327 | %{_includedir}/sqlite3.h |
ef88c71c | 328 | %{_includedir}/sqlite3ext.h |
7e92c022 | 329 | %{_pkgconfigdir}/sqlite3.pc |
17b8c9f1 | 330 | |
331 | %files static | |
332 | %defattr(644,root,root,755) | |
7e92c022 | 333 | %{_libdir}/libsqlite3.a |
c743401f | 334 | |
1a6aae8d | 335 | %if %{with tcl} |
c743401f AM |
336 | %files -n tcl-%{name} |
337 | %defattr(644,root,root,755) | |
80deaf18 | 338 | %dir %{_libdir}/tcl*/sqlite3 |
7e92c022 JB |
339 | %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so |
340 | %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl | |
1a6aae8d | 341 | %endif |