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