diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2c3dee5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/jansson-2.13.1.tar.bz2 diff --git a/.jansson.metadata b/.jansson.metadata new file mode 100644 index 0000000..6b96d4b --- /dev/null +++ b/.jansson.metadata @@ -0,0 +1 @@ +e8316ffe9c603efb9c52a61ed3c82ccd5b0b93a7 SOURCES/jansson-2.13.1.tar.bz2 diff --git a/SOURCES/fix-docs-build-with-sphinx-3.patch b/SOURCES/fix-docs-build-with-sphinx-3.patch new file mode 100644 index 0000000..1d64ab3 --- /dev/null +++ b/SOURCES/fix-docs-build-with-sphinx-3.patch @@ -0,0 +1,240 @@ +diff --git a/CHANGES b/CHANGES +index a374a86..256fde1 100644 +--- a/CHANGES ++++ b/CHANGES +@@ -8,7 +8,7 @@ Released 2020-05-07 + - Include `jansson_version_str()` and `jansson_version_cmp()` in + shared library. (#534) + +- - Include `scripts/` in tarball. (#535) ++ - Include ``scripts/`` in tarball. (#535) + + + Version 2.13 +@@ -127,7 +127,7 @@ Released 2018-02-09 + + - Work around gcc's -Wimplicit-fallthrough. + +- - Fix CMake detection of `sys/types.h` header (#375). ++ - Fix CMake detection of ``sys/types.h`` header (#375). + + - Fix `jansson.pc` generated by CMake to be more consistent with the one + generated using GNU Autotools (#368). +diff --git a/doc/apiref.rst b/doc/apiref.rst +index c3a814f..94c5726 100644 +--- a/doc/apiref.rst ++++ b/doc/apiref.rst +@@ -145,33 +145,33 @@ Type + .. function:: int json_typeof(const json_t *json) + + Return the type of the JSON value (a :type:`json_type` cast to +- :type:`int`). *json* MUST NOT be *NULL*. This function is actually ++ ``int``). *json* MUST NOT be *NULL*. This function is actually + implemented as a macro for speed. + +-.. function:: json_is_object(const json_t *json) +- json_is_array(const json_t *json) +- json_is_string(const json_t *json) +- json_is_integer(const json_t *json) +- json_is_real(const json_t *json) +- json_is_true(const json_t *json) +- json_is_false(const json_t *json) +- json_is_null(const json_t *json) ++.. function:: int json_is_object(const json_t *json) ++ int json_is_array(const json_t *json) ++ int json_is_string(const json_t *json) ++ int json_is_integer(const json_t *json) ++ int json_is_real(const json_t *json) ++ int json_is_true(const json_t *json) ++ int json_is_false(const json_t *json) ++ int json_is_null(const json_t *json) + + These functions (actually macros) return true (non-zero) for values + of the given type, and false (zero) for values of other types and + for *NULL*. + +-.. function:: json_is_number(const json_t *json) ++.. function:: int json_is_number(const json_t *json) + + Returns true for values of types ``JSON_INTEGER`` and + ``JSON_REAL``, and false for other types and for *NULL*. + +-.. function:: json_is_boolean(const json_t *json) ++.. function:: int json_is_boolean(const json_t *json) + + Returns true for types ``JSON_TRUE`` and ``JSON_FALSE``, and false + for values of other types and for *NULL*. + +-.. function:: json_boolean_value(const json_t *json) ++.. function:: int json_boolean_value(const json_t *json) + + Alias of :func:`json_is_true()`, i.e. returns 1 for ``JSON_TRUE`` + and 0 otherwise. +@@ -594,7 +594,7 @@ A JSON array is an ordered collection of other JSON values. + Appends all elements in *other_array* to the end of *array*. + Returns 0 on success and -1 on error. + +-.. function:: json_array_foreach(array, index, value) ++.. function:: void json_array_foreach(array, index, value) + + Iterate over every element of ``array``, running the block + of code that follows each time with the proper values set to +@@ -732,11 +732,11 @@ allowed in object keys. + recursively merged with the corresponding values in *object* if they are also + objects, instead of overwriting them. Returns 0 on success or -1 on error. + +-.. function:: json_object_foreach(object, key, value) ++.. function:: void json_object_foreach(object, key, value) + + Iterate over every key-value pair of ``object``, running the block + of code that follows each time with the proper values set to +- variables ``key`` and ``value``, of types :type:`const char *` and ++ variables ``key`` and ``value``, of types ``const char *`` and + :type:`json_t *` respectively. Example:: + + /* obj is a JSON object */ +@@ -764,7 +764,7 @@ allowed in object keys. + .. versionadded:: 2.3 + + +-.. function:: json_object_foreach_safe(object, tmp, key, value) ++.. function:: void json_object_foreach_safe(object, tmp, key, value) + + Like :func:`json_object_foreach()`, but it's safe to call + ``json_object_del(object, key)`` during iteration. You need to pass +@@ -1488,17 +1488,17 @@ arguments. + Output a JSON null value. No argument is consumed. + + ``b`` (boolean) [int] +- Convert a C :type:`int` to JSON boolean value. Zero is converted ++ Convert a C ``int`` to JSON boolean value. Zero is converted + to ``false`` and non-zero to ``true``. + + ``i`` (integer) [int] +- Convert a C :type:`int` to JSON integer. ++ Convert a C ``int`` to JSON integer. + + ``I`` (integer) [json_int_t] + Convert a C :type:`json_int_t` to JSON integer. + + ``f`` (real) [double] +- Convert a C :type:`double` to JSON real. ++ Convert a C ``double`` to JSON real. + + ``o`` (any value) [json_t \*] + Output any given JSON value as-is. If the value is added to an +@@ -1625,20 +1625,20 @@ type whose address should be passed. + Expect a JSON null value. Nothing is extracted. + + ``b`` (boolean) [int] +- Convert a JSON boolean value to a C :type:`int`, so that ``true`` ++ Convert a JSON boolean value to a C ``int``, so that ``true`` + is converted to 1 and ``false`` to 0. + + ``i`` (integer) [int] +- Convert a JSON integer to C :type:`int`. ++ Convert a JSON integer to C ``int``. + + ``I`` (integer) [json_int_t] + Convert a JSON integer to C :type:`json_int_t`. + + ``f`` (real) [double] +- Convert a JSON real to C :type:`double`. ++ Convert a JSON real to C ``double``. + + ``F`` (integer or real) [double] +- Convert a JSON number (integer or real) to C :type:`double`. ++ Convert a JSON number (integer or real) to C ``double``. + + ``o`` (any value) [json_t \*] + Store a JSON value with no conversion to a :type:`json_t` pointer. +diff --git a/doc/ext/refcounting.py b/doc/ext/refcounting.py +index bba2684..e72c481 100644 +--- a/doc/ext/refcounting.py ++++ b/doc/ext/refcounting.py +@@ -24,8 +24,8 @@ + """ + + from docutils import nodes ++from docutils.parsers.rst import Directive + +-class refcounting(nodes.emphasis): pass + + def visit(self, node): + self.visit_emphasis(node) +@@ -40,16 +40,25 @@ def html_depart(self, node): + self.body.append('') + + +-def refcounting_directive(name, arguments, options, content, lineno, +- content_offset, block_text, state, state_machine): +- if arguments[0] == 'borrow': +- text = 'Return value: Borrowed reference.' +- elif arguments[0] == 'new': +- text = 'Return value: New reference.' +- else: +- raise Error('Valid arguments: new, borrow') ++class refcounting(nodes.emphasis): ++ pass ++ ++class refcounting_directive(Directive): ++ has_content = False ++ required_arguments = 1 ++ optional_arguments = 0 ++ final_argument_whitespace = False ++ ++ def run(self): ++ if self.arguments[0] == 'borrow': ++ text = 'Return value: Borrowed reference.' ++ elif self.arguments[0] == 'new': ++ text = 'Return value: New reference.' ++ else: ++ raise Error('Valid arguments: new, borrow') ++ ++ return [refcounting(text, text)] + +- return [refcounting(text, text)] + + def setup(app): + app.add_node(refcounting, +@@ -57,4 +66,4 @@ def setup(app): + latex=(visit, depart), + text=(visit, depart), + man=(visit, depart)) +- app.add_directive('refcounting', refcounting_directive, 0, (1, 0, 0)) ++ app.add_directive('refcounting', refcounting_directive) +diff --git a/doc/upgrading.rst b/doc/upgrading.rst +index 9b49046..94ff7de 100644 +--- a/doc/upgrading.rst ++++ b/doc/upgrading.rst +@@ -47,13 +47,13 @@ List of Incompatible Changes + + **Underlying type of JSON integers** + The underlying C type of JSON integers has been changed from +- :type:`int` to the widest available signed integer type, i.e. +- :type:`long long` or :type:`long`, depending on whether +- :type:`long long` is supported on your system or not. This makes ++ ``int`` to the widest available signed integer type, i.e. ++ ``long long`` or ``long``, depending on whether ++ ``long long`` is supported on your system or not. This makes + the whole 64-bit integer range available on most modern systems. + + ``jansson.h`` has a typedef :type:`json_int_t` to the underlying +- integer type. :type:`int` should still be used in most cases when ++ integer type. ``int`` should still be used in most cases when + dealing with smallish JSON integers, as the compiler handles + implicit type coercion. Only when the full 64-bit range is needed, + :type:`json_int_t` should be explicitly used. +@@ -69,8 +69,8 @@ List of Incompatible Changes + + **Unsigned integers in API functions** + Version 2.0 unifies unsigned integer usage in the API. All uses of +- :type:`unsigned int` and :type:`unsigned long` have been replaced +- with :type:`size_t`. This includes flags, container sizes, etc. ++ ``unsigned int`` and ``unsigned long`` have been replaced ++ with ``size_t``. This includes flags, container sizes, etc. + This should not require source code changes, as both +- :type:`unsigned int` and :type:`unsigned long` are usually +- compatible with :type:`size_t`. ++ ``unsigned int`` and ``unsigned long`` are usually ++ compatible with ``size_t``. diff --git a/SPECS/jansson.spec b/SPECS/jansson.spec new file mode 100644 index 0000000..49f8ea2 --- /dev/null +++ b/SPECS/jansson.spec @@ -0,0 +1,218 @@ +Name: jansson +Version: 2.13.1 +Release: 4%{?dist} +Summary: C library for encoding, decoding and manipulating JSON data + +License: MIT +URL: http://www.digip.org/jansson/ +Source0: http://www.digip.org/jansson/releases/jansson-%{version}.tar.bz2 + +# Fix docs build failures with Sphinx 3 +# Resolved upstream: https://github.com/akheron/jansson/pull/543 +Patch0: fix-docs-build-with-sphinx-3.patch + +BuildRequires: gcc +BuildRequires: python3-sphinx +BuildRequires: make + +%description +Small library for parsing and writing JSON documents. + +%package devel +Summary: Header files for jansson +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Header files for developing applications making use of jansson. + +%package devel-doc +Summary: Development documentation for jansson +BuildArch: noarch + +%description devel-doc +Development documentation for jansson. + +%prep +%autosetup -p1 + +%if 0%{?rhel} == 6 +%{__sed} -i 's/code-block:: shell/code-block:: none/g' doc/*.rst +%endif + +%build +%configure --disable-static +%make_build +make html + +%check +make check + +%install +%make_install +rm "$RPM_BUILD_ROOT%{_libdir}"/*.la + +%ldconfig_scriptlets + +%files +%license LICENSE +%doc CHANGES +%{_libdir}/*.so.* + +%files devel +%{_libdir}/*.so +%{_libdir}/pkgconfig/%{name}.pc +%{_includedir}/* + +%files devel-doc +%doc doc/_build/html/* + +%changelog +* Mon Aug 09 2021 Mohan Boddu - 2.13.1-4 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Fri Apr 16 2021 Mohan Boddu - 2.13.1-3 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Tue Jan 26 2021 Fedora Release Engineering - 2.13.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Aug 24 2020 Charalampos Stratakis - 2.13.1-1 +- Update to 2.13.1 (#1831402) +- Fix docs build failures with Sphinx 3 (#1823532) +- Use make macros: https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro + +* Sat Aug 01 2020 Fedora Release Engineering - 2.12-7 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 2.12-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jan 29 2020 Fedora Release Engineering - 2.12-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Sat Aug 3 2019 Peter Robinson 2.12-4 +- Fix build deps, use %%license + +* Thu Jul 25 2019 Fedora Release Engineering - 2.12-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Feb 01 2019 Fedora Release Engineering - 2.12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Mon Nov 26 2018 Corey Farrell - 2.12-1 +- Update to Jansson 2.12 + +* Fri Jul 13 2018 Fedora Release Engineering - 2.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Sat Mar 10 2018 Corey Farrell - 2.11-1 +- Update to Jansson 2.11 + +* Mon Feb 19 2018 Jared Smith - 2.10-7 +- Add missing BuildRequires on gcc + +* Wed Feb 07 2018 Fedora Release Engineering - 2.10-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Feb 03 2018 Igor Gnatenko - 2.10-5 +- Switch to %%ldconfig_scriptlets + +* Wed Aug 02 2017 Fedora Release Engineering - 2.10-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 2.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Jun 10 2017 Nathaniel McCallum - 2.10-2 +- Add upstream patch for optional arguments to json_pack() +- Migrate to use autosetup macro + +* Thu Mar 02 2017 Nathaniel McCallum - 2.10-1 +- Update to Jansson 2.10 + +* Fri Feb 10 2017 Fedora Release Engineering - 2.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Tue Sep 20 2016 Nathaniel McCallum - 2.9-1 +- Update to Jansson 2.9 + +* Fri Sep 16 2016 Nathaniel McCallum - 2.8-1 +- Update to Jansson 2.8 +- Add json_auto_t patch + +* Thu Feb 04 2016 Fedora Release Engineering - 2.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 2.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon Jan 05 2015 Jiri Pirko 2.7-1 +- Update to Jansson 2.7 + +* Sat Aug 16 2014 Fedora Release Engineering - 2.6-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 2.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat Mar 15 2014 Jiri Pirko 2.6-3 +- Create devel-doc package + +* Tue Mar 11 2014 Peter Robinson 2.6-2 +- Package cleanups + +* Thu Feb 13 2014 Jared Smith - 2.6-1 +- Update to Jansson 2.6 for CVE-2013-6401 + +* Sat Jan 25 2014 Jiri Pirko 2.5-1 +- Update to Jansson 2.5. + +* Sat Aug 03 2013 Fedora Release Engineering - 2.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 2.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Nov 08 2012 Jiri Pirko 2.4-1 +- Update to Jansson 2.4. + +* Thu Jul 19 2012 Fedora Release Engineering - 2.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Feb 03 2012 Jiri Pirko 2.3-1 +- Update to Jansson 2.3. + +* Fri Jan 13 2012 Fedora Release Engineering - 2.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Jun 11 2011 Sean Middleditch 2.1-1 +- Update to Jansson 2.1. +- Drop Sphinx patch, no longer necessary. + +* Wed Feb 09 2011 Fedora Release Engineering - 1.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Jul 03 2010 Sean Middleditch 1.3-1 +- Update to Jansson 1.3. +- Disable warnings-as-errors for Sphinx documentation. + +* Thu Jan 21 2010 Sean Middleditch 1.2-1 +- Update to Jansson 1.2. + +* Thu Jan 11 2010 Sean Middleditch 1.1.3-4 +- Update jansson description per upstream's suggestions. +- Removed README from docs. + +* Thu Jan 09 2010 Sean Middleditch 1.1.3-3 +- Correct misspelling of jansson in the pkg-config file. + +* Thu Jan 09 2010 Sean Middleditch 1.1.3-2 +- Fix Changelog dates. +- Mix autoheader warning. +- Added make check. +- Build and install HTML documentation in -devel package. + +* Thu Jan 07 2010 Sean Middleditch 1.1.3-1 +- Initial packaging for Fedora.