2496d2
%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}}
2496d2
2496d2
# We don't want accidental SONAME bumps.
2496d2
# When there is a SONAME bump in json-c, we need to request
2496d2
# a side-tag for bootstrap purposes:
2496d2
#
2496d2
# 1. Build a bootstrap build of the systemd package, and wait
2496d2
#    for it to be available inside the side-tag.
2496d2
# 2. Re-build the following build-chain for bootstrap:
2496d2
#    json-c : cryptsetup
2496d2
# 3. Untag the systemd bootstrap build from the side-tag, and
2496d2
#    disable bootstrapping in the systemd package.  Re-build
2496d2
#    the systemd package into Rawhide.
2496d2
# 4. Wait for the changes to populate and re-build the following
2496d2
#    chain into the side-tag:
2496d2
#    satyr : libdnf libreport
2496d2
# 5. Merge the side-tag using Bodhi.
2496d2
#
2496d2
# After that procedure any other cosumers can be re-build
2496d2
# in Rawhide as usual.
2496d2
%global so_ver 5
2496d2
2496d2
# Releases are tagged with a date stamp.
2496d2
%global reldate 20200419
2496d2
2496d2
2496d2
Name:           json-c
2496d2
Version:        0.14
2496d2
Release:        11%{?dist}
2496d2
Summary:        JSON implementation in C
2496d2
2496d2
License:        MIT
2496d2
URL:            https://github.com/%{name}/%{name}
2496d2
Source0:        %{url}/archive/%{name}-%{version}-%{reldate}.tar.gz
2496d2
2496d2
# Cherry-picked from upstream.
2496d2
Patch0001:      %{url}/commit/228881c8fc287182f284a58d8279a32fbeae0b7f.patch#/%{name}-0.14-dont_install_config_h.patch
2496d2
Patch0002:      %{url}/pull/603.patch#/%{name}-0.14-backport_fixes_from_master.patch
2496d2
Patch0003:      %{url}/commit/003b58782b12798da3da8b952152988a88dfb532.patch#/%{name}-0.14-fix_usage_of_errno_in_json_parse_uint64.patch
2496d2
Patch0004:      %{url}/pull/618.patch#/%{name}-0.14-test_deep_copy_fix_assertion_value.patch
2496d2
Patch0005:      %{url}/pull/619.patch#/%{name}-0.14-cmake_fix_out_of_tree_build_for_Doxygen_documentation.patch
2496d2
Patch0006:      %{url}/pull/622.patch#/%{name}-0.14-move_Doxyfile_into_doc_subdir.patch
2496d2
Patch0007:      %{url}/commit/4a546e7b2f471157c6f479df1ef687864fcbd89e.patch#/%{name}-0.14-arraylist_optimizations.patch
2496d2
# Start providing versioned symbols
2496d2
# rhbz#2001067
2496d2
Patch0008:	json-c-0.14-versioned-symbols.patch
2496d2
2496d2
BuildRequires:  cmake
2496d2
BuildRequires:  gcc
2496d2
BuildRequires:  ninja-build
2496d2
%ifarch %{valgrind_arches}
2496d2
BuildRequires:  valgrind
2496d2
%endif
2496d2
2496d2
%description
2496d2
JSON-C implements a reference counting object model that allows you
2496d2
to easily construct JSON objects in C, output them as JSON formatted
2496d2
strings and parse JSON formatted strings back into the C representation
2496d2
of JSON objects.  It aims to conform to RFC 7159.
2496d2
2496d2
2496d2
%package        devel
2496d2
Summary:        Development files for %{name}
2496d2
Requires:       %{name}%{?_isa} = %{version}-%{release}
2496d2
2496d2
%description    devel
2496d2
This package contains libraries and header files for
2496d2
developing applications that use %{name}.
2496d2
2496d2
2496d2
%package        doc
2496d2
Summary:        Reference manual for json-c
2496d2
2496d2
BuildArch:      noarch
2496d2
2496d2
BuildRequires:  doxygen
2496d2
BuildRequires:  hardlink
2496d2
2496d2
%description    doc
2496d2
This package contains the reference manual for %{name}.
2496d2
2496d2
2496d2
%prep
2496d2
%autosetup -n %{name}-%{name}-%{version}-%{reldate} -p 1
2496d2
2496d2
# Remove pre-built html documentation.
2496d2
rm -fr doc/html
2496d2
2496d2
# Update Doxyfile.
2496d2
doxygen -s -u doc/Doxyfile.in
2496d2
2496d2
2496d2
%build
2496d2
%cmake \
2496d2
  -DBUILD_STATIC_LIBS:BOOL=OFF       \
2496d2
  -DCMAKE_BUILD_TYPE:STRING=RELEASE  \
2496d2
  -DCMAKE_C_FLAGS_RELEASE:STRING=""  \
2496d2
  -DDISABLE_BSYMBOLIC:BOOL=OFF       \
2496d2
  -DDISABLE_WERROR:BOOL=ON           \
2496d2
  -DENABLE_RDRAND:BOOL=ON            \
2496d2
  -DENABLE_THREADING:BOOL=ON         \
2496d2
  -G Ninja
2496d2
%cmake_build --target all doc
2496d2
2496d2
2496d2
%install
2496d2
%cmake_install
2496d2
2496d2
# Documentation
2496d2
mkdir -p %{buildroot}%{_pkgdocdir}
2496d2
cp -a %{__cmake_builddir}/doc/html ChangeLog README README.* \
2496d2
  %{buildroot}%{_pkgdocdir}
2496d2
hardlink -cfv %{buildroot}%{_pkgdocdir}
2496d2
2496d2
2496d2
%check
2496d2
export USE_VALGRIND=0
2496d2
%ctest
2496d2
%ifarch %{valgrind_arches}
2496d2
export USE_VALGRIND=1
2496d2
%ctest
2496d2
%endif
2496d2
unset USE_VALGRIND
2496d2
2496d2
2496d2
%ldconfig_scriptlets
2496d2
2496d2
2496d2
%files
2496d2
%license AUTHORS
2496d2
%license COPYING
2496d2
%{_libdir}/lib%{name}.so.%{so_ver}*
2496d2
2496d2
2496d2
%files devel
2496d2
%doc %dir %{_pkgdocdir}
2496d2
%doc %{_pkgdocdir}/ChangeLog
2496d2
%doc %{_pkgdocdir}/README*
2496d2
%{_includedir}/%{name}
2496d2
%{_libdir}/cmake/%{name}
2496d2
%{_libdir}/lib%{name}.so
2496d2
%{_libdir}/pkgconfig/%{name}.pc
2496d2
2496d2
2496d2
%files doc
2496d2
%if 0%{?fedora} || 0%{?rhel} >= 7
2496d2
%license %{_datadir}/licenses/%{name}*
2496d2
%endif
2496d2
%doc %{_pkgdocdir}
2496d2
2496d2
2496d2
%changelog
2496d2
* Tue Sep 14 2021 Tomas Korbar <tkorbar@redhat.com> - 0.14-11
2496d2
- Start providing versioned symbols
2496d2
- Resolves: rhbz#2001067
2496d2
2496d2
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.14-10
2496d2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
2496d2
  Related: rhbz#1991688
2496d2
2496d2
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.14-9
2496d2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
2496d2
2496d2
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.14-8
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
2496d2
2496d2
* Mon Jul 27 2020 Björn Esser <besser82@fedoraproject.org> - 0.14-7
2496d2
- Use new cmake macros
2496d2
2496d2
* Tue May 26 2020 Björn Esser <besser82@fedoraproject.org> - 0.14-6
2496d2
- Build using Ninja instead of Make
2496d2
- Add a patch to move Doxyfile into doc subdir
2496d2
- Remove pre-built html documentation
2496d2
- Update Doxyfile during %%prep
2496d2
- Add a patch to apply some optimizations to arraylist
2496d2
- Hardlink the files in %%_pkgdocdir
2496d2
2496d2
* Mon May 25 2020 Björn Esser <besser82@fedoraproject.org> - 0.14-5
2496d2
- Run the testssuite with valgrind on %%valgrind_arches
2496d2
2496d2
* Mon May 18 2020 Björn Esser <besser82@fedoraproject.org> - 0.14-4
2496d2
- Add a patch to fix a test
2496d2
- Add a patch to fix generation of user-documentation
2496d2
2496d2
* Mon May 11 2020 Björn Esser <besser82@fedoraproject.org> - 0.14-3
2496d2
- Add upstream patch fixing usage of errno in json_parse_uint64()
2496d2
2496d2
* Sun May 10 2020 Björn Esser <besser82@fedoraproject.org> - 0.14-2
2496d2
- Add a patch to backport fixes applied on upstream master branch
2496d2
- Re-enable RDRAND as json-c can detect broken implementations in CPUs now
2496d2
- Disable -Werror during build
2496d2
2496d2
* Tue Apr 21 2020 Björn Esser <besser82@fedoraproject.org> - 0.14-1
2496d2
- Update to 0.14
2496d2
2496d2
* Mon Apr 20 2020 Björn Esser <besser82@fedoraproject.org> - 0.13.99-0.4.20200416gita911439
2496d2
- Remove config.h file from installation
2496d2
- Drop hardlinking of the documentation files
2496d2
2496d2
* Thu Apr 16 2020 Björn Esser <besser82@fedoraproject.org> - 0.13.99-0.3.20200416gita911439
2496d2
- Update to recent git snapshot
2496d2
2496d2
* Tue Apr 14 2020 Björn Esser <besser82@fedoraproject.org> - 0.13.99-0.2.20200414git7fb8d56
2496d2
- Update to recent git snapshot
2496d2
2496d2
* Tue Apr 14 2020 Björn Esser <besser82@fedoraproject.org> - 0.13.99-0.1.20200414gitab5425a
2496d2
- Update to recent git snapshot using forge macros
2496d2
2496d2
* Sun Apr 12 2020 Björn Esser <besser82@fedoraproject.org> - 0.13.1-11
2496d2
- Drop bootstrap logic, as the package is no dependency of @build anymore
2496d2
- Add some explicit BuildRequires, which were implicit
2496d2
- Small spec file cleanups
2496d2
2496d2
* Sat Apr 11 2020 Björn Esser <besser82@fedoraproject.org> - 0.13.1-10
2496d2
- Add explicit configure switch to disable rdrand
2496d2
- Add explicit configure switch to enable linking with Bsymbolic
2496d2
- Do not use macros to invoke executables
2496d2
- Drop obsolete %%pretrans scriptlet
2496d2
2496d2
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.1-9
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
2496d2
2496d2
* Thu Nov 28 2019 Petr Menšík <pemensik@redhat.com> - 0.13.1-8
2496d2
- Remove empty doc dir from library package
2496d2
2496d2
* Wed Nov 06 2019 Miroslav Lichvar <mlichvar@redhat.com> 0.13.1-7
2496d2
- Disable rdrand support (#1745333)
2496d2
2496d2
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.1-6
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
2496d2
2496d2
* Wed Jun 26 2019 Björn Esser <besser82@fedoraproject.org> - 0.13.1-5
2496d2
- Use hardlink without full path to the binary (#1721964)
2496d2
- Use new style bootstrap logic
2496d2
2496d2
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.1-4
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
2496d2
2496d2
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.1-3
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
2496d2
2496d2
* Tue May 08 2018 Björn Esser <besser82@fedoraproject.org> - 0.13.1-2
2496d2
- Add some cherry-picked fixes from upstream master
2496d2
2496d2
* Tue Mar 06 2018 Björn Esser <besser82@fedoraproject.org> - 0.13.1-1
2496d2
- New upstream release (rhbz#1552053)
2496d2
2496d2
* Tue Mar 06 2018 Björn Esser <besser82@fedoraproject.org> - 0.13.1-0.1
2496d2
- Bootstrapping for so-name bump
2496d2
2496d2
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-7
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
2496d2
2496d2
* Fri Feb 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.13-6
2496d2
- Switch to %%ldconfig_scriptlets
2496d2
2496d2
* Thu Dec 14 2017 Björn Esser <besser82@fedoraproject.org> - 0.13-5
2496d2
- Update patch fixing a segfault caused by possible invalid frees
2496d2
2496d2
* Wed Dec 13 2017 Björn Esser <besser82@fedoraproject.org> - 0.13-4
2496d2
- Add upstream patch fixing invalid free in some cases
2496d2
2496d2
* Wed Dec 13 2017 Björn Esser <besser82@fedoraproject.org> - 0.13-3
2496d2
- Add upstream patch for adding size_t json_c_object_sizeof()
2496d2
- Enable partial multi-threaded support
2496d2
2496d2
* Mon Dec 11 2017 Björn Esser <besser82@fedoraproject.org> - 0.13-2
2496d2
- Drop json_object_private.h
2496d2
2496d2
* Mon Dec 11 2017 Björn Esser <besser82@fedoraproject.org> - 0.13-1
2496d2
- New upstream release (rhbz#1524155)
2496d2
2496d2
* Sun Dec 10 2017 Björn Esser <besser82@fedoraproject.org> - 0.13-0.1
2496d2
- Bootstrapping for so-name bump
2496d2
- Keep json_object_private.h
2496d2
2496d2
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.1-4
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
2496d2
2496d2
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.1-3
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
2496d2
2496d2
* Mon Jul 03 2017 Björn Esser <besser82@fedoraproject.org> - 0.12.1-2
2496d2
- Add patch to replace obsolete autotools macro
2496d2
2496d2
* Thu Apr 27 2017 Björn Esser <besser82@fedoraproject.org> - 0.12.1-1
2496d2
- Update to new upstream release
2496d2
- Introduces SONAME bump, that should have been in 0.12 already
2496d2
- Unify %%doc
2496d2
- General spec-file cleanup
2496d2
2496d2
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12-8
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2496d2
2496d2
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.12-7
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
2496d2
2496d2
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-6
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
2496d2
2496d2
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-5
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
2496d2
2496d2
* Tue Jul 29 2014 Christopher Meng <rpm@cicku.me> - 0.12-4
2496d2
- SONAME bump postponed.
2496d2
2496d2
* Mon Jul 28 2014 Christopher Meng <rpm@cicku.me> - 0.12-3
2496d2
- SONAME bump, see bug 1123785
2496d2
2496d2
* Fri Jul 25 2014 Christopher Meng <rpm@cicku.me> - 0.12-2
2496d2
- NVR bump
2496d2
2496d2
* Thu Jul 24 2014 Christopher Meng <rpm@cicku.me> - 0.12-1
2496d2
- Update to 0.12
2496d2
2496d2
* Sat Jul 12 2014 Tom Callaway <spot@fedoraproject.org> - 0.11-8
2496d2
- fix license handling
2496d2
2496d2
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-7
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2496d2
2496d2
* Wed Apr 09 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 0.11-7
2496d2
- Address CVE-2013-6371 and CVE-2013-6370 (BZ #1085676 and #1085677).
2496d2
- Enabled rdrand support.
2496d2
2496d2
* Mon Feb 10 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 0.11-6
2496d2
- Bump spec.
2496d2
2496d2
* Sat Dec 21 2013 Ville Skyttä <ville.skytta@iki.fi> - 0.11-5
2496d2
- Run test suite during build.
2496d2
- Drop empty NEWS from docs.
2496d2
2496d2
* Tue Sep 10 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 0.11-4
2496d2
- Remove default warning flags so that package builds on EPEL as well.
2496d2
2496d2
* Sat Aug 24 2013 Remi Collet <remi@fedoraproject.org> - 0.11-3
2496d2
- increase parser strictness for php
2496d2
2496d2
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-2
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
2496d2
2496d2
* Mon Apr 29 2013 Remi Collet <remi@fedoraproject.org> - 0.11-1
2496d2
- update to 0.11
2496d2
- fix source0
2496d2
- enable both json and json-c libraries
2496d2
2496d2
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10-3
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
2496d2
2496d2
* Sat Nov 24 2012 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.10-2
2496d2
- Compile and install json_object_iterator using Remi Collet's fix (BZ #879771).
2496d2
2496d2
* Sat Nov 24 2012 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.10-1
2496d2
- Update to 0.10 (BZ #879771).
2496d2
2496d2
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-5
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
2496d2
2496d2
* Mon Jan 23 2012 Jiri Pirko <jpirko@redhat.com> - 0.9-4
2496d2
- add json_tokener_parse_verbose, and return NULL on parser errors
2496d2
2496d2
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-3
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
2496d2
2496d2
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-2
2496d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
2496d2
2496d2
* Tue Apr 06 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.9-1
2496d2
- First release.