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