2 # - some tests fail with tcl8.5, it's tcl fault,
3 # if someone REALLY cares (s)he can look into it
4 # - configure.ac present, but doesn't support all -DEFINES, also it uses bash syntax (var+=value)
5 # - sqlite binary is linked statically with sqlite library
8 %bcond_with tests # run tests
9 %bcond_with readline # readline (GPL) instead of libedit
10 %bcond_without tcl # Tcl extension
11 %bcond_without doc # disable documentation building
12 %bcond_without unlock_notify # disable unlock notify API
13 %bcond_without load_extension # enable load extension API
14 %bcond_with icu # ICU tokenizer support
16 %ifarch alpha sparc %{x8664}
20 # disabling tcl currently breaks making test target,
21 # some hack in Makefile needs to be done
26 # sqlite3 version with zero padded without any dots (3 08 10 01 is 3.8.10.1)
27 # but trailing 00 means no 4rd part (3 11 01 00 is 3.11.1)
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)}
32 Summary: SQLite3 library
33 Summary(pl.UTF-8): Biblioteka SQLite3
37 License: Public Domain
39 # Source0Download: http://www.sqlite.org/download.html
40 Source0: http://www.sqlite.org/2018/sqlite-src-%{vnum}.zip
41 # Source0-md5: e7932e95208f9fd903f19459e2c09121
42 Patch0: %{name}-sign-function.patch
43 URL: http://www.sqlite.org/
44 BuildRequires: autoconf >= 2.50
45 BuildRequires: automake
46 %{!?with_readline:BuildRequires: libedit-devel}
47 BuildRequires: libtool
48 %{?with_readline:BuildRequires: readline-devel}
49 %{?with_load_extension:BuildRequires: sed >= 4.0}
51 %{?with_tcl:BuildRequires: tcl-devel >= %{tclver}}
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)}
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 %define _ulibdir /usr/lib
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
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
87 Summary: Shared library for the sqlite3 embeddable SQL database engine
89 Conflicts: %{name} < 3.23.1-2
92 This package contains the shared library for %{name}.
95 Summary: Header files for SQLite development
96 Summary(pl.UTF-8): Pliki nagłówkowe SQLite
97 Group: Development/Libraries
98 Requires: %{name}-libs = %{version}-%{release}
99 %if %{with unlock_notify}
100 Provides: %{name}-devel(unlock_notify)
102 %if %{with load_extension}
103 Provides: %{name}-devel(load_extension)
106 Provides: %{name}-devel(icu)
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
122 This package contains the header files needed to develop programs that
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
137 Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów
138 używających biblioteki SQLite.
141 Summary: Static libraries for SQLite development
142 Summary(pl.UTF-8): Statyczne biblioteki SQLite
143 Group: Development/Libraries
144 Requires: %{name}-devel = %{version}-%{release}
145 %if %{with unclock_notify}
146 Provides: %{name}-static(unlock_notify)
148 %if %{with load_extension}
149 Provides: %{name}-static(load_extension)
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
165 This package contains the static SQLite libraries.
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
179 Pakiet zawiera statyczne biblioteki SQLite.
181 %package -n tcl-%{name}
182 Summary: sqlite3 tcl extension
183 Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl
184 Group: Development/Languages/Tcl
186 %description -n tcl-%{name}
187 sqlite3 tcl extension.
189 %description -n tcl-%{name} -l pl.UTF-8
190 Rozszerzenie sqlite3 dla Tcl.
193 %setup -q -n sqlite-src-%{vnum}
196 %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in
198 if [ "$(cat VERSION)" != "%{version}" ]; then
199 echo "Tarball content doesn't match version %{version}." >&2
205 cp -f /usr/share/automake/config.sub .
207 %{__autoconf} --force
209 CPPFLAGS="$CPPFLAGS $*"
214 export CPPFLAGS="%{rpmcflags}"
217 export TCLLIBDIR="%{tcl_sitearch}/sqlite3"
220 append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE
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
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
230 append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
231 append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER
234 # http://sqlite.org/rtree.html
235 append-cppflags -DSQLITE_ENABLE_RTREE
237 # Support soundex() function.
238 # http://sqlite.org/lang_corefunc.html#soundex
239 #append-cppflags -DSQLITE_SOUNDEX
241 # Support dbstat virtual table.
242 # https://www.sqlite.org/dbstat.html
243 append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
245 %if %{with unlock_notify}
246 # Support unlock notification.
247 # http://sqlite.org/unlock_notify.html
248 append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
252 append-cppflags -DSQLITE_ENABLE_ICU
253 append-libs "-licui18n -licuuc"
256 %if %{with load_extension}
261 %{?with_readline:--disable-editline} \
262 %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \
263 %{__enable_disable load_extension load-extension} \
264 --enable-threadsafe \
273 %{?with_tests:LC_ALL=C %{__make} test}
276 rm -rf $RPM_BUILD_ROOT
277 install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1}
280 DESTDIR=$RPM_BUILD_ROOT
282 %{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
283 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so
284 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \
285 $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so
287 cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1
290 rm -rf $RPM_BUILD_ROOT
292 %post libs -p /sbin/ldconfig
293 %postun libs -p /sbin/ldconfig
296 %defattr(644,root,root,755)
297 %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.*
298 %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0
301 %defattr(644,root,root,755)
303 %attr(755,root,root) %{_bindir}/sqlite3
304 %{_mandir}/man1/sqlite3.1*
307 %defattr(644,root,root,755)
308 %attr(755,root,root) %{_libdir}/libsqlite3.so
309 %{_libdir}/libsqlite3.la
310 %{_includedir}/sqlite3.h
311 %{_includedir}/sqlite3ext.h
312 %{_pkgconfigdir}/sqlite3.pc
315 %defattr(644,root,root,755)
316 %{_libdir}/libsqlite3.a
319 %files -n tcl-%{name}
320 %defattr(644,root,root,755)
321 %dir %{_libdir}/tcl*/sqlite3
322 %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so
323 %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl