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