]>
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 | |
5aa51f87 | 4 | # - configure.ac present, but doesn't support all -DEFINES, also it uses bash syntax (var+=value) |
a1eaf1bc | 5 | # - sqlite binary is linked statically with sqlite library |
17b8c9f1 | 6 | # |
7 | # Conditional build: | |
d12e8042 | 8 | %bcond_with tests # run tests |
0d754db8 | 9 | %bcond_with readline # readline (GPL) instead of libedit |
dd55e3fd | 10 | %bcond_without tcl # Tcl extension |
d12e8042 JB |
11 | %bcond_without doc # disable documentation building |
12 | %bcond_without unlock_notify # disable unlock notify API | |
60f66380 | 13 | %bcond_without load_extension # enable load extension API |
cd683928 | 14 | %bcond_with icu # ICU tokenizer 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) |
3af0a33a | 28 | %define vnum 3230100 |
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} |
a1eaf1bc | 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 |
3af0a33a | 41 | # Source0-md5: e7932e95208f9fd903f19459e2c09121 |
a3d8a32d | 42 | Patch0: %{name}-sign-function.patch |
65cfa56f | 43 | URL: http://www.sqlite.org/ |
dd55e3fd | 44 | BuildRequires: autoconf >= 2.50 |
17b8c9f1 | 45 | BuildRequires: automake |
0d754db8 | 46 | %{!?with_readline:BuildRequires: libedit-devel} |
17b8c9f1 | 47 | BuildRequires: libtool |
0d754db8 | 48 | %{?with_readline:BuildRequires: readline-devel} |
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 ER |
53 | Requires: %{name}-libs = %{version}-%{release} |
54 | %{?with_icu:Provides: %{name}(icu)} | |
55 | %{?with_load_extension:Provides: %{name}(load_extension)} | |
56 | %{?with_unlock_notify:Provides: %{name}(unlock_notify)} | |
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 | |
88 | Group: Libraries | |
89 | Conflicts: %{name} < 3.23.1-2 | |
90 | ||
91 | %description libs | |
92 | This package contains the shared library for %{name}. | |
93 | ||
17b8c9f1 | 94 | %package devel |
95 | Summary: Header files for SQLite development | |
e882a99f | 96 | Summary(pl.UTF-8): Pliki nagłówkowe SQLite |
17b8c9f1 | 97 | Group: Development/Libraries |
a1eaf1bc | 98 | Requires: %{name}-libs = %{version}-%{release} |
d70f95dc | 99 | %if %{with unlock_notify} |
d70f95dc | 100 | Provides: %{name}-devel(unlock_notify) |
101 | %endif | |
102 | %if %{with load_extension} | |
d70f95dc | 103 | Provides: %{name}-devel(load_extension) |
104 | %endif | |
e0fdf246 ER |
105 | %if %{with icu} |
106 | Provides: %{name}-devel(icu) | |
107 | %endif | |
17b8c9f1 | 108 | |
109 | %description devel | |
110 | SQLite is a C library that implements an SQL database engine. A large | |
111 | subset of SQL92 is supported. A complete database is stored in a | |
112 | single disk file. The API is designed for convenience and ease of use. | |
113 | Applications that link against SQLite can enjoy the power and | |
114 | flexiblity of an SQL database without the administrative hassles of | |
115 | supporting a separate database server. Because it omits the | |
116 | client-server interaction overhead and writes directly to disk, SQLite | |
117 | is also faster than the big database servers for most operations. In | |
118 | addition to the C library, the SQLite distribution includes a | |
119 | command-line tool for interacting with SQLite databases and SQLite | |
120 | bindings for Tcl/Tk. | |
121 | ||
122 | This package contains the header files needed to develop programs that | |
123 | use these SQLite. | |
124 | ||
b7c0e1f2 JR |
125 | %description devel -l pl.UTF-8 |
126 | SQLite jest biblioteką języka C, która implementuje silnik baz danych | |
127 | SQL (obsługiwana jest większość standardu SQL92). Cała baza danych | |
128 | przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę | |
129 | bibliotekę charakteryzują się siłą i elastycznością SQLowych baz | |
130 | danych bez konieczności utrzymywania osobnego serwera baz danych. | |
131 | Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane | |
132 | bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów | |
133 | bazodanowych przy większości operacji na bazie danych. Dodatkowo | |
134 | oprócz biblioteki języka C, dostarczany jest program do zarządzania | |
17b8c9f1 | 135 | bazami danych. |
136 | ||
b7c0e1f2 JR |
137 | Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów |
138 | używających biblioteki SQLite. | |
17b8c9f1 | 139 | |
140 | %package static | |
141 | Summary: Static libraries for SQLite development | |
e882a99f | 142 | Summary(pl.UTF-8): Statyczne biblioteki SQLite |
17b8c9f1 | 143 | Group: Development/Libraries |
144 | Requires: %{name}-devel = %{version}-%{release} | |
d70f95dc | 145 | %if %{with unclock_notify} |
d70f95dc | 146 | Provides: %{name}-static(unlock_notify) |
147 | %endif | |
148 | %if %{with load_extension} | |
d70f95dc | 149 | Provides: %{name}-static(load_extension) |
150 | %endif | |
17b8c9f1 | 151 | |
152 | %description static | |
153 | SQLite is a C library that implements an SQL database engine. A large | |
154 | subset of SQL92 is supported. A complete database is stored in a | |
155 | single disk file. The API is designed for convenience and ease of use. | |
156 | Applications that link against SQLite can enjoy the power and | |
157 | flexiblity of an SQL database without the administrative hassles of | |
158 | supporting a separate database server. Because it omits the | |
159 | client-server interaction overhead and writes directly to disk, SQLite | |
160 | is also faster than the big database servers for most operations. In | |
161 | addition to the C library, the SQLite distribution includes a | |
162 | command-line tool for interacting with SQLite databases and SQLite | |
163 | bindings for Tcl/Tk. | |
164 | ||
165 | This package contains the static SQLite libraries. | |
166 | ||
b7c0e1f2 JR |
167 | %description static -l pl.UTF-8 |
168 | SQLite jest biblioteką języka C, która implementuje silnik baz danych | |
169 | SQL (obsługiwana jest większość standardu SQL92). Cała baza danych | |
170 | przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę | |
171 | bibliotekę charakteryzują się siłą i elastycznością SQLowych baz | |
172 | danych bez konieczności utrzymywania osobnego serwera baz danych. | |
173 | Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane | |
174 | bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów | |
175 | bazodanowych przy większości operacji na bazie danych. Dodatkowo | |
176 | oprócz biblioteki języka C, dostarczany jest program do zarządzania | |
17b8c9f1 | 177 | bazami danych. |
178 | ||
179 | Pakiet zawiera statyczne biblioteki SQLite. | |
180 | ||
c743401f | 181 | %package -n tcl-%{name} |
8e66772b | 182 | Summary: sqlite3 tcl extension |
e882a99f | 183 | Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl |
8e66772b | 184 | Group: Development/Languages/Tcl |
c743401f AM |
185 | |
186 | %description -n tcl-%{name} | |
187 | sqlite3 tcl extension. | |
188 | ||
b7c0e1f2 | 189 | %description -n tcl-%{name} -l pl.UTF-8 |
c743401f AM |
190 | Rozszerzenie sqlite3 dla Tcl. |
191 | ||
17b8c9f1 | 192 | %prep |
65430f84 | 193 | %setup -q -n sqlite-src-%{vnum} |
30682d5a | 194 | %patch0 -p1 |
1cd2f537 | 195 | |
fc29cfbe | 196 | %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in |
faed6cf7 | 197 | |
9a9b0472 | 198 | if [ "$(cat VERSION)" != "%{version}" ]; then |
78ed83ff AM |
199 | echo "Tarball content doesn't match version %{version}." >&2 |
200 | exit 1 | |
201 | fi | |
202 | ||
17b8c9f1 | 203 | %build |
204 | %{__libtoolize} | |
205 | cp -f /usr/share/automake/config.sub . | |
206 | %{__aclocal} | |
16787c3a | 207 | %{__autoconf} --force |
fc29cfbe ER |
208 | append-cppflags() { |
209 | CPPFLAGS="$CPPFLAGS $*" | |
210 | } | |
211 | append-libs() { | |
212 | LIBS="$LIBS $*" | |
213 | } | |
214 | export CPPFLAGS="%{rpmcflags}" | |
215 | export LIBS | |
87af9815 MB |
216 | %if %{with tcl} |
217 | export TCLLIBDIR="%{tcl_sitearch}/sqlite3" | |
218 | %endif | |
e0fdf246 | 219 | |
fc29cfbe ER |
220 | append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE |
221 | ||
222 | # Support column metadata functions. | |
223 | # http://sqlite.org/c3ref/column_database_name.html | |
224 | # http://sqlite.org/c3ref/table_column_metadata.html | |
225 | append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA | |
226 | ||
227 | # Support Full-Text Search versions 3 and 4. | |
228 | # http://sqlite.org/fts3.html | |
229 | #append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61 | |
2cf6a747 | 230 | append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS |
61a0da0a | 231 | append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER |
fc29cfbe ER |
232 | |
233 | # Support R*Trees. | |
234 | # http://sqlite.org/rtree.html | |
235 | append-cppflags -DSQLITE_ENABLE_RTREE | |
236 | ||
237 | # Support soundex() function. | |
238 | # http://sqlite.org/lang_corefunc.html#soundex | |
239 | #append-cppflags -DSQLITE_SOUNDEX | |
240 | ||
806c4314 JR |
241 | # Support dbstat virtual table. |
242 | # https://www.sqlite.org/dbstat.html | |
243 | append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB | |
244 | ||
fc29cfbe ER |
245 | %if %{with unlock_notify} |
246 | # Support unlock notification. | |
247 | # http://sqlite.org/unlock_notify.html | |
248 | append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY | |
249 | %endif | |
250 | ||
251 | %if %{with icu} | |
252 | append-cppflags -DSQLITE_ENABLE_ICU | |
253 | append-libs "-licui18n -licuuc" | |
254 | %endif | |
255 | ||
256 | %if %{with load_extension} | |
257 | append-libs "-ldl" | |
258 | %endif | |
259 | ||
17b8c9f1 | 260 | %configure \ |
0d754db8 | 261 | %{?with_readline:--disable-editline} \ |
e0fdf246 | 262 | %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \ |
60f66380 | 263 | %{__enable_disable load_extension load-extension} \ |
4522125d MB |
264 | --enable-threadsafe \ |
265 | --enable-fts5 | |
60f66380 | 266 | |
5df4522e | 267 | %{__make} |
1a6aae8d | 268 | |
e16bc4b1 | 269 | %if %{with doc} |
17b8c9f1 | 270 | %{__make} doc |
1a6aae8d | 271 | %endif |
17b8c9f1 | 272 | |
3e5df83c | 273 | %{?with_tests:LC_ALL=C %{__make} test} |
17b8c9f1 | 274 | |
275 | %install | |
276 | rm -rf $RPM_BUILD_ROOT | |
1c91d9d5 | 277 | install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1} |
0d754db8 | 278 | |
17b8c9f1 | 279 | %{__make} install \ |
dd55e3fd | 280 | DESTDIR=$RPM_BUILD_ROOT |
ec30f86a | 281 | |
0d754db8 | 282 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib} |
dd55e3fd | 283 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so |
1c91d9d5 JR |
284 | ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \ |
285 | $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so | |
286 | ||
e0fdf246 | 287 | cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
17b8c9f1 | 288 | |
289 | %clean | |
290 | rm -rf $RPM_BUILD_ROOT | |
291 | ||
a1eaf1bc ER |
292 | %post libs -p /sbin/ldconfig |
293 | %postun libs -p /sbin/ldconfig | |
294 | ||
295 | %files libs | |
296 | %defattr(644,root,root,755) | |
297 | %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.* | |
298 | %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0 | |
17b8c9f1 | 299 | |
300 | %files | |
301 | %defattr(644,root,root,755) | |
a8925d97 | 302 | %doc README.md |
17b8c9f1 | 303 | %attr(755,root,root) %{_bindir}/sqlite3 |
c743401f | 304 | %{_mandir}/man1/sqlite3.1* |
17b8c9f1 | 305 | |
306 | %files devel | |
307 | %defattr(644,root,root,755) | |
7e92c022 JB |
308 | %attr(755,root,root) %{_libdir}/libsqlite3.so |
309 | %{_libdir}/libsqlite3.la | |
17b8c9f1 | 310 | %{_includedir}/sqlite3.h |
ef88c71c | 311 | %{_includedir}/sqlite3ext.h |
7e92c022 | 312 | %{_pkgconfigdir}/sqlite3.pc |
17b8c9f1 | 313 | |
314 | %files static | |
315 | %defattr(644,root,root,755) | |
7e92c022 | 316 | %{_libdir}/libsqlite3.a |
c743401f | 317 | |
1a6aae8d | 318 | %if %{with tcl} |
c743401f AM |
319 | %files -n tcl-%{name} |
320 | %defattr(644,root,root,755) | |
80deaf18 | 321 | %dir %{_libdir}/tcl*/sqlite3 |
7e92c022 JB |
322 | %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so |
323 | %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl | |
1a6aae8d | 324 | %endif |