]> git.pld-linux.org Git - packages/sqlite3.git/blob - sqlite3.spec
up to 3.17.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 # - configure.ac present, but doesn't support all -DEFINES, also it uses bash syntax (var+=value)
5 #
6 # Conditional build:
7 %bcond_with     tests           # run tests
8 %bcond_without  tcl             # Tcl extension
9 %bcond_without  doc             # disable documentation building
10 %bcond_without  unlock_notify   # disable unlock notify API
11 %bcond_without  load_extension  # enable load extension API
12 %bcond_with     icu             # ICU tokenizer support
13
14 %ifarch alpha sparc %{x8664}
15 %undefine       with_tests
16 %endif
17
18 # disabling tcl currently breaks making test target,
19 # some hack in Makefile needs to be done
20 %if %{without tcl}
21 %undefine       with_tests
22 %endif
23
24 # sqlite3 version with zero padded without any dots (3 08 10 01 is 3.8.10.1)
25 # but trailing 00 means no 4rd part (3 11 01 00 is 3.11.1)
26 %define         vnum    3170000
27 %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)}
28
29 %define         tclver          8.6
30 Summary:        SQLite3 library
31 Summary(pl.UTF-8):      Biblioteka SQLite3
32 Name:           sqlite3
33 Version:        %{ver}
34 Release:        1
35 License:        Public Domain
36 Group:          Libraries
37 # Source0Download: http://www.sqlite.org/download.html
38 Source0:        http://www.sqlite.org/2017/sqlite-src-%{vnum}.zip
39 # Source0-md5:  b5663cdf2105d6493d17d89e1868a31f
40 Patch0:         %{name}-sign-function.patch
41 URL:            http://www.sqlite.org/
42 %{?with_load_extension:Provides:        %{name}(load_extension)}
43 %{?with_unlock_notify:Provides: %{name}(unlock_notify)}
44 %{?with_icu:Provides:   %{name}(icu)}
45 BuildRequires:  autoconf >= 2.50
46 BuildRequires:  automake
47 BuildRequires:  libtool
48 BuildRequires:  readline-devel
49 %{?with_load_extension:BuildRequires:   sed >= 4.0}
50 BuildRequires:  tcl
51 %{?with_tcl:BuildRequires:      tcl-devel >= %{tclver}}
52 BuildRequires:  unzip
53 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54
55 %define         _ulibdir        /usr/lib
56
57 %description
58 SQLite is a C library that implements an SQL database engine. A large
59 subset of SQL92 is supported. A complete database is stored in a
60 single disk file. The API is designed for convenience and ease of use.
61 Applications that link against SQLite can enjoy the power and
62 flexiblity of an SQL database without the administrative hassles of
63 supporting a separate database server. Because it omits the
64 client-server interaction overhead and writes directly to disk, SQLite
65 is also faster than the big database servers for most operations. In
66 addition to the C library, the SQLite distribution includes a
67 command-line tool for interacting with SQLite databases and SQLite
68 bindings for Tcl/Tk.
69
70 %description -l pl.UTF-8
71 SQLite jest biblioteką języka C, która implementuje silnik baz danych
72 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
73 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
74 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
75 danych bez konieczności utrzymywania osobnego serwera baz danych.
76 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
77 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
78 bazodanowych przy większości operacji na bazie danych. Dodatkowo
79 oprócz biblioteki języka C, dostarczany jest program do zarządzania
80 bazami danych.
81
82 %package devel
83 Summary:        Header files for SQLite development
84 Summary(pl.UTF-8):      Pliki nagłówkowe SQLite
85 Group:          Development/Libraries
86 Requires:       %{name} = %{version}-%{release}
87 %if %{with unlock_notify}
88 Provides:       %{name}-devel(unlock_notify)
89 %endif
90 %if %{with load_extension}
91 Provides:       %{name}-devel(load_extension)
92 %endif
93 %if %{with icu}
94 Provides:       %{name}-devel(icu)
95 %endif
96
97 %description devel
98 SQLite is a C library that implements an SQL database engine. A large
99 subset of SQL92 is supported. A complete database is stored in a
100 single disk file. The API is designed for convenience and ease of use.
101 Applications that link against SQLite can enjoy the power and
102 flexiblity of an SQL database without the administrative hassles of
103 supporting a separate database server. Because it omits the
104 client-server interaction overhead and writes directly to disk, SQLite
105 is also faster than the big database servers for most operations. In
106 addition to the C library, the SQLite distribution includes a
107 command-line tool for interacting with SQLite databases and SQLite
108 bindings for Tcl/Tk.
109
110 This package contains the header files needed to develop programs that
111 use these SQLite.
112
113 %description devel -l pl.UTF-8
114 SQLite jest biblioteką języka C, która implementuje silnik baz danych
115 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
116 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
117 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
118 danych bez konieczności utrzymywania osobnego serwera baz danych.
119 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
120 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
121 bazodanowych przy większości operacji na bazie danych. Dodatkowo
122 oprócz biblioteki języka C, dostarczany jest program do zarządzania
123 bazami danych.
124
125 Pakiet zawiera pliki nagówkowe niezbedne do kompilowania programów
126 używających biblioteki SQLite.
127
128 %package static
129 Summary:        Static libraries for SQLite development
130 Summary(pl.UTF-8):      Statyczne biblioteki SQLite
131 Group:          Development/Libraries
132 Requires:       %{name}-devel = %{version}-%{release}
133 %if %{with unclock_notify}
134 Provides:       %{name}-static(unlock_notify)
135 %endif
136 %if %{with load_extension}
137 Provides:       %{name}-static(load_extension)
138 %endif
139
140 %description static
141 SQLite is a C library that implements an SQL database engine. A large
142 subset of SQL92 is supported. A complete database is stored in a
143 single disk file. The API is designed for convenience and ease of use.
144 Applications that link against SQLite can enjoy the power and
145 flexiblity of an SQL database without the administrative hassles of
146 supporting a separate database server. Because it omits the
147 client-server interaction overhead and writes directly to disk, SQLite
148 is also faster than the big database servers for most operations. In
149 addition to the C library, the SQLite distribution includes a
150 command-line tool for interacting with SQLite databases and SQLite
151 bindings for Tcl/Tk.
152
153 This package contains the static SQLite libraries.
154
155 %description static -l pl.UTF-8
156 SQLite jest biblioteką języka C, która implementuje silnik baz danych
157 SQL (obsługiwana jest większość standardu SQL92). Cała baza danych
158 przechowywana jest w jednym pliku. Aplikacje wykorzystujące tę
159 bibliotekę charakteryzują się siłą i elastycznością SQLowych baz
160 danych bez konieczności utrzymywania osobnego serwera baz danych.
161 Ponieważ pomijana jest komunikacja klient-serwer i dane są zapisywane
162 bezpośrednio na dysku, SQLite jest szybsza od dużych serwerów
163 bazodanowych przy większości operacji na bazie danych. Dodatkowo
164 oprócz biblioteki języka C, dostarczany jest program do zarządzania
165 bazami danych.
166
167 Pakiet zawiera statyczne biblioteki SQLite.
168
169 %package -n tcl-%{name}
170 Summary:        sqlite3 tcl extension
171 Summary(pl.UTF-8):      Rozszerzenie sqlite3 dla Tcl
172 Group:          Development/Languages/Tcl
173
174 %description -n tcl-%{name}
175 sqlite3 tcl extension.
176
177 %description -n tcl-%{name} -l pl.UTF-8
178 Rozszerzenie sqlite3 dla Tcl.
179
180 %prep
181 %setup -q -n sqlite-src-%{vnum}
182 %patch0 -p1
183
184 %{__sed} -i 's/mkdir doc/#mkdir doc/' Makefile.in
185
186 if [ "$(cat VERSION)" != "%{version}" ]; then
187         echo "Tarball content doesn't match version %{version}." >&2
188         exit 1
189 fi
190
191 %build
192 %{__libtoolize}
193 cp -f /usr/share/automake/config.sub .
194 %{__aclocal}
195 %{__autoconf} --force
196 append-cppflags() {
197         CPPFLAGS="$CPPFLAGS $*"
198 }
199 append-libs() {
200         LIBS="$LIBS $*"
201 }
202 export CPPFLAGS="%{rpmcflags}"
203 export LIBS
204 %if %{with tcl}
205 export TCLLIBDIR="%{tcl_sitearch}/sqlite3"
206 %endif
207
208 append-cppflags -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE
209
210 # Support column metadata functions.
211 # http://sqlite.org/c3ref/column_database_name.html
212 # http://sqlite.org/c3ref/table_column_metadata.html
213 append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
214
215 # Support Full-Text Search versions 3 and 4.
216 # http://sqlite.org/fts3.html
217 #append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61
218 append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
219 append-cppflags -DSQLITE_ENABLE_FTS3_TOKENIZER
220
221 # Support R*Trees.
222 # http://sqlite.org/rtree.html
223 append-cppflags -DSQLITE_ENABLE_RTREE
224
225 # Support soundex() function.
226 # http://sqlite.org/lang_corefunc.html#soundex
227 #append-cppflags -DSQLITE_SOUNDEX
228
229 # Support dbstat virtual table.
230 # https://www.sqlite.org/dbstat.html
231 append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
232
233 %if %{with unlock_notify}
234 # Support unlock notification.
235 # http://sqlite.org/unlock_notify.html
236 append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
237 %endif
238
239 %if %{with icu}
240 append-cppflags -DSQLITE_ENABLE_ICU
241 append-libs "-licui18n -licuuc"
242 %endif
243
244 %if %{with load_extension}
245 append-libs "-ldl"
246 %endif
247
248 %configure \
249         %{!?with_tcl:--disable-tcl}%{?with_tcl:--with-tcl=%{_ulibdir}} \
250         %{__enable_disable load_extension load-extension} \
251         --enable-threadsafe
252
253 %{__make}
254
255 %if %{with doc}
256 %{__make} doc
257 %endif
258
259 %{?with_tests:LC_ALL=C %{__make} test}
260
261 %install
262 rm -rf $RPM_BUILD_ROOT
263 install -d $RPM_BUILD_ROOT{/%{_lib},%{_bindir},%{_includedir},%{_libdir},%{_mandir}/man1}
264 %{__make} install \
265         DESTDIR=$RPM_BUILD_ROOT
266
267 mv -f $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
268 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.so
269 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib}; echo lib*.so.*.*) \
270         $RPM_BUILD_ROOT%{_libdir}/libsqlite3.so
271
272 cp -p sqlite3.1 $RPM_BUILD_ROOT%{_mandir}/man1
273
274 %clean
275 rm -rf $RPM_BUILD_ROOT
276
277 %post   -p /sbin/ldconfig
278 %postun -p /sbin/ldconfig
279
280 %files
281 %defattr(644,root,root,755)
282 %doc README.md
283 %attr(755,root,root) %{_bindir}/sqlite3
284 %attr(755,root,root) /%{_lib}/libsqlite3.so.*.*.*
285 %attr(755,root,root) %ghost /%{_lib}/libsqlite3.so.0
286 %{_mandir}/man1/sqlite3.1*
287
288 %files devel
289 %defattr(644,root,root,755)
290 %attr(755,root,root) %{_libdir}/libsqlite3.so
291 %{_libdir}/libsqlite3.la
292 %{_includedir}/sqlite3.h
293 %{_includedir}/sqlite3ext.h
294 %{_pkgconfigdir}/sqlite3.pc
295
296 %files static
297 %defattr(644,root,root,755)
298 %{_libdir}/libsqlite3.a
299
300 %if %{with tcl}
301 %files -n tcl-%{name}
302 %defattr(644,root,root,755)
303 %dir %{_libdir}/tcl*/sqlite3
304 %attr(755,root,root) %{_libdir}/tcl%{tclver}/sqlite3/libtclsqlite3.so
305 %{_libdir}/tcl%{tclver}/sqlite3/pkgIndex.tcl
306 %endif
This page took 0.207458 seconds and 4 git commands to generate.