json-c/json-c.spec

132 lines
3.5 KiB
RPMSpec
Raw Normal View History

2019-09-30 10:54:03 -04:00
%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}}
%global so_ver 4
%global reldate 20180305
Name: json-c
Version: 0.13.1
Release: 9
2019-09-30 10:54:03 -04:00
Summary: JSON implementation in C
License: MIT
URL: https://github.com/%{name}/%{name}
Source0: %{url}/archive/%{name}-%{version}-%{reldate}.tar.gz
# Cherry-picked from upstream.
Patch0: json-c-0.13.1-parse_test_UTF8_BOM.patch
Patch1: json-c-0.13.1-fix_incorrect_casts_in_calls_to_ctype_functions.patch
Patch2: json-c-0.13.1-fix_typos.patch
2019-09-30 10:54:03 -04:00
Patch6000: 0012-json_object_private-Use-unsigned-32-bit-integer-type.patch
Patch6001: 0040-Fixed-misalignment-in-JSON-string-due-to-space-after.patch
Patch6002: 0048-json_object.c-set-errno-in-json_object_get_double.patch
Patch6003: 0053-Fix-compiler-warnings.patch
Patch6004: 0002-Issue-486-append-a-missing-.0-to-negative-double-val.patch
Patch9000: bugfix-json-c-support_aarch64.patch
2020-03-03 17:39:09 +08:00
Patch6005: json-c-bugfix-against-INT64_MAX.patch
2020-05-22 11:48:59 +08:00
Patch6006: CVE-2020-12762.patch
Patch6007: backport-Detect-broken-RDRAND-during-initialization.patch
Patch6008: backport-drop-the-rdrand-test-loops.patch
2019-09-30 10:54:03 -04:00
BuildRequires: libtool
%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 -Tb 0 -n %{name}-%{name}-%{version}-%{reldate} -p 1
for doc in ChangeLog; do
%{_bindir}/iconv -f iso-8859-1 -t utf8 ${doc} > ${doc}.new
/bin/touch -r ${doc} ${doc}.new
%{__mv} -f ${doc}.new ${doc}
done
%{__sed} -i -e 's!#ACLOCAL_AMFLAGS!ACLOCAL_AMFLAGS!g' Makefile.am
%{_bindir}/autoreconf -fiv
%build
%configure --disable-silent-rules --disable-static --enable-rdrand \
--enable-shared --enable-threading
%make_build
%{_bindir}/doxygen Doxyfile
%install
%make_install
%delete_la_and_a
%{__mkdir} -p %{buildroot}%{_pkgdocdir}
%{__cp} -pr doc/html ChangeLog README README.* %{buildroot}%{_pkgdocdir}
2020-07-21 09:14:54 +08:00
hardlink -cvf %{buildroot}%{_pkgdocdir}
2019-09-30 10:54:03 -04:00
%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}/lib%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%files help
%doc %{_pkgdocdir}
%changelog
* Thu Sep 9 2021 liuyumeng <liuyumeng5@huawei.com> - 0.13.1-9
- fix broken RDRAND causes infinite looping
* Tue Jul 21 2020 wangye <wangye70@huawei.com> - 0.13.1-8
2020-07-21 09:14:54 +08:00
- fix hardlink path
2020-05-22 11:48:59 +08:00
* Fri May 22 2020 ruanweidong <ruanweidong1@huawei.com> - 0.13.1-7
- fix CVE-2020-12762
2020-03-21 20:19:49 +08:00
* Sat Mar 21 2020 songnannan <songnannan2@huawei.com> - 0.13.1-6
- delete the check
2020-03-03 17:22:14 +08:00
* Tue Mar 3 2020 songnannan<songnannan2@huawei.com> - 0.13.1-5
- bugfix in oss-fuzz
2019-09-30 10:54:03 -04:00
* Thu Sep 19 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.13.1-4
- Package init