1 |
# bcond default logic is nicely backwards... |
2 |
%bcond_without tcl |
3 |
%bcond_with check |
4 |
|
5 |
%define realname sqlite |
6 |
%define realver 3070900 |
7 |
%define docver 3070900 |
8 |
%define rpmver %(echo %{realver}|sed -e "s/00//g" -e "s/0/./g") |
9 |
|
10 |
%define major 0 |
11 |
%define libname %mklibname %{name}_ %{major} |
12 |
%define develname %mklibname %{name} -d |
13 |
%define staticdevelname %mklibname %{name} -d -s |
14 |
|
15 |
%define subrel 1 |
16 |
|
17 |
Summary: C library that implements an embeddable SQL database engine |
18 |
Name: sqlite3 |
19 |
Version: %rpmver |
20 |
Release: %mkrel 1 |
21 |
License: Public Domain |
22 |
Group: System/Libraries |
23 |
URL: http://www.sqlite.org/ |
24 |
Source0: http://www.sqlite.org/sqlite-src-%{realver}.zip |
25 |
Source1: http://www.sqlite.org/sqlite-doc-%{docver}.zip |
26 |
# Fix build with --enable-load-extension, upstream ticket #3137 |
27 |
Patch1: sqlite-3.6.12-libdl.patch |
28 |
# Support a system-wide lemon template |
29 |
Patch2: sqlite-3.6.23-lemon-system-template.patch |
30 |
# Fixup test-suite expectations wrt SQLITE_DISABLE_DIRSYNC |
31 |
Patch3: sqlite-3.7.4-wal2-nodirsync.patch |
32 |
# Shut up stupid tests depending on system settings of allowed open fd's |
33 |
Patch4: sqlite-3.7.6-stupid-openfiles-test.patch |
34 |
BuildRequires: ncurses-devel readline-devel glibc-devel |
35 |
# libdl patch needs |
36 |
BuildRequires: autoconf |
37 |
BuildRequires: chrpath |
38 |
BuildRequires: ncurses-devel |
39 |
BuildRequires: readline-devel |
40 |
%if %{with tcl} |
41 |
BuildRequires: tcl |
42 |
BuildRequires: tcl-devel |
43 |
%{!?tcl_version: %global tcl_version 8.5.10} |
44 |
%{!?tcl_sitearch: %global tcl_sitearch %{_libdir}/tcl%{tcl_version}} |
45 |
%endif |
46 |
|
47 |
%description |
48 |
SQLite is a C library that implements an embeddable SQL database |
49 |
engine. Programs that link with the SQLite library can have SQL |
50 |
database access without running a separate RDBMS process. The |
51 |
distribution comes with a standalone command-line access program |
52 |
(sqlite) that can be used to administer an SQLite database and |
53 |
which serves as an example of how to use the SQLite library. |
54 |
|
55 |
%package -n %{libname} |
56 |
Summary: C library that implements an embeddable SQL database engine |
57 |
Group: System/Libraries |
58 |
|
59 |
%description -n %{libname} |
60 |
SQLite is a C library that implements an embeddable SQL database |
61 |
engine. Programs that link with the SQLite library can have SQL |
62 |
database access without running a separate RDBMS process. The |
63 |
distribution comes with a standalone command-line access program |
64 |
(sqlite) that can be used to administer an SQLite database and |
65 |
which serves as an example of how to use the SQLite library. |
66 |
|
67 |
This package contains the shared libraries for %{name} |
68 |
|
69 |
%package -n %{develname} |
70 |
Summary: Development library and header files for the %{name} library |
71 |
Group: Development/C |
72 |
Requires: %{libname} = %{version}-%{release} |
73 |
Provides: lib%{name}-devel = %{version}-%{release} |
74 |
Provides: %{name}-devel = %{version}-%{release} |
75 |
Obsoletes: %mklibname %{name}_ %{major} -d |
76 |
|
77 |
%description -n %{develname} |
78 |
SQLite is a C library that implements an embeddable SQL database |
79 |
engine. Programs that link with the SQLite library can have SQL |
80 |
database access without running a separate RDBMS process. The |
81 |
distribution comes with a standalone command-line access program |
82 |
(sqlite) that can be used to administer an SQLite database and |
83 |
which serves as an example of how to use the SQLite library. |
84 |
|
85 |
This package contains the static %{libname} library and its header |
86 |
files. |
87 |
|
88 |
%package -n %{staticdevelname} |
89 |
Summary: Static development library for the %{name} library |
90 |
Group: Development/C |
91 |
Requires: %{develname} = %{version}-%{release} |
92 |
Provides: lib%{name}-static-devel = %{version}-%{release} |
93 |
Provides: %{name}-static-devel = %{version}-%{release} |
94 |
Obsoletes: %mklibname %{name}_ %{major} -d -s |
95 |
|
96 |
%description -n %{staticdevelname} |
97 |
SQLite is a C library that implements an embeddable SQL database |
98 |
engine. Programs that link with the SQLite library can have SQL |
99 |
database access without running a separate RDBMS process. The |
100 |
distribution comes with a standalone command-line access program |
101 |
(sqlite) that can be used to administer an SQLite database and |
102 |
which serves as an example of how to use the SQLite library. |
103 |
|
104 |
This package contains the static %{libname} library. |
105 |
|
106 |
%package tools |
107 |
Summary: Command line tools for managing the %{libname} library |
108 |
Group: Databases |
109 |
Requires: %{libname} = %{version}-%{release} |
110 |
|
111 |
%description tools |
112 |
SQLite is a C library that implements an embeddable SQL database |
113 |
engine. Programs that link with the SQLite library can have SQL |
114 |
database access without running a separate RDBMS process. The |
115 |
distribution comes with a standalone command-line access program |
116 |
(sqlite) that can be used to administer an SQLite database and |
117 |
which serves as an example of how to use the SQLite library. |
118 |
|
119 |
This package contains command line tools for managing the |
120 |
%{libname} library. |
121 |
|
122 |
%package -n lemon |
123 |
Summary: A parser generator |
124 |
Group: Databases |
125 |
|
126 |
%description -n lemon |
127 |
Lemon is an LALR(1) parser generator for C or C++. It does the same |
128 |
job as bison and yacc. But lemon is not another bison or yacc |
129 |
clone. It uses a different grammar syntax which is designed to reduce |
130 |
the number of coding errors. Lemon also uses a more sophisticated |
131 |
parsing engine that is faster than yacc and bison and which is both |
132 |
reentrant and thread-safe. Furthermore, Lemon implements features |
133 |
that can be used to eliminate resource leaks, making is suitable for |
134 |
use in long-running programs such as graphical user interfaces or |
135 |
embedded controllers. |
136 |
|
137 |
%if %{with tcl} |
138 |
%package tcl |
139 |
Summary: Tcl module for the sqlite3 embeddable SQL database engine |
140 |
Group: Development/Other |
141 |
Requires: %{name}-tools = %{version}-%{release} |
142 |
Requires: tcl >= 1:%{tcl_version} |
143 |
Obsoletes: tcl-sqlite3 < %{version} |
144 |
Provides: tcl-sqlite3 = %{version}-%{release} |
145 |
|
146 |
%description tcl |
147 |
This package contains the tcl modules for %{name}. |
148 |
%endif |
149 |
|
150 |
%prep |
151 |
%setup -q -a1 -n %{realname}-src-%{realver} |
152 |
#%patch1 -p1 -b .libdl |
153 |
%patch2 -p1 -b .lemon-system-template |
154 |
%patch3 -p1 -b .wal2-nodirsync |
155 |
#%patch4 -p1 -b .stupid-openfiles-test |
156 |
|
157 |
# Remove cgi-script erroneously included in sqlite-doc-3070500 |
158 |
rm -f %{name}-doc-%{realver}/search |
159 |
|
160 |
%build |
161 |
autoreconf -fi |
162 |
export CFLAGS="$RPM_OPT_FLAGS -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -Wall -fno-strict-aliasing" |
163 |
%configure %{!?with_tcl:--disable-tcl} \ |
164 |
--enable-threadsafe \ |
165 |
--enable-threads-override-locks \ |
166 |
--enable-load-extension \ |
167 |
%{?with_tcl:TCLLIBDIR=%{tcl_sitearch}/sqlite3} |
168 |
|
169 |
# rpath removal |
170 |
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool |
171 |
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool |
172 |
%make |
173 |
|
174 |
%install |
175 |
rm -rf %{buildroot} |
176 |
|
177 |
install -d %{buildroot}%{_bindir} |
178 |
install -d %{buildroot}%{_includedir} |
179 |
install -d %{buildroot}%{_libdir} |
180 |
install -d %{buildroot}%{_mandir}/man1 |
181 |
|
182 |
make DESTDIR=${RPM_BUILD_ROOT} install |
183 |
|
184 |
install -D -m0644 sqlite3.1 $RPM_BUILD_ROOT/%{_mandir}/man1/sqlite3.1 |
185 |
install -D -m0755 lemon $RPM_BUILD_ROOT/%{_bindir}/lemon |
186 |
install -D -m0644 tool/lempar.c $RPM_BUILD_ROOT/%{_datadir}/lemon/lempar.c |
187 |
|
188 |
%if %{with tcl} |
189 |
# fix up permissions to enable dep extraction |
190 |
chmod 0755 ${RPM_BUILD_ROOT}/%{tcl_sitearch}/sqlite3/*.so |
191 |
%endif |
192 |
|
193 |
%makeinstall_std |
194 |
|
195 |
chrpath -d %{buildroot}%{_bindir}/* |
196 |
|
197 |
%if %{with check} |
198 |
%check |
199 |
make test |
200 |
%endif |
201 |
|
202 |
%clean |
203 |
rm -rf %{buildroot} |
204 |
|
205 |
%files -n %{libname} |
206 |
%defattr(-,root,root) |
207 |
%{_libdir}/lib*.so.%{major}* |
208 |
|
209 |
%files -n %{develname} |
210 |
%defattr(-,root,root) |
211 |
%attr(0644,root,root) %{_includedir}/*.h |
212 |
%{_libdir}/lib*.la |
213 |
%{_libdir}/lib*.so |
214 |
%attr(0644,root,root) %{_libdir}/pkgconfig/*.pc |
215 |
|
216 |
%files -n %{staticdevelname} |
217 |
%defattr(-,root,root) |
218 |
%{_libdir}/lib*.a |
219 |
|
220 |
%files tools |
221 |
%defattr(-,root,root) |
222 |
%{_bindir}/sqlite3 |
223 |
%{_mandir}/man1/* |
224 |
|
225 |
%files -n lemon |
226 |
%defattr(-, root, root) |
227 |
%{_bindir}/lemon |
228 |
%{_datadir}/lemon |
229 |
|
230 |
%if %{with tcl} |
231 |
%files tcl |
232 |
%defattr(-, root, root) |
233 |
%{tcl_sitearch}/sqlite3 |
234 |
%endif |