summaryrefslogtreecommitdiff
path: root/sqlite.spec
blob: fe6c03440e6751712f759253b8da8345cdd728f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
%bcond_without check

Name:    sqlite
Version: 3.47.0
%global extver %(echo %{version} |awk -F. '{printf "%d%02d%02d00", $1,$2,$3}')
Release: 1
Summary: Embeded SQL database
License: Public Domain
URL:     http://www.sqlite.org/

Source0: https://www.sqlite.org/2024/sqlite-src-%{extver}.zip
Source1: http://www.sqlite.org/2024/sqlite-doc-%{extver}.zip
Source2: https://www.sqlite.org/2024/sqlite-autoconf-%{extver}.tar.gz
Patch0:  sqlite-drop-tcl-at-sign.patch
Patch1:  sqlite-Add-DESTDIR-support-to-the-tclextension-install-target.patch

BuildRequires: gcc autoconf tcl tcl-devel
BuildRequires: ncurses-devel readline-devel glibc-devel
BuildRequires: rpm_macro(tcl_sitearch)

Provides:  %{name}-libs = %{version}-%{release}
Obsoletes: %{name}-libs < %{version}-%{release}
Provides:  lemon = %{version}-%{release}
Obsoletes: lemon < %{version}-%{release}
Provides:  %{name}-analyzer = %{version}-%{release}
Obsoletes: %{name}-analyzer < %{version}-%{release}
Provides:  %{name}-tcl = %{version}-%{release}
Obsoletes: %{name}-tcl < %{version}-%{release}

%description
SQLite is a C-language library that implements a small, fast, self-contained,
high-reliability, full-featured, SQL database engine. SQLite is the most used
database engine in the world. SQLite is built into all mobile phones and most
computers and comes bundled inside countless other applications that people
use every day.It also include lemon and sqlite3_analyzer and tcl tools.

%package devel
Summary:  Including header files and library for the developing of sqlite
Requires: %{name}%{?_isa} = %{version}-%{release}

%description devel
This contains dynamic libraries and header files for the developing of sqlite.

%package help
Summary:   Man file and documentation for sqlite
BuildArch: noarch
Provides:  %{name}-doc = %{version}-%{release}
Obsoletes: %{name}-doc < %{version}-%{release}

%description help
This contains man files and HTML files for the using of sqlite.


%prep
#autosetup will fail because of 2 zip files
%setup -q -a1 -n %{name}-src-%{extver}
%autopatch -p0

rm -f %{name}-doc-%{extver}/sqlite.css~ || :

%build

autoconf
export CFLAGS="$RPM_OPT_FLAGS $RPM_LD_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 -DSQLITE_ENABLE_DBSTAT_VTAB=1 \
               -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 -DSQLITE_ENABLE_JSON1=1 \
               -Wall -fno-strict-aliasing"

%configure --enable-fts5 \
           --enable-threadsafe \
           --enable-load-extension \
	   --disable-static \
           TCLLIBDIR=%{tcl_sitearch}/sqlite3

# rpath removal
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

%make_build

%make_build sqlite3_analyzer

%install
mkdir -p %{buildroot}/%{tcl_sitearch}/sqlite3
%make_install
%delete_la

install -D -m 755 lemon %{buildroot}%{_bindir}/lemon
install -D -m 644 tool/lempar.c %{buildroot}%{_datadir}/lemon/lempar.c
install -D -m 644 sqlite3.1 %{buildroot}%{_mandir}/man1/sqlite3.1
install -D -m 755 sqlite3_analyzer %{buildroot}%{_bindir}/sqlite3_analyzer
chmod 755 %{buildroot}/%{tcl_sitearch}/sqlite3/*.so


%if %{with check}
%check
export LD_LIBRARY_PATH=`pwd`/.libs
export MALLOC_CHECK_=3

%ifarch x86_64 %{ix86}
%else
rm test/csv01.test
%endif
%ifarch loongarch64
rm -rf test/thread1.test
rm -rf test/thread2.test
%endif

%make_build test
%endif # with check

%files
%doc README.md
%{_bindir}/{sqlite3,lemon,sqlite3_analyzer}
%{_libdir}/*.so.*
%{_datadir}/lemon
%{tcl_sitearch}/sqlite3

%files devel
%{_includedir}/*.h
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc

%files help
%doc %{name}-doc-%{extver}/*
%{_mandir}/man*/*

%changelog
* Tue Oct 22 2024 Funda Wang <fundawang@yeah.net> - 3.47.0-1
- update to 3.47.0

* Tue Aug 13 2024 Funda Wang <fundawang@yeah.net> - 3.46.1-1
- update to 3.46.1

* Tue Feb 27 2024 Zheng Zhenyu <zheng.zhenyu@outlook.com> - 3.42.0-1
- Bump version to fix CVE-2024-0232

* Wed Jan 3 2024 mazhao <mazhao12@huawei.com> - 3.37.2-7
- fix the CVE-2023-7104

* Mon Aug 7 2023 zhuwentao <zhuwentao5@huawei.com> - 3.37.2-6
- fix the CVE-2023-36191

* Fri Jan 13 2023 Wenlong Zhang<zhangwenlong@loongson.cn> - 3.37.2-5
- remove fail testcase for loongarch

* Wed Dec 14 2022 zhuwentao <zhuwentao5@huawei.com> - 3.37.2-4
- fix the CVE-2022-46908

* Wed Sep 14 2022 zhuwentao <zhuwentao5@huawei.com> - 3.37.2-3
- fix build problem

* Mon Sep 5 2022 zhuwentao <zhuwentao5@huawei.com> - 3.37.2-2
- fix integer overflow on gigabyte string

* Mon Aug 29 2022 zhuwentao <zhuwentao5@huawei.com> - 3.37.2-1
- update to 3.37.2

* Tue Aug 16 2022 liusirui <liusirui@huawei.com> - 3.36.0-3
- fix the CVE-2022-35737.

* Sat Nov 27 2021 wbq_sky <wangbingquan@huawei.com> - 3.36.0-2
- fix the CVE-2021-36690.

* Fri Nov 25 2021 wbq_sky <wangbingquan@huawei.com> - 3.36.0-1
- update to 3.36.0.

* Fri Sep 26 2021 wbq_sky <wangbingquan@huawei.com> - 3.34.0-4
- fix the uninitialized value used in pattern match.

* Fri Sep 3 2021 wbq_sky <wangbingquan@huawei.com> - 3.34.0-3
- fix the null reference in the tigger statement.

* Fri Sep 3 2021 wbq_sky <wangbingquan@huawei.com> - 3.34.0-2
- fix the infinite loop problem in the trim function while the pattern is well formed.

* Thu Jan 14 2021 yanglongkang <yanglongkang@huawei.com> - 3.34.0-1
- update package to 3.34.0

* Thu Sep 3 2020 lihaotian<lihaotian9@huawei.com> - 3.32.3-3
- update source0 url

* Tue Jul 21 2020 jixinjie <jixinjie@huawei.com> - 3.32.3-2
- update yaml file

* Tue Jul 21 2020 jixinjie <jixinjie@huawei.com> - 3.32.3-1
- update package to 3.32.3

* Tue Jun 30 2020 volcanodragon <linfeilong@huawei.com> - 3.24.0-12
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:rename patches

* Tue Jun 23 2020 yanglongkang <yanglongkang@huawei.com> - 3.24.0-11
- Type:cves
- ID:CVE-2020-13434 CVE-2020-13435 CVE-2020-13630 CVE-2020-13632
- SUG:NA
- DESC:fix CVE-2020-13434 CVE-2020-13435 CVE-2020-13630 CVE-2020-13632

* Sun Apr 19 2020 ethan848 <mingfangsen@huawei.com>
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:CVE-2020-11655 fixed

* Tue Mar 10 2020 steven <steven_ygui@163.com> - 3.24.0-9
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:CVE-2018-20505, CVE-2020-9327 fixed

* Wed Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 3.24.0-8
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:CVE-2019-19959 fixed

* Wed Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 3.24.0-7
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:Fix CVE-2019-19923 CVE-2019-19924 CVE-2019-19925 CVE-2019-19926 CVE-2019-20218

* Fri Jan 3 2020 openEuler Buildteam <buildteam@openeuler.org> - 3.24.0-6
- Type:cves
- ID:CVE-2019-9936,CVE-2019-9937
- SUG:NA
- DESC:fix cve

* Sat Dec 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.24.0-5
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix CVE bug

* Wed Sep 11 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.24.0-4
- Type:enhancemnet
- ID:NA
- SUG:NA
- DESC:remove debuginfo

* Wed Aug 28 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.24.0-3
- Type:enhancemnet
- ID:NA
- SUG:restart
- DESC:openEuler Debranding

* Tue Aug 20 2019 wubo<wubo40@huawei.com> - 3.24.0-2.h4
- Type:
- ID:
- SUG:NA
- DESC:rename patch

* Thu Aug 15 2019 wubo<wubo40@huawei.com> - 3.24.0-2.h3
- Type:bugfix
- ID:CVE-2019-8457
- SUG:NA
- DESC:heap out-of-bound read in function rtreenode()

* Sat Mar 23 2019 Xiaoqi Guo<guoxiaoqi2@huawei.com> - 3.24.0-2.h2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:backport patch from community

* Sat Mar 23 2019 luochunsheng<luochunsheng@huawei.com> - 3.24.0-2.h1
- Type:cves
- ID:CVE-2018-20346
- SUG:NA
- DESC:CVE-2018-20346
- Package init