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