]> git.pld-linux.org Git - packages/sqlite3.git/blob - sqlite3.spec
rel 1 (disable replication patch by default)
[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_with     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    3340000
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:        1
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:  ce61b97012ab111d1ccd7f2d97922ec7
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 BuildRequires:  rpmbuild(macros) >= 1.527
57 %{?with_load_extension:BuildRequires:   sed >= 4.0}
58 BuildRequires:  tcl
59 %{?with_tcl:BuildRequires:      tcl-devel >= %{tclver}}
60 BuildRequires:  unzip
61 Requires:       %{name}-libs = %{version}-%{release}
62 %{?with_icu:Provides:   %{name}(icu) = %{version}}
63 %{?with_load_extension:Provides:        %{name}(load_extension) = %{version}}
64 %{?with_unlock_notify:Provides: %{name}(unlock_notify) = %{version}}
65 %{?with_wal_replication:Provides:       %{name}(wal_replication) = %{version}}
66 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67
68 %define         _ulibdir        /usr/lib
69
70 %description
71 SQLite is a C library that implements an SQL database engine. A large
72 subset of SQL92 is supported. A complete database is stored in a
73 single disk file. The API is designed for convenience and ease of use.
74 Applications that link against SQLite can enjoy the power and
75 flexiblity of an SQL database without the administrative hassles of
76 supporting a separate database server. Because it omits the
77 client-server interaction overhead and writes directly to disk, SQLite
78 is also faster than the big database servers for most operations. In
79 addition to the C library, the SQLite distribution includes a
80 command-line tool for interacting with SQLite databases and SQLite
81 bindings for Tcl/Tk.
82
83 %description -l pl.UTF-8
84 SQLite jest biblioteką języka C, która implementuje silnik baz danych
85 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
86 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
87 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
88 danych bez konieczności utrzymywania osobnego serwera baz danych.
89 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
90 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
91 bazodanowych przy większości operacji na bazie danych. Dodatkowo
92 oprócz biblioteki języka C, dostarczany jest program do zarządzania
93 bazami danych.
94
95 %package libs
96 Summary:        Shared library for the sqlite3 embeddable SQL database engine
97 Summary(pl.UTF-8):      Biblioteka współdzielona osadzalnego silnika baz danych SQL sqlite3
98 Group:          Libraries
99 %{?with_icu:Provides:   %{name}-libs(icu) = %{version}}
100 %{?with_load_extension:Provides:        %{name}-libs(load_extension) = %{version}}
101 %{?with_unlock_notify:Provides: %{name}-libs(unlock_notify) = %{version}}
102 %{?with_wal_replication:Provides:       %{name}-libs(wal_replication) = %{version}}
103 Conflicts:      sqlite3 < 3.23.1-2
104
105 %description libs
106 This package contains the SQLite 3 shared library.
107
108 %description libs -l pl.UTF-8
109 Ten pakiet zawiera bibliotekę współdzieloną SQLite 3.
110
111 %package devel
112 Summary:        Header files for SQLite development
113 Summary(pl.UTF-8):      Pliki nagłówkowe SQLite
114 Group:          Development/Libraries
115 Requires:       %{name}-libs = %{version}-%{release}
116 %if %{with unlock_notify}
117 Provides:       %{name}-devel(unlock_notify) = %{version}
118 %endif
119 %if %{with load_extension}
120 Provides:       %{name}-devel(load_extension) = %{version}
121 %endif
122 %if %{with icu}
123 Provides:       %{name}-devel(icu) = %{version}
124 %endif
125 %{?with_wal_replication:Provides:       %{name}-devel(wal_replication) = %{version}}
126
127 %description devel
128 SQLite is a C library that implements an SQL database engine. A large
129 subset of SQL92 is supported. A complete database is stored in a
130 single disk file. The API is designed for convenience and ease of use.
131 Applications that link against SQLite can enjoy the power and
132 flexiblity of an SQL database without the administrative hassles of
133 supporting a separate database server. Because it omits the
134 client-server interaction overhead and writes directly to disk, SQLite
135 is also faster than the big database servers for most operations. In
136 addition to the C library, the SQLite distribution includes a
137 command-line tool for interacting with SQLite databases and SQLite
138 bindings for Tcl/Tk.
139
140 This package contains the header files needed to develop programs that
141 use these SQLite.
142
143 %description devel -l pl.UTF-8
144 SQLite jest biblioteką języka C, która implementuje silnik baz danych
145 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
146 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
147 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
148 danych bez konieczności utrzymywania osobnego serwera baz danych.
149 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
150 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
151 bazodanowych przy większości operacji na bazie danych. Dodatkowo
152 oprócz biblioteki języka C, dostarczany jest program do zarządzania
153 bazami danych.
154
155 Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów
156 używających biblioteki SQLite.
157
158 %package static
159 Summary:        Static libraries for SQLite development
160 Summary(pl.UTF-8):      Statyczne biblioteki SQLite
161 Group:          Development/Libraries
162 Requires:       %{name}-devel = %{version}-%{release}
163 %if %{with unclock_notify}
164 Provides:       %{name}-static(unlock_notify)
165 %endif
166 %if %{with load_extension}
167 Provides:       %{name}-static(load_extension)
168 %endif
169 %{?with_wal_replication:Provides:       %{name}-static(wal_replication)}
170
171 %description static
172 SQLite is a C library that implements an SQL database engine. A large
173 subset of SQL92 is supported. A complete database is stored in a
174 single disk file. The API is designed for convenience and ease of use.
175 Applications that link against SQLite can enjoy the power and
176 flexiblity of an SQL database without the administrative hassles of
177 supporting a separate database server. Because it omits the
178 client-server interaction overhead and writes directly to disk, SQLite
179 is also faster than the big database servers for most operations. In
180 addition to the C library, the SQLite distribution includes a
181 command-line tool for interacting with SQLite databases and SQLite
182 bindings for Tcl/Tk.
183
184 This package contains the static SQLite libraries.
185
186 %description static -l pl.UTF-8
187 SQLite jest biblioteką języka C, która implementuje silnik baz danych
188 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
189 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
190 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
191 danych bez konieczności utrzymywania osobnego serwera baz danych.
192 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
193 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
194 bazodanowych przy większości operacji na bazie danych. Dodatkowo
195 oprócz biblioteki języka C, dostarczany jest program do zarządzania
196 bazami danych.
197
198 Pakiet zawiera statyczne biblioteki SQLite.
199
200 %package -n tcl-%{name}
201 Summary:        sqlite3 tcl extension
202 Summary(pl.UTF-8):      Rozszerzenie sqlite3 dla Tcl
203 Group:          Development/Languages/Tcl
204
205 %description -n tcl-%{name}
206 sqlite3 tcl extension.
207
208 %description -n tcl-%{name} -l pl.UTF-8
209 Rozszerzenie sqlite3 dla Tcl.
210
211 %prep
212 %setup -q -n sqlite-src-%{vnum}
213 %patch0 -p1
214 %{?with_wal_replication:%patch1 -p1}
215
216 %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in
217
218 if [ "$(cat VERSION)" != "%{version}" ]; then
219         echo "Tarball content doesn't match version %{version}." >&2
220         exit 1
221 fi
222
223 %build
224 %{__libtoolize}
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.083827 seconds and 4 git commands to generate.