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