]> git.pld-linux.org Git - packages/sqlite3.git/blob - sqlite3.spec
8b948615ac5918b059e3354ac224f789ccf38ff2
[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
15 %ifarch alpha sparc %{x8664}
16 %undefine       with_tests
17 %endif
18
19 # disabling tcl currently breaks making test target,
20 # some hack in Makefile needs to be done
21 %if %{without tcl}
22 %undefine       with_tests
23 %endif
24
25 # sqlite3 version with zero padded without any dots (3 08 10 01 is 3.8.10.1)
26 # but trailing 00 means no 4rd part (3 11 01 00 is 3.11.1)
27 %define         vnum    3250000
28 %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)}
29
30 %define         tclver          8.6
31 Summary:        SQLite3 library
32 Summary(pl.UTF-8):      Biblioteka SQLite3
33 Name:           sqlite3
34 Version:        %{ver}
35 Release:        1
36 License:        Public Domain
37 Group:          Libraries
38 # Source0Download: http://www.sqlite.org/download.html
39 Source0:        http://www.sqlite.org/2018/sqlite-src-%{vnum}.zip
40 # Source0-md5:  4aa37b7b3cf5bd708dae325a0a0d440e
41 Patch0:         %{name}-sign-function.patch
42 URL:            http://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 %{?with_load_extension:BuildRequires:   sed >= 4.0}
49 BuildRequires:  tcl
50 %{?with_tcl:BuildRequires:      tcl-devel >= %{tclver}}
51 BuildRequires:  unzip
52 Requires:       %{name}-libs = %{version}-%{release}
53 %{?with_icu:Provides:   %{name}(icu) = %{version}}
54 %{?with_load_extension:Provides:        %{name}(load_extension) = %{version}}
55 %{?with_unlock_notify:Provides: %{name}(unlock_notify) = %{version}}
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58 %define         _ulibdir        /usr/lib
59
60 %description
61 SQLite is a C library that implements an SQL database engine. A large
62 subset of SQL92 is supported. A complete database is stored in a
63 single disk file. The API is designed for convenience and ease of use.
64 Applications that link against SQLite can enjoy the power and
65 flexiblity of an SQL database without the administrative hassles of
66 supporting a separate database server. Because it omits the
67 client-server interaction overhead and writes directly to disk, SQLite
68 is also faster than the big database servers for most operations. In
69 addition to the C library, the SQLite distribution includes a
70 command-line tool for interacting with SQLite databases and SQLite
71 bindings for Tcl/Tk.
72
73 %description -l pl.UTF-8
74 SQLite jest biblioteką języka C, która implementuje silnik baz danych
75 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
76 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
77 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
78 danych bez konieczności utrzymywania osobnego serwera baz danych.
79 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
80 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
81 bazodanowych przy większości operacji na bazie danych. Dodatkowo
82 oprócz biblioteki języka C, dostarczany jest program do zarządzania
83 bazami danych.
84
85 %package libs
86 Summary:        Shared library for the sqlite3 embeddable SQL database engine
87 Summary(pl.UTF-8):      Biblioteka współdzielona osadzalnego silnika baz danych SQL sqlite3
88 Group:          Libraries
89 %{?with_icu:Provides:   %{name}-libs(icu) = %{version}}
90 %{?with_load_extension:Provides:        %{name}-libs(load_extension) = %{version}}
91 %{?with_unlock_notify:Provides: %{name}-libs(unlock_notify) = %{version}}
92 Conflicts:      sqlite3 < 3.23.1-2
93
94 %description libs
95 This package contains the SQLite 3 shared library.
96
97 %description libs -l pl.UTF-8
98 Ten pakiet zawiera bibliotekę współdzieloną SQLite 3.
99
100 %package devel
101 Summary:        Header files for SQLite development
102 Summary(pl.UTF-8):      Pliki nagłówkowe SQLite
103 Group:          Development/Libraries
104 Requires:       %{name}-libs = %{version}-%{release}
105 %if %{with unlock_notify}
106 Provides:       %{name}-devel(unlock_notify) = %{version}
107 %endif
108 %if %{with load_extension}
109 Provides:       %{name}-devel(load_extension) = %{version}
110 %endif
111 %if %{with icu}
112 Provides:       %{name}-devel(icu) = %{version}
113 %endif
114
115 %description devel
116 SQLite is a C library that implements an SQL database engine. A large
117 subset of SQL92 is supported. A complete database is stored in a
118 single disk file. The API is designed for convenience and ease of use.
119 Applications that link against SQLite can enjoy the power and
120 flexiblity of an SQL database without the administrative hassles of
121 supporting a separate database server. Because it omits the
122 client-server interaction overhead and writes directly to disk, SQLite
123 is also faster than the big database servers for most operations. In
124 addition to the C library, the SQLite distribution includes a
125 command-line tool for interacting with SQLite databases and SQLite
126 bindings for Tcl/Tk.
127
128 This package contains the header files needed to develop programs that
129 use these SQLite.
130
131 %description devel -l pl.UTF-8
132 SQLite jest biblioteką języka C, która implementuje silnik baz danych
133 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
134 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
135 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
136 danych bez konieczności utrzymywania osobnego serwera baz danych.
137 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
138 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
139 bazodanowych przy większości operacji na bazie danych. Dodatkowo
140 oprócz biblioteki języka C, dostarczany jest program do zarządzania
141 bazami danych.
142
143 Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów
144 używających biblioteki SQLite.
145
146 %package static
147 Summary:        Static libraries for SQLite development
148 Summary(pl.UTF-8):      Statyczne biblioteki SQLite
149 Group:          Development/Libraries
150 Requires:       %{name}-devel = %{version}-%{release}
151 %if %{with unclock_notify}
152 Provides:       %{name}-static(unlock_notify)
153 %endif
154 %if %{with load_extension}
155 Provides:       %{name}-static(load_extension)
156 %endif
157
158 %description static
159 SQLite is a C library that implements an SQL database engine. A large
160 subset of SQL92 is supported. A complete database is stored in a
161 single disk file. The API is designed for convenience and ease of use.
162 Applications that link against SQLite can enjoy the power and
163 flexiblity of an SQL database without the administrative hassles of
164 supporting a separate database server. Because it omits the
165 client-server interaction overhead and writes directly to disk, SQLite
166 is also faster than the big database servers for most operations. In
167 addition to the C library, the SQLite distribution includes a
168 command-line tool for interacting with SQLite databases and SQLite
169 bindings for Tcl/Tk.
170
171 This package contains the static SQLite libraries.
172
173 %description static -l pl.UTF-8
174 SQLite jest biblioteką języka C, która implementuje silnik baz danych
175 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
176 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
177 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
178 danych bez konieczności utrzymywania osobnego serwera baz danych.
179 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
180 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
181 bazodanowych przy większości operacji na bazie danych. Dodatkowo
182 oprócz biblioteki języka C, dostarczany jest program do zarządzania
183 bazami danych.
184
185 Pakiet zawiera statyczne biblioteki SQLite.
186
187 %package -n tcl-%{name}
188 Summary:        sqlite3 tcl extension
189 Summary(pl.UTF-8):      Rozszerzenie sqlite3 dla Tcl
190 Group:          Development/Languages/Tcl
191
192 %description -n tcl-%{name}
193 sqlite3 tcl extension.
194
195 %description -n tcl-%{name} -l pl.UTF-8
196 Rozszerzenie sqlite3 dla Tcl.
197
198 %prep
199 %setup -q -n sqlite-src-%{vnum}
200 %patch0 -p1
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 cp -f /usr/share/automake/config.sub .
212 %{__aclocal}
213 %{__autoconf} --force
214 append-cppflags() {
215         CPPFLAGS="$CPPFLAGS $*"
216 }
217 append-libs() {
218         LIBS="$LIBS $*"
219 }
220 export CPPFLAGS="%{rpmcflags}"
221 export LIBS
222 %if %{with tcl}
223 export TCLLIBDIR="%{tcl_sitearch}/sqlite3"
224 %endif
225
226 append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE
227
228 # Support for optional ORDER BY and LIMIT clause on UPDATE and DELETE statements
229 append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
230
231 # Support column metadata functions.
232 # http://sqlite.org/c3ref/column_database_name.html
233 # http://sqlite.org/c3ref/table_column_metadata.html
234 append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
235
236 # Support Full-Text Search versions 3 and 4.
237 # http://sqlite.org/fts3.html
238 #append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61
239 append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
240 append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER
241
242 # Support R*Trees.
243 # http://sqlite.org/rtree.html
244 append-cppflags -DSQLITE_ENABLE_RTREE
245
246 # Support Geopoly module (new as of 3.25.0)
247 # https://www.sqlite.org/geopoly.html
248 append-cppflags -DSQLITE_ENABLE_GEOPOLY
249
250 # Support soundex() function.
251 # http://sqlite.org/lang_corefunc.html#soundex
252 #append-cppflags -DSQLITE_SOUNDEX
253
254 # Support dbstat virtual table.
255 # https://www.sqlite.org/dbstat.html
256 append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
257
258 # Support for session extension (record changes to a changeset).
259 # https://www.sqlite.org/sessionintro.html
260 append-cppflags -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK
261
262 %if %{with unlock_notify}
263 # Support unlock notification.
264 # http://sqlite.org/unlock_notify.html
265 append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
266 %endif
267
268 %if %{with icu}
269 append-cppflags -DSQLITE_ENABLE_ICU
270 append-libs "-licui18n -licuuc"
271 %endif
272
273 %if %{with load_extension}
274 append-libs "-ldl"
275 %endif
276
277 %configure \
278         %{?with_readline:--disable-editline} \
279         %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \
280         %{__enable_disable load_extension load-extension} \
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.072575 seconds and 2 git commands to generate.