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)
7 %bcond_with tests # run tests
8 %bcond_with readline # readline (GPL) instead of libedit
9 %bcond_without tcl # Tcl extension
10 %bcond_without doc # disable documentation building
11 %bcond_without unlock_notify # disable unlock notify API
12 %bcond_without load_extension # enable load extension API
13 %bcond_with icu # ICU tokenizer support
15 %ifarch alpha sparc %{x8664}
19 # disabling tcl currently breaks making test target,
20 # some hack in Makefile needs to be done
25 # sqlite3 version with zero padded without any dots (3 08 10 01 is 3.8.10.1)
26 # but trailing 00 means no 4rd part (3 11 01 00 is 3.11.1)
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)}
31 Summary: SQLite3 library
32 Summary(pl.UTF-8): Biblioteka SQLite3
36 License: Public Domain
38 # Source0Download: http://www.sqlite.org/download.html
39 Source0: http://www.sqlite.org/2018/sqlite-src-%{vnum}.zip
40 # Source0-md5: af55df181b37829bc10f652b12be7817
41 Patch0: %{name}-sign-function.patch
42 URL: http://www.sqlite.org/
43 %{?with_load_extension:Provides: %{name}(load_extension)}
44 %{?with_unlock_notify:Provides: %{name}(unlock_notify)}
45 %{?with_icu:Provides: %{name}(icu)}
46 BuildRequires: autoconf >= 2.50
47 BuildRequires: automake
48 %{!?with_readline:BuildRequires: libedit-devel}
49 BuildRequires: libtool
50 %{?with_readline:BuildRequires: readline-devel}
51 %{?with_load_extension:BuildRequires: sed >= 4.0}
53 %{?with_tcl:BuildRequires: tcl-devel >= %{tclver}}
55 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57 %define _ulibdir /usr/lib
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
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
85 Summary: Header files for SQLite development
86 Summary(pl.UTF-8): Pliki nagłówkowe SQLite
87 Group: Development/Libraries
88 Requires: %{name} = %{version}-%{release}
89 %if %{with unlock_notify}
90 Provides: %{name}-devel(unlock_notify)
92 %if %{with load_extension}
93 Provides: %{name}-devel(load_extension)
96 Provides: %{name}-devel(icu)
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
112 This package contains the header files needed to develop programs that
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
127 Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów
128 używających biblioteki SQLite.
131 Summary: Static libraries for SQLite development
132 Summary(pl.UTF-8): Statyczne biblioteki SQLite
133 Group: Development/Libraries
134 Requires: %{name}-devel = %{version}-%{release}
135 %if %{with unclock_notify}
136 Provides: %{name}-static(unlock_notify)
138 %if %{with load_extension}
139 Provides: %{name}-static(load_extension)
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
155 This package contains the static SQLite libraries.
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
169 Pakiet zawiera statyczne biblioteki SQLite.
171 %package -n tcl-%{name}
172 Summary: sqlite3 tcl extension
173 Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl
174 Group: Development/Languages/Tcl
176 %description -n tcl-%{name}
177 sqlite3 tcl extension.
179 %description -n tcl-%{name} -l pl.UTF-8
180 Rozszerzenie sqlite3 dla Tcl.
183 %setup -q -n sqlite-src-%{vnum}
186 %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in
188 if [ "$(cat VERSION)" != "%{version}" ]; then
189 echo "Tarball content doesn't match version %{version}." >&2
195 cp -f /usr/share/automake/config.sub .
197 %{__autoconf} --force
199 CPPFLAGS="$CPPFLAGS $*"
204 export CPPFLAGS="%{rpmcflags}"
207 export TCLLIBDIR="%{tcl_sitearch}/sqlite3"
210 append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE
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
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
220 append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
221 append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER
224 # http://sqlite.org/rtree.html
225 append-cppflags -DSQLITE_ENABLE_RTREE
227 # Support soundex() function.
228 # http://sqlite.org/lang_corefunc.html#soundex
229 #append-cppflags -DSQLITE_SOUNDEX
231 # Support dbstat virtual table.
232 # https://www.sqlite.org/dbstat.html
233 append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
235 %if %{with unlock_notify}
236 # Support unlock notification.
237 # http://sqlite.org/unlock_notify.html
238 append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
242 append-cppflags -DSQLITE_ENABLE_ICU
243 append-libs "-licui18n -licuuc"
246 %if %{with load_extension}
251 %{?with_readline:--disable-editline} \
252 %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \
253 %{__enable_disable load_extension load-extension} \
254 --enable-threadsafe \
263 %{?with_tests:LC_ALL=C %{__make} test}
266 rm -rf $RPM_BUILD_ROOT
267 install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1}
270 DESTDIR=$RPM_BUILD_ROOT
272 %{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
273 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so
274 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \
275 $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so
277 cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1
280 rm -rf $RPM_BUILD_ROOT
282 %post -p /sbin/ldconfig
283 %postun -p /sbin/ldconfig
286 %defattr(644,root,root,755)
288 %attr(755,root,root) %{_bindir}/sqlite3
289 %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.*
290 %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0
291 %{_mandir}/man1/sqlite3.1*
294 %defattr(644,root,root,755)
295 %attr(755,root,root) %{_libdir}/libsqlite3.so
296 %{_libdir}/libsqlite3.la
297 %{_includedir}/sqlite3.h
298 %{_includedir}/sqlite3ext.h
299 %{_pkgconfigdir}/sqlite3.pc
302 %defattr(644,root,root,755)
303 %{_libdir}/libsqlite3.a
306 %files -n tcl-%{name}
307 %defattr(644,root,root,755)
308 %dir %{_libdir}/tcl*/sqlite3
309 %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so
310 %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl