2 # - some tests fail with tcl8.5, it's tcl fault,
3 # if someone REALLY cares (s)he can look into it
6 %bcond_with tests # run tests
7 %bcond_without tcl # Tcl extension
8 %bcond_without doc # disable documentation building
9 %bcond_without unlock_notify # disable unlock notify API
10 %bcond_without load_extension # enable load extension API
11 %bcond_with icu # ICU tokenizer support
13 %ifarch alpha sparc %{x8664}
17 # disabling tcl currently breaks making test target,
18 # some hack in Makefile needs to be done
23 # sqlite3 version with zero padded without any dots (3 08 10 01 is 3.8.10.1)
24 # but trailing 00 means no 4rd part (3 10 01 00 is 3.10.1)
26 %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)}
29 Summary: SQLite library
30 Summary(pl.UTF-8): Biblioteka SQLite
34 License: Public Domain
36 # Source0Download: http://www.sqlite.org/download.html
37 Source0: http://www.sqlite.org/2016/sqlite-src-%{vnum}.zip
38 # Source0-md5: 037618ad92945e7a394ffe7ddbb9a85c
39 Patch0: %{name}-sign-function.patch
40 URL: http://www.sqlite.org/
41 %{?with_load_extension:Provides: %{name}(load_extension)}
42 %{?with_unlock_notify:Provides: %{name}(unlock_notify)}
43 %{?with_icu:Provides: %{name}(icu)}
44 BuildRequires: autoconf >= 2.50
45 BuildRequires: automake
46 BuildRequires: libtool
47 BuildRequires: readline-devel
48 %{?with_load_extension:BuildRequires: sed >= 4.0}
50 %{?with_tcl:BuildRequires: tcl-devel >= %{tclver}}
52 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54 %define _ulibdir /usr/lib
57 SQLite is a C library that implements an SQL database engine. A large
58 subset of SQL92 is supported. A complete database is stored in a
59 single disk file. The API is designed for convenience and ease of use.
60 Applications that link against SQLite can enjoy the power and
61 flexiblity of an SQL database without the administrative hassles of
62 supporting a separate database server. Because it omits the
63 client-server interaction overhead and writes directly to disk, SQLite
64 is also faster than the big database servers for most operations. In
65 addition to the C library, the SQLite distribution includes a
66 command-line tool for interacting with SQLite databases and SQLite
69 %description -l pl.UTF-8
70 SQLite jest biblioteką języka C, która implementuje silnik baz danych
71 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
72 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
73 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
74 danych bez konieczności utrzymywania osobnego serwera baz danych.
75 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
76 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
77 bazodanowych przy większości operacji na bazie danych. Dodatkowo
78 oprócz biblioteki języka C, dostarczany jest program do zarządzania
82 Summary: Header files for SQLite development
83 Summary(pl.UTF-8): Pliki nagłówkowe SQLite
84 Group: Development/Libraries
85 Requires: %{name} = %{version}-%{release}
86 %if %{with unlock_notify}
87 Provides: %{name}-devel(unlock_notify)
89 %if %{with load_extension}
90 Provides: %{name}-devel(load_extension)
93 Provides: %{name}-devel(icu)
97 SQLite is a C library that implements an SQL database engine. A large
98 subset of SQL92 is supported. A complete database is stored in a
99 single disk file. The API is designed for convenience and ease of use.
100 Applications that link against SQLite can enjoy the power and
101 flexiblity of an SQL database without the administrative hassles of
102 supporting a separate database server. Because it omits the
103 client-server interaction overhead and writes directly to disk, SQLite
104 is also faster than the big database servers for most operations. In
105 addition to the C library, the SQLite distribution includes a
106 command-line tool for interacting with SQLite databases and SQLite
109 This package contains the header files needed to develop programs that
112 %description devel -l pl.UTF-8
113 SQLite jest biblioteką języka C, która implementuje silnik baz danych
114 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
115 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
116 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
117 danych bez konieczności utrzymywania osobnego serwera baz danych.
118 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
119 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
120 bazodanowych przy większości operacji na bazie danych. Dodatkowo
121 oprócz biblioteki języka C, dostarczany jest program do zarządzania
124 Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów
125 używających biblioteki SQLite.
128 Summary: Static libraries for SQLite development
129 Summary(pl.UTF-8): Statyczne biblioteki SQLite
130 Group: Development/Libraries
131 Requires: %{name}-devel = %{version}-%{release}
132 %if %{with unclock_notify}
133 Provides: %{name}-static(unlock_notify)
135 %if %{with load_extension}
136 Provides: %{name}-static(load_extension)
140 SQLite is a C library that implements an SQL database engine. A large
141 subset of SQL92 is supported. A complete database is stored in a
142 single disk file. The API is designed for convenience and ease of use.
143 Applications that link against SQLite can enjoy the power and
144 flexiblity of an SQL database without the administrative hassles of
145 supporting a separate database server. Because it omits the
146 client-server interaction overhead and writes directly to disk, SQLite
147 is also faster than the big database servers for most operations. In
148 addition to the C library, the SQLite distribution includes a
149 command-line tool for interacting with SQLite databases and SQLite
152 This package contains the static SQLite libraries.
154 %description static -l pl.UTF-8
155 SQLite jest biblioteką języka C, która implementuje silnik baz danych
156 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
157 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
158 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
159 danych bez konieczności utrzymywania osobnego serwera baz danych.
160 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
161 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
162 bazodanowych przy większości operacji na bazie danych. Dodatkowo
163 oprócz biblioteki języka C, dostarczany jest program do zarządzania
166 Pakiet zawiera statyczne biblioteki SQLite.
168 %package -n tcl-%{name}
169 Summary: sqlite3 tcl extension
170 Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl
171 Group: Development/Languages/Tcl
173 %description -n tcl-%{name}
174 sqlite3 tcl extension.
176 %description -n tcl-%{name} -l pl.UTF-8
177 Rozszerzenie sqlite3 dla Tcl.
180 %setup -q -n sqlite-src-%{vnum}
183 %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in
185 if [ "$(cat VERSION)" != "%{version}" ]; then
186 echo "Tarball content doesn't match version %{version}." >&2
192 cp -f /usr/share/automake/config.sub .
196 CPPFLAGS="$CPPFLAGS $*"
201 export CPPFLAGS="%{rpmcflags}"
204 export TCLLIBDIR="%{tcl_sitearch}/sqlite3"
207 append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE
209 # Support column metadata functions.
210 # http://sqlite.org/c3ref/column_database_name.html
211 # http://sqlite.org/c3ref/table_column_metadata.html
212 append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
214 # Support Full-Text Search versions 3 and 4.
215 # http://sqlite.org/fts3.html
216 #append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61
217 append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
220 # http://sqlite.org/rtree.html
221 append-cppflags -DSQLITE_ENABLE_RTREE
223 # Support soundex() function.
224 # http://sqlite.org/lang_corefunc.html#soundex
225 #append-cppflags -DSQLITE_SOUNDEX
227 # Support dbstat virtual table.
228 # https://www.sqlite.org/dbstat.html
229 append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
231 %if %{with unlock_notify}
232 # Support unlock notification.
233 # http://sqlite.org/unlock_notify.html
234 append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
238 append-cppflags -DSQLITE_ENABLE_ICU
239 append-libs "-licui18n -licuuc"
242 %if %{with load_extension}
247 %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \
248 %{__enable_disable load_extension load-extension} \
257 %{?with_tests:LC_ALL=C %{__make} test}
260 rm -rf $RPM_BUILD_ROOT
261 install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1}
263 DESTDIR=$RPM_BUILD_ROOT
265 mv -f $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
266 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so
267 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \
268 $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so
270 cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1
273 rm -rf $RPM_BUILD_ROOT
275 %post -p /sbin/ldconfig
276 %postun -p /sbin/ldconfig
279 %defattr(644,root,root,755)
281 %attr(755,root,root) %{_bindir}/sqlite3
282 %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.*
283 %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0
284 %{_mandir}/man1/sqlite3.1*
287 %defattr(644,root,root,755)
288 %attr(755,root,root) %{_libdir}/libsqlite3.so
289 %{_libdir}/libsqlite3.la
290 %{_includedir}/sqlite3.h
291 %{_includedir}/sqlite3ext.h
292 %{_pkgconfigdir}/sqlite3.pc
295 %defattr(644,root,root,755)
296 %{_libdir}/libsqlite3.a
299 %files -n tcl-%{name}
300 %defattr(644,root,root,755)
301 %dir %{_libdir}/tcl*/sqlite3
302 %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so
303 %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl