Files
cJSON/cJSON.spec
Martin Hauke 5248c5c046 Accepting request 1306189 from home:mnhauke
- Update to version 1.7.19
  * Check for NULL in cJSON_DetachItemViaPointer.
  * Check overlap before calling strcpy in cJSON_SetValuestring.
  * Fix Max recursion depth for cJSON_Duplicate to prevent stack
    exhaustion.
  * Allocate memory for the temporary buffer when paring numbers.
    This fixes CVE-2023-26819.
  * Fix the incorrect check in decode_array_index_from_pointer.
    This fixes CVE-2025-57052
- Remove not longer needed patch:
  * cJSON-1.7.18-misc_tests.patch

OBS-URL: https://build.opensuse.org/request/show/1306189
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/cJSON?expand=0&rev=17
2025-09-22 09:11:52 +00:00

87 lines
2.3 KiB
RPMSpec

#
# spec file for package cJSON
#
# Copyright (c) 2025 SUSE LLC and contributors
# Copyright (c) 2020-2025, Martin Hauke <mardnh@gmx.de>
# Copyright (c) 2024 Andreas Stieger <Andreas.Stieger@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global sover 1
%global libname libcjson%{sover}
Name: cJSON
Version: 1.7.19
Release: 0
Summary: JSON parser library written in ANSI C
License: MIT
Group: System/Libraries
URL: https://github.com/DaveGamble/cJSON
Source: https://github.com/DaveGamble/cJSON/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: cJSON-fix-cmake-include-path.patch
BuildRequires: cmake
BuildRequires: pkgconfig
%description
A simple JSON parser library written in ANSI C.
%package -n %{libname}
Summary: JSON parser library written in ANSI C
Group: System/Libraries
%description -n %{libname}
A simple JSON parser library written in ANSI C.
%package devel
Summary: Development files for the cJSON library
Group: Development/Libraries/C and C++
Requires: %{libname} = %{version}
%description devel
A simple JSON parser library written in ANSI C.
This subpackage contains libraries and header files for developing
applications that want to make use of libcjson.
%prep
%autosetup -p1
%build
%cmake
%cmake_build
%install
%cmake_install
%ldconfig_scriptlets -n %{libname}
%check
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
%ctest
%files -n %{libname}
%license LICENSE
%doc CHANGELOG.md CONTRIBUTORS.md README.md
%{_libdir}/libcjson.so.%{sover}*
%files devel
%license LICENSE
%dir %{_includedir}/cjson
%{_includedir}/cjson/cJSON.h
%dir %{_libdir}/cmake/cJSON
%{_libdir}/cmake/cJSON/*.cmake
%{_libdir}/libcjson.so
%{_libdir}/pkgconfig/libcjson.pc
%changelog