665245
%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}}
665245
665245
%global so_ver      4
665245
%global reldate     20180305
665245
665245
# Uncomment when building a bootstrap for a bumped so-name.
665245
# You also need to adjust the parameters below.
665245
%global bootstrap   0
665245
665245
%if 0%{?bootstrap}
665245
%global reldate_old 20171207
665245
%global version_old 0.13
665245
%global so_ver_old  3
665245
%endif
665245
665245
665245
Name:           json-c
665245
Version:        0.13.1
aa505d
Release:        3%{?dist}
665245
Summary:        JSON implementation in C
665245
665245
License:        MIT
665245
URL:            https://github.com/%{name}/%{name}
665245
Source0:        %{url}/archive/%{name}-%{version}-%{reldate}.tar.gz
665245
%if 0%{?bootstrap}
665245
Source1:        %{url}/archive/%{name}-%{version_old}-%{reldate_old}.tar.gz
665245
%endif
0241e2
# CVE-2020-12762 json-c: integer overflow and out-of-bounds write via a large JSON file
0241e2
# rhbz#1835626
0241e2
Patch0:		json-c-int-overflow.patch
aa505d
# patch for support of versioned symbols
aa505d
# rhbz#2001063
aa505d
Patch1:		json-c-versioned-symbols.patch
665245
665245
BuildRequires:  libtool
665245
665245
%description
665245
JSON-C implements a reference counting object model that allows you
665245
to easily construct JSON objects in C, output them as JSON formatted
665245
strings and parse JSON formatted strings back into the C representation
665245
of JSON objects.  It aims to conform to RFC 7159.
665245
665245
665245
%package        devel
665245
Summary:        Development files for %{name}
665245
665245
Requires:       %{name}%{?_isa} == %{version}-%{release}
665245
665245
%description    devel
665245
This package contains libraries and header files for
665245
developing applications that use %{name}.
665245
665245
665245
%package        doc
665245
Summary:        Reference manual for json-c
665245
665245
BuildArch:      noarch
665245
665245
BuildRequires:  doxygen
665245
BuildRequires:  hardlink
665245
665245
%description    doc
665245
This package contains the reference manual for %{name}.
665245
665245
665245
%prep
665245
%autosetup -Tb 0 -n %{name}-%{name}-%{version}-%{reldate} -p 1
665245
665245
for doc in ChangeLog; do
665245
  %{_bindir}/iconv -f iso-8859-1 -t utf8 ${doc} > ${doc}.new
665245
  /bin/touch -r ${doc} ${doc}.new
665245
  %{__mv} -f ${doc}.new ${doc}
665245
done
665245
665245
%{__sed} -i -e 's!#ACLOCAL_AMFLAGS!ACLOCAL_AMFLAGS!g' Makefile.am
665245
%{_bindir}/autoreconf -fiv
665245
665245
%if 0%{?bootstrap}
665245
%{__mkdir} -p bootstrap_ver
665245
pushd bootstrap_ver
665245
%{__tar} --strip-components=1 -xf %{SOURCE1}
665245
665245
%{__sed} -i -e 's!#ACLOCAL_AMFLAGS!ACLOCAL_AMFLAGS!g' Makefile.am
665245
%{_bindir}/autoreconf -fiv
665245
popd
665245
%endif
665245
665245
665245
%build
aa505d
# it is easier and more efficient to add version script flag
aa505d
# here instead of having to rebuild the configure script
aa505d
LDFLAGS="%{build_ldflags} -Wl,--version-script,${PWD}/json-c.sym"
665245
%configure               \
665245
  --disable-silent-rules \
665245
  --disable-static       \
665245
  --enable-shared        \
665245
  --enable-threading
665245
665245
%make_build
665245
665245
%{_bindir}/doxygen Doxyfile
665245
665245
%if 0%{?bootstrap}
665245
pushd bootstrap_ver
665245
%configure               \
665245
  --disable-silent-rules \
665245
  --disable-static       \
665245
  --enable-shared        \
665245
  --enable-threading
665245
665245
%make_build
665245
popd
665245
%endif
665245
665245
665245
%install
665245
%if 0%{?bootstrap}
665245
%make_install -C bootstrap_ver
665245
%{__rm} -fr %{buildroot}%{_includedir}/%{name}   \
665245
            %{buildroot}%{_libdir}/lib%{name}.so \
665245
            %{buildroot}%{_libdir}/pkgconfig
665245
%endif
665245
665245
%make_install
665245
665245
%{_bindir}/find %{buildroot} -name '*.a' -delete -print
665245
%{_bindir}/find %{buildroot} -name '*.la' -delete -print
665245
665245
%{__mkdir} -p %{buildroot}%{_pkgdocdir}
665245
%{__cp} -pr doc/html ChangeLog README README.* %{buildroot}%{_pkgdocdir}
665245
%{_sbindir}/hardlink -cvf %{buildroot}%{_pkgdocdir}
665245
665245
665245
%check
665245
%make_build check
665245
665245
%if 0%{?bootstrap}
665245
%make_build -C bootstrap_ver check
665245
%endif
665245
665245
665245
%pretrans devel -p <lua>
665245
path = "%{_includedir}/%{name}"
665245
st = posix.stat(path)
665245
if st and st.type == "link" then
665245
  os.remove(path)
665245
end
665245
665245
665245
%ldconfig_scriptlets
665245
665245
665245
%files
665245
%license AUTHORS
665245
%license COPYING
665245
%{_libdir}/lib%{name}.so.%{so_ver}*
665245
%if 0%{?bootstrap}
665245
%{_libdir}/lib%{name}.so.%{so_ver_old}*
665245
%endif
665245
665245
665245
%files devel
665245
%doc %{_pkgdocdir}/ChangeLog
665245
%doc %{_pkgdocdir}/README*
665245
%{_includedir}/%{name}/
665245
%{_libdir}/lib%{name}.so
665245
%{_libdir}/pkgconfig/%{name}.pc
665245
665245
665245
%files doc
665245
%if 0%{?fedora} || 0%{?rhel} >= 7
665245
%license %{_datadir}/licenses/%{name}*
665245
%endif # 0%%{?fedora} || 0%%{?rhel} >= 7
665245
%doc %{_pkgdocdir}
665245
665245
665245
%changelog
aa505d
* Tue Sep 14 2021 Tomas Korbar <tkorbar@redhat.com> - 0.13.1-3
aa505d
- Start versioning symbols when building library
aa505d
- Resolves: rhbz#2001063
aa505d
c413c9
* Thu May 20 2021 Joe Orton <jorton@redhat.com> - 0.13.1-2
c413c9
- rebuild (#1954436)
c413c9
0241e2
* Thu Apr 15 2021 Tomas Korbar <tkorbar@redhat.com> - 0.13.1-1
0241e2
- Fix CVE-2020-12762 out-of-bounds write via a large JSON file
0241e2
- Resolves: rhbz#1835626
0241e2
c70c64
* Wed Feb 03 2021 Petr Menšík <pemensik@redhat.com> - 0.13.1-0.4
c70c64
- Move json-c-devel to AppStream
c70c64
665245
* Fri Sep 18 2020 Anna Khaitovich <akhaitov@redhat.com> - 0.13.1-0.3
665245
- Don't package empty /usr/share/doc/json-c
665245
- Resolves: rhbz#1741076
665245
- Do not use --enable-rdrand
665245
- Resolves: rhbz#1806532
665245
665245
* Fri Aug 03 2018 Radovan Sroka <rsroka@redhat.com> - 0.13.1-0.2
665245
- disable bootstrap for RHEL8
665245
665245
* Tue Mar 06 2018 Björn Esser <besser82@fedoraproject.org> - 0.13.1-0.1
665245
- Bootstrapping for so-name bump
665245
665245
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-7
665245
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
665245
665245
* Fri Feb 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.13-6
665245
- Switch to %%ldconfig_scriptlets
665245
665245
* Thu Dec 14 2017 Björn Esser <besser82@fedoraproject.org> - 0.13-5
665245
- Update patch fixing a segfault caused by possible invalid frees
665245
665245
* Wed Dec 13 2017 Björn Esser <besser82@fedoraproject.org> - 0.13-4
665245
- Add upstream patch fixing invalid free in some cases
665245
665245
* Wed Dec 13 2017 Björn Esser <besser82@fedoraproject.org> - 0.13-3
665245
- Add upstream patch for adding size_t json_c_object_sizeof()
665245
- Enable partial multi-threaded support
665245
665245
* Mon Dec 11 2017 Björn Esser <besser82@fedoraproject.org> - 0.13-2
665245
- Drop json_object_private.h
665245
665245
* Mon Dec 11 2017 Björn Esser <besser82@fedoraproject.org> - 0.13-1
665245
- New upstream release (rhbz#1524155)
665245
665245
* Sun Dec 10 2017 Björn Esser <besser82@fedoraproject.org> - 0.13-0.1
665245
- Bootstrapping for so-name bump
665245
- Keep json_object_private.h
665245
665245
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.1-4
665245
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
665245
665245
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.1-3
665245
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
665245
665245
* Mon Jul 03 2017 Björn Esser <besser82@fedoraproject.org> - 0.12.1-2
665245
- Add patch to replace obsolete autotools macro
665245
665245
* Thu Apr 27 2017 Björn Esser <besser82@fedoraproject.org> - 0.12.1-1
665245
- Update to new upstream release
665245
- Introduces SONAME bump, that should have been in 0.12 already
665245
- Unify %%doc
665245
- General spec-file cleanup
665245
665245
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12-8
665245
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
665245
665245
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.12-7
665245
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
665245
665245
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-6
665245
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
665245
665245
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-5
665245
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
665245
665245
* Tue Jul 29 2014 Christopher Meng <rpm@cicku.me> - 0.12-4
665245
- SONAME bump postponed.
665245
665245
* Mon Jul 28 2014 Christopher Meng <rpm@cicku.me> - 0.12-3
665245
- SONAME bump, see bug 1123785
665245
665245
* Fri Jul 25 2014 Christopher Meng <rpm@cicku.me> - 0.12-2
665245
- NVR bump
665245
665245
* Thu Jul 24 2014 Christopher Meng <rpm@cicku.me> - 0.12-1
665245
- Update to 0.12
665245
665245
* Sat Jul 12 2014 Tom Callaway <spot@fedoraproject.org> - 0.11-8
665245
- fix license handling
665245
665245
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-7
665245
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
665245
665245
* Wed Apr 09 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 0.11-7
665245
- Address CVE-2013-6371 and CVE-2013-6370 (BZ #1085676 and #1085677).
665245
- Enabled rdrand support.
665245
665245
* Mon Feb 10 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 0.11-6
665245
- Bump spec.
665245
665245
* Sat Dec 21 2013 Ville Skyttä <ville.skytta@iki.fi> - 0.11-5
665245
- Run test suite during build.
665245
- Drop empty NEWS from docs.
665245
665245
* Tue Sep 10 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 0.11-4
665245
- Remove default warning flags so that package builds on EPEL as well.
665245
665245
* Sat Aug 24 2013 Remi Collet <remi@fedoraproject.org> - 0.11-3
665245
- increase parser strictness for php
665245
665245
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-2
665245
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
665245
665245
* Mon Apr 29 2013 Remi Collet <remi@fedoraproject.org> - 0.11-1
665245
- update to 0.11
665245
- fix source0
665245
- enable both json and json-c libraries
665245
665245
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10-3
665245
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
665245
665245
* Sat Nov 24 2012 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.10-2
665245
- Compile and install json_object_iterator using Remi Collet's fix (BZ #879771).
665245
665245
* Sat Nov 24 2012 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.10-1
665245
- Update to 0.10 (BZ #879771).
665245
665245
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-5
665245
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
665245
665245
* Mon Jan 23 2012 Jiri Pirko <jpirko@redhat.com> - 0.9-4
665245
- add json_tokener_parse_verbose, and return NULL on parser errors
665245
665245
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-3
665245
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
665245
665245
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-2
665245
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
665245
665245
* Tue Apr 06 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.9-1
665245
- First release.