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