]> git.pld-linux.org Git - packages/sqlite3.git/blame_incremental - sqlite3.spec
updated wal replication patch; rel 1
[packages/sqlite3.git] / sqlite3.spec
... / ...
CommitLineData
1# TODO:
2# - some tests fail with tcl8.5, it's tcl fault,
3# if someone REALLY cares (s)he can look into it
4# - sqlite binary is linked statically with sqlite library
5#
6# Conditional build:
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
14%bcond_without wal_replication # WAL replication support
15
16%ifarch %{x8664}
17%undefine with_tests
18%endif
19
20# disabling tcl currently breaks making test target,
21# some hack in Makefile needs to be done
22%if %{without tcl}
23%undefine with_tests
24%endif
25
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)
28%define vnum 3280000
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)}
30
31# wal replication version
32%define walver 3.28.0
33
34%define tclver 8.6
35Summary: SQLite3 library
36Summary(pl.UTF-8): Biblioteka SQLite3
37Name: sqlite3
38Version: %{ver}
39Release: 1
40License: Public Domain
41Group: Libraries
42# Source0Download: http://www.sqlite.org/download.html
43Source0: https://www.sqlite.org/2019/sqlite-src-%{vnum}.zip
44# Source0-md5: fe28fd6a90b86c4b9a4a7c61fdb1beb6
45Patch0: %{name}-sign-function.patch
46# https://github.com/CanonicalLtd/dqlite/issues/91
47Patch1: https://github.com/CanonicalLtd/sqlite/releases/download/version-%{walver}+replication3/sqlite-%{walver}.diff
48# Patch1-md5: 58d6b67af08d373047756ed5d2579fa8
49URL: https://www.sqlite.org/
50BuildRequires: autoconf >= 2.50
51BuildRequires: automake
52%{!?with_readline:BuildRequires: libedit-devel}
53BuildRequires: libtool
54%{?with_readline:BuildRequires: readline-devel}
55%{?with_load_extension:BuildRequires: sed >= 4.0}
56BuildRequires: tcl
57%{?with_tcl:BuildRequires: tcl-devel >= %{tclver}}
58BuildRequires: unzip
59Requires: %{name}-libs = %{version}-%{release}
60%{?with_icu:Provides: %{name}(icu) = %{version}}
61%{?with_load_extension:Provides: %{name}(load_extension) = %{version}}
62%{?with_unlock_notify:Provides: %{name}(unlock_notify) = %{version}}
63%{?with_wal_replication:Provides: %{name}(wal_replication) = %{version}}
64BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65
66%define _ulibdir /usr/lib
67
68%description
69SQLite is a C library that implements an SQL database engine. A large
70subset of SQL92 is supported. A complete database is stored in a
71single disk file. The API is designed for convenience and ease of use.
72Applications that link against SQLite can enjoy the power and
73flexiblity of an SQL database without the administrative hassles of
74supporting a separate database server. Because it omits the
75client-server interaction overhead and writes directly to disk, SQLite
76is also faster than the big database servers for most operations. In
77addition to the C library, the SQLite distribution includes a
78command-line tool for interacting with SQLite databases and SQLite
79bindings for Tcl/Tk.
80
81%description -l pl.UTF-8
82SQLite jest biblioteką języka C, która implementuje silnik baz danych
83SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
84przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
85bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
86danych bez konieczności utrzymywania osobnego serwera baz danych.
87Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
88bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
89bazodanowych przy większości operacji na bazie danych. Dodatkowo
90oprócz biblioteki języka C, dostarczany jest program do zarządzania
91bazami danych.
92
93%package libs
94Summary: Shared library for the sqlite3 embeddable SQL database engine
95Summary(pl.UTF-8): Biblioteka współdzielona osadzalnego silnika baz danych SQL sqlite3
96Group: Libraries
97%{?with_icu:Provides: %{name}-libs(icu) = %{version}}
98%{?with_load_extension:Provides: %{name}-libs(load_extension) = %{version}}
99%{?with_unlock_notify:Provides: %{name}-libs(unlock_notify) = %{version}}
100%{?with_wal_replication:Provides: %{name}-libs(wal_replication) = %{version}}
101Conflicts: sqlite3 < 3.23.1-2
102
103%description libs
104This package contains the SQLite 3 shared library.
105
106%description libs -l pl.UTF-8
107Ten pakiet zawiera bibliotekę współdzieloną SQLite 3.
108
109%package devel
110Summary: Header files for SQLite development
111Summary(pl.UTF-8): Pliki nagłówkowe SQLite
112Group: Development/Libraries
113Requires: %{name}-libs = %{version}-%{release}
114%if %{with unlock_notify}
115Provides: %{name}-devel(unlock_notify) = %{version}
116%endif
117%if %{with load_extension}
118Provides: %{name}-devel(load_extension) = %{version}
119%endif
120%if %{with icu}
121Provides: %{name}-devel(icu) = %{version}
122%endif
123%{?with_wal_replication:Provides: %{name}-devel(wal_replication) = %{version}}
124
125%description devel
126SQLite is a C library that implements an SQL database engine. A large
127subset of SQL92 is supported. A complete database is stored in a
128single disk file. The API is designed for convenience and ease of use.
129Applications that link against SQLite can enjoy the power and
130flexiblity of an SQL database without the administrative hassles of
131supporting a separate database server. Because it omits the
132client-server interaction overhead and writes directly to disk, SQLite
133is also faster than the big database servers for most operations. In
134addition to the C library, the SQLite distribution includes a
135command-line tool for interacting with SQLite databases and SQLite
136bindings for Tcl/Tk.
137
138This package contains the header files needed to develop programs that
139use these SQLite.
140
141%description devel -l pl.UTF-8
142SQLite jest biblioteką języka C, która implementuje silnik baz danych
143SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
144przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
145bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
146danych bez konieczności utrzymywania osobnego serwera baz danych.
147Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
148bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
149bazodanowych przy większości operacji na bazie danych. Dodatkowo
150oprócz biblioteki języka C, dostarczany jest program do zarządzania
151bazami danych.
152
153Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów
154używających biblioteki SQLite.
155
156%package static
157Summary: Static libraries for SQLite development
158Summary(pl.UTF-8): Statyczne biblioteki SQLite
159Group: Development/Libraries
160Requires: %{name}-devel = %{version}-%{release}
161%if %{with unclock_notify}
162Provides: %{name}-static(unlock_notify)
163%endif
164%if %{with load_extension}
165Provides: %{name}-static(load_extension)
166%endif
167%{?with_wal_replication:Provides: %{name}-static(wal_replication)}
168
169%description static
170SQLite is a C library that implements an SQL database engine. A large
171subset of SQL92 is supported. A complete database is stored in a
172single disk file. The API is designed for convenience and ease of use.
173Applications that link against SQLite can enjoy the power and
174flexiblity of an SQL database without the administrative hassles of
175supporting a separate database server. Because it omits the
176client-server interaction overhead and writes directly to disk, SQLite
177is also faster than the big database servers for most operations. In
178addition to the C library, the SQLite distribution includes a
179command-line tool for interacting with SQLite databases and SQLite
180bindings for Tcl/Tk.
181
182This package contains the static SQLite libraries.
183
184%description static -l pl.UTF-8
185SQLite jest biblioteką języka C, która implementuje silnik baz danych
186SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
187przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
188bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
189danych bez konieczności utrzymywania osobnego serwera baz danych.
190Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
191bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
192bazodanowych przy większości operacji na bazie danych. Dodatkowo
193oprócz biblioteki języka C, dostarczany jest program do zarządzania
194bazami danych.
195
196Pakiet zawiera statyczne biblioteki SQLite.
197
198%package -n tcl-%{name}
199Summary: sqlite3 tcl extension
200Summary(pl.UTF-8): Rozszerzenie sqlite3 dla Tcl
201Group: Development/Languages/Tcl
202
203%description -n tcl-%{name}
204sqlite3 tcl extension.
205
206%description -n tcl-%{name} -l pl.UTF-8
207Rozszerzenie sqlite3 dla Tcl.
208
209%prep
210%setup -q -n sqlite-src-%{vnum}
211%patch0 -p1
212%{?with_wal_replication:%patch1 -p1}
213
214%{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in
215
216if [ "$(cat VERSION)" != "%{version}" ]; then
217 echo "Tarball content doesn't match version %{version}." >&2
218 exit 1
219fi
220
221%build
222%{__libtoolize}
223cp -f /usr/share/automake/config.sub .
224%{__aclocal}
225%{__autoconf} --force
226append-cppflags() {
227 CPPFLAGS="$CPPFLAGS $*"
228}
229append-libs() {
230 LIBS="$LIBS $*"
231}
232export CPPFLAGS="%{rpmcflags}"
233export LIBS
234%if %{with tcl}
235export TCLLIBDIR="%{tcl_sitearch}/sqlite3"
236%endif
237
238append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE
239
240# Support for optional ORDER BY and LIMIT clause on UPDATE and DELETE statements
241append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
242
243# Support column metadata functions.
244# http://sqlite.org/c3ref/column_database_name.html
245# http://sqlite.org/c3ref/table_column_metadata.html
246append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
247
248# Support Full-Text Search versions 3 and 4.
249# http://sqlite.org/fts3.html
250#append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61
251append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
252append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER
253
254# Support R*Trees.
255# http://sqlite.org/rtree.html
256append-cppflags -DSQLITE_ENABLE_RTREE
257
258# Support Geopoly module (new as of 3.25.0)
259# https://www.sqlite.org/geopoly.html
260append-cppflags -DSQLITE_ENABLE_GEOPOLY
261
262# Support soundex() function.
263# http://sqlite.org/lang_corefunc.html#soundex
264#append-cppflags -DSQLITE_SOUNDEX
265
266# Support dbstat virtual table.
267# https://www.sqlite.org/dbstat.html
268append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
269
270# Support for session extension (record changes to a changeset).
271# https://www.sqlite.org/sessionintro.html
272append-cppflags -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK
273
274%if %{with unlock_notify}
275# Support unlock notification.
276# http://sqlite.org/unlock_notify.html
277append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
278%endif
279
280%if %{with icu}
281append-cppflags -DSQLITE_ENABLE_ICU
282append-libs "-licui18n -licuuc"
283%endif
284
285%if %{with load_extension}
286append-libs "-ldl"
287%endif
288
289%if %{with wal_replication}
290# A patched version of SQLite with support for WAL-based replication
291append-cppflags -DSQLITE_ENABLE_WAL_REPLICATION
292%endif
293
294%configure \
295 %{?with_readline:--disable-editline} \
296 %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \
297 %{__enable_disable load_extension load-extension} \
298 --enable-threadsafe \
299 --enable-fts5
300
301%{__make}
302
303%if %{with doc}
304%{__make} doc
305%endif
306
307%{?with_tests:LC_ALL=C %{__make} test}
308
309%install
310rm -rf $RPM_BUILD_ROOT
311install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1}
312
313%{__make} install \
314 DESTDIR=$RPM_BUILD_ROOT
315
316%{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
317%{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so
318ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \
319 $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so
320
321cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1
322
323%clean
324rm -rf $RPM_BUILD_ROOT
325
326%post libs -p /sbin/ldconfig
327%postun libs -p /sbin/ldconfig
328
329%files libs
330%defattr(644,root,root,755)
331%attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.*
332%attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0
333
334%files
335%defattr(644,root,root,755)
336%doc README.md
337%attr(755,root,root) %{_bindir}/sqlite3
338%{_mandir}/man1/sqlite3.1*
339
340%files devel
341%defattr(644,root,root,755)
342%attr(755,root,root) %{_libdir}/libsqlite3.so
343%{_libdir}/libsqlite3.la
344%{_includedir}/sqlite3.h
345%{_includedir}/sqlite3ext.h
346%{_pkgconfigdir}/sqlite3.pc
347
348%files static
349%defattr(644,root,root,755)
350%{_libdir}/libsqlite3.a
351
352%if %{with tcl}
353%files -n tcl-%{name}
354%defattr(644,root,root,755)
355%dir %{_libdir}/tcl*/sqlite3
356%attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so
357%{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl
358%endif
This page took 0.057878 seconds and 4 git commands to generate.