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