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