]>
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 |
5df4522e | 14 | |
f1015391 JR |
15 | %ifarch alpha sparc %{x8664} |
16 | %undefine with_tests | |
17 | %endif | |
18 | ||
19 | # disabling tcl currently breaks making test target, | |
20 | # some hack in Makefile needs to be done | |
5df4522e | 21 | %if %{without tcl} |
f1015391 JR |
22 | %undefine with_tests |
23 | %endif | |
24 | ||
bd752bde | 25 | # sqlite3 version with zero padded without any dots (3 08 10 01 is 3.8.10.1) |
ea9e16e8 | 26 | # but trailing 00 means no 4rd part (3 11 01 00 is 3.11.1) |
b5e536b4 | 27 | %define vnum 3240000 |
9a9b0472 | 28 | %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 | 29 | |
a8925d97 | 30 | %define tclver 8.6 |
943b1d56 ER |
31 | Summary: SQLite3 library |
32 | Summary(pl.UTF-8): Biblioteka SQLite3 | |
22ef5ab8 | 33 | Name: sqlite3 |
ca3d7890 | 34 | Version: %{ver} |
98fa2e0c | 35 | Release: 3 |
dd55e3fd | 36 | License: Public Domain |
17b8c9f1 | 37 | Group: Libraries |
65cfa56f | 38 | # Source0Download: http://www.sqlite.org/download.html |
5e9394cf | 39 | Source0: http://www.sqlite.org/2018/sqlite-src-%{vnum}.zip |
b5e536b4 | 40 | # Source0-md5: 36408fba1079b68421f3341f4505a960 |
a3d8a32d | 41 | Patch0: %{name}-sign-function.patch |
65cfa56f | 42 | URL: http://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} |
6ca4ac16 | 48 | %{?with_load_extension:BuildRequires: sed >= 4.0} |
0e44e992 | 49 | BuildRequires: tcl |
a8925d97 | 50 | %{?with_tcl:BuildRequires: tcl-devel >= %{tclver}} |
086e11d9 | 51 | BuildRequires: unzip |
a1eaf1bc | 52 | Requires: %{name}-libs = %{version}-%{release} |
3b448fcb JB |
53 | %{?with_icu:Provides: %{name}(icu) = %{version}} |
54 | %{?with_load_extension:Provides: %{name}(load_extension) = %{version}} | |
55 | %{?with_unlock_notify:Provides: %{name}(unlock_notify) = %{version}} | |
17b8c9f1 | 56 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
57 | ||
9ff1c54d ER |
58 | %define _ulibdir /usr/lib |
59 | ||
17b8c9f1 | 60 | %description |
61 | SQLite is a C library that implements an SQL database engine. A large | |
62 | subset of SQL92 is supported. A complete database is stored in a | |
63 | single disk file. The API is designed for convenience and ease of use. | |
64 | Applications that link against SQLite can enjoy the power and | |
65 | flexiblity of an SQL database without the administrative hassles of | |
66 | supporting a separate database server. Because it omits the | |
67 | client-server interaction overhead and writes directly to disk, SQLite | |
68 | is also faster than the big database servers for most operations. In | |
69 | addition to the C library, the SQLite distribution includes a | |
70 | command-line tool for interacting with SQLite databases and SQLite | |
71 | bindings for Tcl/Tk. | |
72 | ||
b7c0e1f2 JR |
73 | %description -l pl.UTF-8 |
74 | SQLite jest biblioteką języka C, która implementuje silnik baz danych | |
75 | SQL (obsługiwana jest większość standardu SQL92). Cała baza danych | |
76 | przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę | |
77 | bibliotekę charakteryzują się siłą i elastycznością SQLowych baz | |
78 | danych bez konieczności utrzymywania osobnego serwera baz danych. | |
79 | Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane | |
80 | bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów | |
81 | bazodanowych przy większości operacji na bazie danych. Dodatkowo | |
82 | oprócz biblioteki języka C, dostarczany jest program do zarządzania | |
17b8c9f1 | 83 | bazami danych. |
84 | ||
a1eaf1bc ER |
85 | %package libs |
86 | Summary: Shared library for the sqlite3 embeddable SQL database engine | |
3b448fcb | 87 | Summary(pl.UTF-8): Biblioteka współdzielona osadzalnego silnika baz danych SQL sqlite3 |
a1eaf1bc | 88 | Group: Libraries |
3b448fcb JB |
89 | %{?with_icu:Provides: %{name}-libs(icu) = %{version}} |
90 | %{?with_load_extension:Provides: %{name}-libs(load_extension) = %{version}} | |
91 | %{?with_unlock_notify:Provides: %{name}-libs(unlock_notify) = %{version}} | |
92 | Conflicts: sqlite3 < 3.23.1-2 | |
a1eaf1bc ER |
93 | |
94 | %description libs | |
3b448fcb JB |
95 | This package contains the SQLite 3 shared library. |
96 | ||
97 | %description libs -l pl.UTF-8 | |
98 | Ten pakiet zawiera bibliotekę współdzieloną SQLite 3. | |
a1eaf1bc | 99 | |
17b8c9f1 | 100 | %package devel |
101 | Summary: Header files for SQLite development | |
e882a99f | 102 | Summary(pl.UTF-8): Pliki nagłówkowe SQLite |
17b8c9f1 | 103 | Group: Development/Libraries |
a1eaf1bc | 104 | Requires: %{name}-libs = %{version}-%{release} |
d70f95dc | 105 | %if %{with unlock_notify} |
3b448fcb | 106 | Provides: %{name}-devel(unlock_notify) = %{version} |
d70f95dc | 107 | %endif |
108 | %if %{with load_extension} | |
3b448fcb | 109 | Provides: %{name}-devel(load_extension) = %{version} |
d70f95dc | 110 | %endif |
e0fdf246 | 111 | %if %{with icu} |
3b448fcb | 112 | Provides: %{name}-devel(icu) = %{version} |
e0fdf246 | 113 | %endif |
17b8c9f1 | 114 | |
115 | %description devel | |
116 | SQLite is a C library that implements an SQL database engine. A large | |
117 | subset of SQL92 is supported. A complete database is stored in a | |
118 | single disk file. The API is designed for convenience and ease of use. | |
119 | Applications that link against SQLite can enjoy the power and | |
120 | flexiblity of an SQL database without the administrative hassles of | |
121 | supporting a separate database server. Because it omits the | |
122 | client-server interaction overhead and writes directly to disk, SQLite | |
123 | is also faster than the big database servers for most operations. In | |
124 | addition to the C library, the SQLite distribution includes a | |
125 | command-line tool for interacting with SQLite databases and SQLite | |
126 | bindings for Tcl/Tk. | |
127 | ||
128 | This package contains the header files needed to develop programs that | |
129 | use these SQLite. | |
130 | ||
b7c0e1f2 JR |
131 | %description devel -l pl.UTF-8 |
132 | SQLite jest biblioteką języka C, która implementuje silnik baz danych | |
133 | SQL (obsługiwana jest większość standardu SQL92). Cała baza danych | |
134 | przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę | |
135 | bibliotekę charakteryzują się siłą i elastycznością SQLowych baz | |
136 | danych bez konieczności utrzymywania osobnego serwera baz danych. | |
137 | Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane | |
138 | bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów | |
139 | bazodanowych przy większości operacji na bazie danych. Dodatkowo | |
140 | oprócz biblioteki języka C, dostarczany jest program do zarządzania | |
17b8c9f1 | 141 | bazami danych. |
142 | ||
b7c0e1f2 JR |
143 | Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów |
144 | używających biblioteki SQLite. | |
17b8c9f1 | 145 | |
146 | %package static | |
147 | Summary: Static libraries for SQLite development | |
e882a99f | 148 | Summary(pl.UTF-8): Statyczne biblioteki SQLite |
17b8c9f1 | 149 | Group: Development/Libraries |
150 | Requires: %{name}-devel = %{version}-%{release} | |
d70f95dc | 151 | %if %{with unclock_notify} |
d70f95dc | 152 | Provides: %{name}-static(unlock_notify) |
153 | %endif | |
154 | %if %{with load_extension} | |
d70f95dc | 155 | Provides: %{name}-static(load_extension) |
156 | %endif | |
17b8c9f1 | 157 | |
158 | %description static | |
159 | SQLite is a C library that implements an SQL database engine. A large | |
160 | subset of SQL92 is supported. A complete database is stored in a | |
161 | single disk file. The API is designed for convenience and ease of use. | |
162 | Applications that link against SQLite can enjoy the power and | |
163 | flexiblity of an SQL database without the administrative hassles of | |
164 | supporting a separate database server. Because it omits the | |
165 | client-server interaction overhead and writes directly to disk, SQLite | |
166 | is also faster than the big database servers for most operations. In | |
167 | addition to the C library, the SQLite distribution includes a | |
168 | command-line tool for interacting with SQLite databases and SQLite | |
169 | bindings for Tcl/Tk. | |
170 | ||
171 | This package contains the static SQLite libraries. | |
172 | ||
b7c0e1f2 JR |
173 | %description static -l pl.UTF-8 |
174 | SQLite jest biblioteką języka C, która implementuje silnik baz danych | |
175 | SQL (obsługiwana jest większość standardu SQL92). Cała baza danych | |
176 | przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę | |
177 | bibliotekę charakteryzują się siłą i elastycznością SQLowych baz | |
178 | danych bez konieczności utrzymywania osobnego serwera baz danych. | |
179 | Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane | |
180 | bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów | |
181 | bazodanowych przy większości operacji na bazie danych. Dodatkowo | |
182 | oprócz biblioteki języka C, dostarczany jest program do zarządzania | |
17b8c9f1 | 183 | bazami danych. |
184 | ||
185 | Pakiet zawiera statyczne biblioteki SQLite. | |
186 | ||
c743401f | 187 | %package -n tcl-%{name} |
8e66772b | 188 | Summary: sqlite3 tcl extension |
e882a99f | 189 | Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl |
8e66772b | 190 | Group: Development/Languages/Tcl |
c743401f AM |
191 | |
192 | %description -n tcl-%{name} | |
193 | sqlite3 tcl extension. | |
194 | ||
b7c0e1f2 | 195 | %description -n tcl-%{name} -l pl.UTF-8 |
c743401f AM |
196 | Rozszerzenie sqlite3 dla Tcl. |
197 | ||
17b8c9f1 | 198 | %prep |
65430f84 | 199 | %setup -q -n sqlite-src-%{vnum} |
30682d5a | 200 | %patch0 -p1 |
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} | |
211 | cp -f /usr/share/automake/config.sub . | |
212 | %{__aclocal} | |
16787c3a | 213 | %{__autoconf} --force |
fc29cfbe ER |
214 | append-cppflags() { |
215 | CPPFLAGS="$CPPFLAGS $*" | |
216 | } | |
217 | append-libs() { | |
218 | LIBS="$LIBS $*" | |
219 | } | |
220 | export CPPFLAGS="%{rpmcflags}" | |
221 | export LIBS | |
87af9815 MB |
222 | %if %{with tcl} |
223 | export TCLLIBDIR="%{tcl_sitearch}/sqlite3" | |
224 | %endif | |
e0fdf246 | 225 | |
fc29cfbe ER |
226 | append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE |
227 | ||
228 | # Support column metadata functions. | |
229 | # http://sqlite.org/c3ref/column_database_name.html | |
230 | # http://sqlite.org/c3ref/table_column_metadata.html | |
231 | append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA | |
232 | ||
233 | # Support Full-Text Search versions 3 and 4. | |
234 | # http://sqlite.org/fts3.html | |
235 | #append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61 | |
2cf6a747 | 236 | append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS |
61a0da0a | 237 | append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER |
fc29cfbe ER |
238 | |
239 | # Support R*Trees. | |
240 | # http://sqlite.org/rtree.html | |
241 | append-cppflags -DSQLITE_ENABLE_RTREE | |
242 | ||
243 | # Support soundex() function. | |
244 | # http://sqlite.org/lang_corefunc.html#soundex | |
245 | #append-cppflags -DSQLITE_SOUNDEX | |
246 | ||
806c4314 JR |
247 | # Support dbstat virtual table. |
248 | # https://www.sqlite.org/dbstat.html | |
249 | append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB | |
250 | ||
fc29cfbe ER |
251 | %if %{with unlock_notify} |
252 | # Support unlock notification. | |
253 | # http://sqlite.org/unlock_notify.html | |
254 | append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY | |
255 | %endif | |
256 | ||
257 | %if %{with icu} | |
258 | append-cppflags -DSQLITE_ENABLE_ICU | |
259 | append-libs "-licui18n -licuuc" | |
260 | %endif | |
261 | ||
262 | %if %{with load_extension} | |
263 | append-libs "-ldl" | |
264 | %endif | |
265 | ||
17b8c9f1 | 266 | %configure \ |
0d754db8 | 267 | %{?with_readline:--disable-editline} \ |
e0fdf246 | 268 | %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \ |
60f66380 | 269 | %{__enable_disable load_extension load-extension} \ |
4522125d MB |
270 | --enable-threadsafe \ |
271 | --enable-fts5 | |
60f66380 | 272 | |
5df4522e | 273 | %{__make} |
1a6aae8d | 274 | |
e16bc4b1 | 275 | %if %{with doc} |
17b8c9f1 | 276 | %{__make} doc |
1a6aae8d | 277 | %endif |
17b8c9f1 | 278 | |
3e5df83c | 279 | %{?with_tests:LC_ALL=C %{__make} test} |
17b8c9f1 | 280 | |
281 | %install | |
282 | rm -rf $RPM_BUILD_ROOT | |
1c91d9d5 | 283 | install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1} |
0d754db8 | 284 | |
17b8c9f1 | 285 | %{__make} install \ |
dd55e3fd | 286 | DESTDIR=$RPM_BUILD_ROOT |
ec30f86a | 287 | |
0d754db8 | 288 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib} |
dd55e3fd | 289 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so |
1c91d9d5 JR |
290 | ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \ |
291 | $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so | |
292 | ||
e0fdf246 | 293 | cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
17b8c9f1 | 294 | |
295 | %clean | |
296 | rm -rf $RPM_BUILD_ROOT | |
297 | ||
a1eaf1bc ER |
298 | %post libs -p /sbin/ldconfig |
299 | %postun libs -p /sbin/ldconfig | |
300 | ||
301 | %files libs | |
302 | %defattr(644,root,root,755) | |
303 | %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.* | |
304 | %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0 | |
17b8c9f1 | 305 | |
306 | %files | |
307 | %defattr(644,root,root,755) | |
a8925d97 | 308 | %doc README.md |
17b8c9f1 | 309 | %attr(755,root,root) %{_bindir}/sqlite3 |
c743401f | 310 | %{_mandir}/man1/sqlite3.1* |
17b8c9f1 | 311 | |
312 | %files devel | |
313 | %defattr(644,root,root,755) | |
7e92c022 JB |
314 | %attr(755,root,root) %{_libdir}/libsqlite3.so |
315 | %{_libdir}/libsqlite3.la | |
17b8c9f1 | 316 | %{_includedir}/sqlite3.h |
ef88c71c | 317 | %{_includedir}/sqlite3ext.h |
7e92c022 | 318 | %{_pkgconfigdir}/sqlite3.pc |
17b8c9f1 | 319 | |
320 | %files static | |
321 | %defattr(644,root,root,755) | |
7e92c022 | 322 | %{_libdir}/libsqlite3.a |
c743401f | 323 | |
1a6aae8d | 324 | %if %{with tcl} |
c743401f AM |
325 | %files -n tcl-%{name} |
326 | %defattr(644,root,root,755) | |
80deaf18 | 327 | %dir %{_libdir}/tcl*/sqlite3 |
7e92c022 JB |
328 | %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so |
329 | %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl | |
1a6aae8d | 330 | %endif |