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