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_without tcl # Tcl extension
9 %bcond_without doc # disable documentation building
10 %bcond_without unlock_notify # disable unlock notify API
11 %bcond_without load_extension # enable load extension API
12 %bcond_with icu # ICU tokenizer support
14 %ifarch alpha sparc %{x8664}
18 # disabling tcl currently breaks making test target,
19 # some hack in Makefile needs to be done
24 # sqlite3 version with zero padded without any dots (3 08 10 01 is 3.8.10.1)
25 # but trailing 00 means no 4rd part (3 11 01 00 is 3.11.1)
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)}
30 Summary: SQLite3 library
31 Summary(pl.UTF-8): Biblioteka SQLite3
35 License: Public Domain
37 # Source0Download: http://www.sqlite.org/download.html
38 Source0: http://www.sqlite.org/2017/sqlite-src-%{vnum}.zip
39 # Source0-md5: b5663cdf2105d6493d17d89e1868a31f
40 Patch0: %{name}-sign-function.patch
41 URL: http://www.sqlite.org/
42 %{?with_load_extension:Provides: %{name}(load_extension)}
43 %{?with_unlock_notify:Provides: %{name}(unlock_notify)}
44 %{?with_icu:Provides: %{name}(icu)}
45 BuildRequires: autoconf >= 2.50
46 BuildRequires: automake
47 BuildRequires: libtool
48 BuildRequires: readline-devel
49 %{?with_load_extension:BuildRequires: sed >= 4.0}
51 %{?with_tcl:BuildRequires: tcl-devel >= %{tclver}}
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55 %define _ulibdir /usr/lib
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
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
83 Summary: Header files for SQLite development
84 Summary(pl.UTF-8): Pliki nagłówkowe SQLite
85 Group: Development/Libraries
86 Requires: %{name} = %{version}-%{release}
87 %if %{with unlock_notify}
88 Provides: %{name}-devel(unlock_notify)
90 %if %{with load_extension}
91 Provides: %{name}-devel(load_extension)
94 Provides: %{name}-devel(icu)
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
110 This package contains the header files needed to develop programs that
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
125 Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów
126 używających biblioteki SQLite.
129 Summary: Static libraries for SQLite development
130 Summary(pl.UTF-8): Statyczne biblioteki SQLite
131 Group: Development/Libraries
132 Requires: %{name}-devel = %{version}-%{release}
133 %if %{with unclock_notify}
134 Provides: %{name}-static(unlock_notify)
136 %if %{with load_extension}
137 Provides: %{name}-static(load_extension)
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
153 This package contains the static SQLite libraries.
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
167 Pakiet zawiera statyczne biblioteki SQLite.
169 %package -n tcl-%{name}
170 Summary: sqlite3 tcl extension
171 Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl
172 Group: Development/Languages/Tcl
174 %description -n tcl-%{name}
175 sqlite3 tcl extension.
177 %description -n tcl-%{name} -l pl.UTF-8
178 Rozszerzenie sqlite3 dla Tcl.
181 %setup -q -n sqlite-src-%{vnum}
184 %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in
186 if [ "$(cat VERSION)" != "%{version}" ]; then
187 echo "Tarball content doesn't match version %{version}." >&2
193 cp -f /usr/share/automake/config.sub .
195 %{__autoconf} --force
197 CPPFLAGS="$CPPFLAGS $*"
202 export CPPFLAGS="%{rpmcflags}"
205 export TCLLIBDIR="%{tcl_sitearch}/sqlite3"
208 append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE
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
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
218 append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
219 append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER
222 # http://sqlite.org/rtree.html
223 append-cppflags -DSQLITE_ENABLE_RTREE
225 # Support soundex() function.
226 # http://sqlite.org/lang_corefunc.html#soundex
227 #append-cppflags -DSQLITE_SOUNDEX
229 # Support dbstat virtual table.
230 # https://www.sqlite.org/dbstat.html
231 append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
233 %if %{with unlock_notify}
234 # Support unlock notification.
235 # http://sqlite.org/unlock_notify.html
236 append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
240 append-cppflags -DSQLITE_ENABLE_ICU
241 append-libs "-licui18n -licuuc"
244 %if %{with load_extension}
249 %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \
250 %{__enable_disable load_extension load-extension} \
259 %{?with_tests:LC_ALL=C %{__make} test}
262 rm -rf $RPM_BUILD_ROOT
263 install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1}
265 DESTDIR=$RPM_BUILD_ROOT
267 mv -f $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
268 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so
269 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \
270 $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so
272 cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1
275 rm -rf $RPM_BUILD_ROOT
277 %post -p /sbin/ldconfig
278 %postun -p /sbin/ldconfig
281 %defattr(644,root,root,755)
283 %attr(755,root,root) %{_bindir}/sqlite3
284 %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.*
285 %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0
286 %{_mandir}/man1/sqlite3.1*
289 %defattr(644,root,root,755)
290 %attr(755,root,root) %{_libdir}/libsqlite3.so
291 %{_libdir}/libsqlite3.la
292 %{_includedir}/sqlite3.h
293 %{_includedir}/sqlite3ext.h
294 %{_pkgconfigdir}/sqlite3.pc
297 %defattr(644,root,root,755)
298 %{_libdir}/libsqlite3.a
301 %files -n tcl-%{name}
302 %defattr(644,root,root,755)
303 %dir %{_libdir}/tcl*/sqlite3
304 %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so
305 %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl