sqlite/sqlite.spec

264 lines
6.5 KiB
RPMSpec
Raw Normal View History

2019-09-30 11:17:27 -04:00
%bcond_without check
%global extver 3320300
2019-09-30 11:17:27 -04:00
%global tcl_version 8.6
%global tcl_sitearch %{_libdir}/tcl%{tcl_version}
2020-05-12 23:06:17 +08:00
%global year 2020
2019-09-30 11:17:27 -04:00
Name: sqlite
Version: 3.32.3
Release: 7
2019-09-30 11:17:27 -04:00
Summary: Embeded SQL database
License: Public Domain
URL: http://www.sqlite.org/
2020-09-03 14:19:35 +08:00
Source0: https://www.sqlite.org/%{year}/sqlite-src-%{extver}.zip
2020-05-12 23:06:17 +08:00
Source1: http://www.sqlite.org/%{year}/sqlite-doc-%{extver}.zip
Source2: https://www.sqlite.org/%{year}/sqlite-autoconf-%{extver}.tar.gz
2019-09-30 11:17:27 -04:00
Patch1: 0001-sqlite-no-malloc-usable-size.patch
Patch2: 0002-remove-fail-testcase-in-no-free-fd-situation.patch
Patch3: CVE-2021-20227.patch
2022-08-16 14:44:18 +08:00
Patch4: 0004-CVE-2022-35737.patch
Patch5: 0005-CVE-2021-20223.patch
Patch6: 0006-fix-integer-overflow-on-gigabyte-string.patch
Patch7: 0007-CVE-2023-7104.patch
2019-09-30 11:17:27 -04:00
BuildRequires: gcc autoconf tcl tcl-devel
BuildRequires: ncurses-devel readline-devel glibc-devel
Provides: %{name}-libs
Obsoletes: %{name}-libs
Provides: lemon
Obsoletes: lemon
Provides: %{name}-analyzer
Obsoletes: %{name}-analyzer
Provides: %{name}-tcl
Obsoletes: %{name}-tcl
%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}
Requires: pkgconfig
%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
Obsoletes: %{name}-doc
%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}
%patch1 -p1
%patch2 -p1
%patch3 -p1
2022-08-16 14:44:18 +08:00
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
2019-09-30 11:17:27 -04:00
rm -f %{name}-doc-%{extver}/sqlite.css~ || :
autoconf
%build
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-threads-override-locks \
--enable-load-extension \
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
make DESTDIR=${RPM_BUILD_ROOT} install
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
2020-05-12 23:06:17 +08:00
#bypass zipfile.test
rm test/zipfile.test
2019-09-30 11:17:27 -04:00
%ifarch x86_64 %{ix86}
%else
rm test/csv01.test
%endif
make test
%endif # with check
%ldconfig_scriptlets
%files
%doc README.md
%{_bindir}/{sqlite3,lemon,sqlite3_analyzer}
%{_libdir}/*.so.*
%{_datadir}/lemon
%{tcl_sitearch}/sqlite3
%exclude %{_libdir}/*.{la,a}
%files devel
%{_includedir}/*.h
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%files help
%doc %{name}-doc-%{extver}/*
%{_mandir}/man*/*
%changelog
* Wed Jan 3 2024 mazhao <mazhao12@huawei.com> - 3.32.3-7
- fix the CVE-2023-7104
* Tue Sep 6 2022 zhuwentao <zhuwentao5@huawei.com> - 3.32.3-6
- fix integer overflow on gigabyte string
* Wed Aug 31 2022 wbq_sky<wangbingquan@huawei.com> - 3.32.3-5
- Fix CVE-2021-20223
2022-08-16 14:44:18 +08:00
* Tue Aug 16 2022 liusirui<liusirui@huawei.com> - 3.32.3-4
- Fix CVE-2022-35737
* Mon Apr 26 2021 bzhaoop<bzhaojyathousandy@gmail.com> - 3.32.3-3
- Fix CVE-2021-20227
2022-05-07 17:27:54 +08:00
* Thu Sep 3 2020 lihaotian<lihaotian9@huawei.com> - 3.32.3-2
2020-09-03 14:19:35 +08:00
- update source0 url
* Tue Aug 25 2020 yanglongkang <yanglongkang@huawei.com> - 3.32.3-1
- update package to 3.32.3
2020-08-04 15:14:29 +08:00
* Tue Aug 4 2020 yanglongkang <yanglongkang@huawei.com> - 3.31.1-2
- Type:cves
- ID:CVE-2020-13871
- SUG: NA
- DESC: fix cve
2020-08-03 17:52:05 +08:00
* Mon Aug 3 2020 yanglongkang <yanglongkang@huawei.com> - 3.31.1-1
- Type:cves
2020-08-04 15:14:29 +08:00
- ID:CVE-2020-15358 CVE-2020-13631
2020-08-03 17:52:05 +08:00
- SUG: NA
- DESC: fix cve
2020-05-12 23:06:17 +08:00
* Fri Apr 17 2020 luoshijie <luoshijie1@huawei.com> - 3.31.1-0
2020-04-18 18:50:16 +08:00
- Type:enhancement
- ID:NA
2020-05-12 23:06:17 +08:00
- SUG:restart
- DESC:update sqlite to 3.31.1.
* Tue Mar 10 2020 guiyao <guiyao@huawei.com> - 3.24.0-11
- Type:cves
- ID:CVE-2020-9327
- SUG: NA
- DESC: fix cve
2020-04-18 18:50:16 +08:00
2020-05-12 23:06:17 +08:00
* Fri Feb 28 2020 sunshihao <sunshihao@huawei.com> - 3.24.0-10
2020-03-10 17:39:01 +08:00
- Type:enhancement
2020-05-12 23:06:17 +08:00
- ID:
- SUG: NA
- DESC: remove suffix information
* Wed Feb 26 2020 guiyao <guiyao@huawei.com> - 3.24.0-9
- Type:cves
- ID:CVE-2018-20505
2020-03-10 17:39:01 +08:00
- SUG:NA
2020-05-12 23:06:17 +08:00
- DESC:fix cves
2020-03-10 17:39:01 +08:00
2022-05-07 17:27:54 +08:00
* Sat Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 3.24.0-8
2020-01-20 10:07:09 +08:00
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:CVE-2019-19959 fixed
2022-05-07 17:27:54 +08:00
* Sat Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 3.24.0-7
2020-01-08 10:32:47 +08:00
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:Fix CVE-2019-19923 CVE-2019-19924 CVE-2019-19925 CVE-2019-19926 CVE-2019-20218
2020-01-03 23:06:59 +08:00
* Fri Jan 3 2020 openEuler Buildteam <buildteam@openeuler.org> - 3.24.0-6
2020-01-03 22:54:16 +08:00
- Type:cves
- ID:CVE-2019-9936,CVE-2019-9937
- SUG:NA
- DESC:fix cve
2019-12-25 16:07:59 +08:00
* Sat Dec 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.24.0-5
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix CVE bug
2019-09-30 11:17:27 -04:00
* 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