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