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