json-c/json-c.spec
2025-03-19 11:32:18 +08:00

155 lines
4.2 KiB
RPMSpec

%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}}
%global so_ver 5
%global reldate 20200726
Name: json-c
Version: 0.15
Release: 7
Summary: JSON implementation in C
License: MIT
URL: https://github.com/%{name}/%{name}
Source0: %{url}/archive/%{name}-%{version}-%{reldate}.tar.gz
BuildRequires: cmake gcc ninja-build
Patch6000: backport-json-escape-str-avoid-harmless-unsigned-integer-overflow.patch
Patch6001: backport-CVE-2021-32292-Fix-read-past-end-of-buffer.patch
Patch6002: backport-Handle-yet-another-out-of-memory-condition.patch
Patch6003: backport-Fix-issue-854-Set-error-json_tokener_error_memory-in.patch
Patch6004: backport-Issue-857-fix-a-few-places-where-json_tokener-should.patch
Patch6005: backport-Handle-NULL-gracefully-in-json_tokener_free.patch
Patch6006: backport-Issue-881-don-t-allow-json_tokener_new_ex-with-a-dep.patch
%description
JSON-C implements a reference counting object model that allows you
to easily construct JSON objects in C, output them as JSON formatted
strings and parse JSON formatted strings back into the C representation
of JSON objects. It aims to conform to RFC 7159.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} == %{version}-%{release}
%description devel
This package contains libraries and header files for
developing applications that use %{name}.
%package help
Summary: Reference manual for json-c
BuildArch: noarch
BuildRequires: doxygen hardlink
Provides: %{name}-doc = %{version}-%{release}
Obsoletes: %{name}-doc = %{version}-%{release}
%description help
This package contains the reference manual for %{name}.
%prep
%autosetup -n %{name}-%{name}-%{version}-%{reldate} -p 1
# Remove pre-built html documentation.
rm -fr doc/html
# Update Doxyfile.
doxygen -s -u doc/Doxyfile.in
%build
%cmake \
-DBUILD_STATIC_LIBS:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING=RELEASE \
-DCMAKE_C_FLAGS_RELEASE:STRING="" \
-DDISABLE_BSYMBOLIC:BOOL=OFF \
-DDISABLE_WERROR:BOOL=ON \
-DENABLE_RDRAND:BOOL=ON \
-DENABLE_THREADING:BOOL=ON \
-G Ninja\
%{!?__cmake_in_source_build:-S "%{_vpath_srcdir}"} \
%{!?__cmake_in_source_build:-B "%{_vpath_builddir}"} \
%__cmake --build "%{_vpath_builddir}" %{?_smp_mflags} --verbose --target all doc
#%cmake_build
%check
%ninja_test -C %{_vpath_builddir}
%install
#%cmake_install
DESTDIR="%{buildroot}" %__cmake --install "%{_vpath_builddir}"
mkdir -p %{buildroot}%{_pkgdocdir}
hardlink -cfv %{buildroot}%{_pkgdocdir}
%pretrans devel -p <lua>
path = "%{_includedir}/%{name}"
st = posix.stat(path)
if st and st.type == "link" then
os.remove(path)
end
%ldconfig_scriptlets
%files
%license AUTHORS COPYING
%{_libdir}/lib%{name}.so.%{so_ver}*
%files devel
%{_includedir}/%{name}/
%{_libdir}/cmake/%{name}
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%files help
%doc %{_pkgdocdir}
%changelog
* Wed Mar 19 2025 sunhai <sunhai10@huawei.com> - 0.15-7
- Handle yet another out of memory condition
- Fix issue 854 Set error json_tokener_error_memory in
- Issue 857 fix a few places where json_tokener should
- Handle NULL gracefully in json_tokener_free
- Issue 881 don t allow json_tokener_new_ex with a dep
* Tue Aug 29 2023 sunhai <sunhai10@huawei.com> - 0.15-6
- CVE:CVE-2021-32292
- SUG:NA
- DESC:Fix read past end of buffer
* Fri Mar 17 2023 chenhaixing <chenhaixing@huawei.com> - 0.15-5
- CVE:NA
- SUG:NA
- DESC:json-c:enable DT
* Sat Sep 3 2022 zhangrui <zhangrui182@huawei.com> - 0.15-4
- add remove unlink file in pretrans devel
* Tue Aug 30 2022 zhouwenpei <zhouwenpei1@h-partners> - 0.15-3
- delete old so files
* Mon May 9 2022 wuchaochao <cyanrose@yeah.net> - 0.15-2
- add backport-json-escape-str-avoid-harmless-unsigned-integer-overflow.patch
* Thu Aug 20 2020 jinzhimin <jinzhimin2@huawei.com> - 0.15-1
- update to 0.15
* Fri May 22 2020 ruanweidong <ruanweidong1@huawei.com> -0.13.1-7
- fix CVE-2020-12762
* Sat Mar 21 2020 songnannan <songnannan2@huawei.com> - 0.13.1-6
- delete the check
* Tue Mar 3 2020 songnannan<songnannan2@huawei.com> - 0.13.1-5
- bugfix in oss-fuzz
* Thu Sep 19 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.13.1-4
- Package init