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