From 2d9c3f7d8d2c0fd2bd065a296dc205c063c6272b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Tue, 6 Mar 2018 14:17:58 +0100 Subject: [PATCH] Bootstrapping for so-name bump --- .gitignore | 1 + ...-c-0.13_Makefile_add_aclocal_amflags.patch | 20 ---- ...ct_add_size_t_json_c_object_sizeof_1.patch | 42 -------- ...ct_add_size_t_json_c_object_sizeof_2.patch | 51 --------- ...-0.13_json_object_avoid_invalid_free.patch | 26 ----- json-c.spec | 100 +++++++++--------- sources | 1 + 7 files changed, 52 insertions(+), 189 deletions(-) delete mode 100644 json-c-0.13_Makefile_add_aclocal_amflags.patch delete mode 100644 json-c-0.13_json_object_add_size_t_json_c_object_sizeof_1.patch delete mode 100644 json-c-0.13_json_object_add_size_t_json_c_object_sizeof_2.patch delete mode 100644 json-c-0.13_json_object_avoid_invalid_free.patch diff --git a/.gitignore b/.gitignore index 0d58425..71c0ef5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ clog /json-c-0.12-20140410.tar.gz /json-c-0.12.1-20160607.tar.gz /json-c-0.13-20171207.tar.gz +/json-c-0.13.1-20180305.tar.gz diff --git a/json-c-0.13_Makefile_add_aclocal_amflags.patch b/json-c-0.13_Makefile_add_aclocal_amflags.patch deleted file mode 100644 index 41d78e5..0000000 --- a/json-c-0.13_Makefile_add_aclocal_amflags.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 87556afe2a062c28bccd910ec5bc22b9988726e7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= -Date: Sun, 10 Dec 2017 16:29:41 +0100 -Subject: [PATCH] Makefile: Add ACLOCAL_AMFLAGS - -This is recommended by the libtool manual. ---- - Makefile.am | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Makefile.am b/Makefile.am -index 5ad354a4a3..a0a43fc8bc 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -1,3 +1,5 @@ -+ACLOCAL_AMFLAGS = -I autoconf-archive/m4 -+ - EXTRA_DIST = README.md README.html - EXTRA_DIST += config.h.win32 - EXTRA_DIST += Doxyfile diff --git a/json-c-0.13_json_object_add_size_t_json_c_object_sizeof_1.patch b/json-c-0.13_json_object_add_size_t_json_c_object_sizeof_1.patch deleted file mode 100644 index 157abe3..0000000 --- a/json-c-0.13_json_object_add_size_t_json_c_object_sizeof_1.patch +++ /dev/null @@ -1,42 +0,0 @@ -From c123a1c21b944b3391fe022263ebfcdc15e5c5d1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= -Date: Mon, 11 Dec 2017 12:55:40 +0100 -Subject: [PATCH] json_object: Add size_t json_object_sizeof() - ---- - json_object.c | 5 +++++ - json_object.h | 5 +++++ - 2 files changed, 10 insertions(+) - -diff --git a/json_object.c b/json_object.c -index 9daa6fdb0a..f12d8f08d8 100644 ---- a/json_object.c -+++ b/json_object.c -@@ -509,6 +509,11 @@ int json_object_object_length(const struct json_object *jso) - return lh_table_length(jso->o.c_object); - } - -+size_t json_object_sizeof(void) -+{ -+ return sizeof(struct json_object); -+} -+ - struct json_object* json_object_object_get(const struct json_object* jso, - const char *key) - { -diff --git a/json_object.h b/json_object.h -index 283eb95300..6a2751d228 100644 ---- a/json_object.h -+++ b/json_object.h -@@ -392,6 +392,11 @@ JSON_EXPORT struct lh_table* json_object_get_object(const struct json_object *ob - */ - JSON_EXPORT int json_object_object_length(const struct json_object* obj); - -+/** Get the sizeof (struct json_object). -+ * @returns a size_t with the sizeof (struct json_object) -+ */ -+JSON_EXPORT size_t json_object_sizeof(void); -+ - /** Add an object field to a json_object of type json_type_object - * - * The reference count will *not* be incremented. This is to make adding diff --git a/json-c-0.13_json_object_add_size_t_json_c_object_sizeof_2.patch b/json-c-0.13_json_object_add_size_t_json_c_object_sizeof_2.patch deleted file mode 100644 index 66c9f91..0000000 --- a/json-c-0.13_json_object_add_size_t_json_c_object_sizeof_2.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 5b6d62259afbc1709d4437b8c488de429079cae0 Mon Sep 17 00:00:00 2001 -From: Eric Haszlakiewicz -Date: Tue, 12 Dec 2017 18:26:51 -0500 -Subject: [PATCH] Apply gcc's "const" attribute to the json_c_object_sizeof() - function as an optimizer hint. Also, rename that function from - json_object_sizeof(). - ---- - json_object.c | 2 +- - json_object.h | 8 +++++++- - 2 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/json_object.c b/json_object.c -index f12d8f08d8..042477a71b 100644 ---- a/json_object.c -+++ b/json_object.c -@@ -509,7 +509,7 @@ int json_object_object_length(const struct json_object *jso) - return lh_table_length(jso->o.c_object); - } - --size_t json_object_sizeof(void) -+size_t json_c_object_sizeof(void) - { - return sizeof(struct json_object); - } -diff --git a/json_object.h b/json_object.h -index 6a2751d228..758efa6f1d 100644 ---- a/json_object.h -+++ b/json_object.h -@@ -27,6 +27,12 @@ - #define THIS_FUNCTION_IS_DEPRECATED(func) func - #endif - -+#ifdef __GNUC__ -+#define JSON_C_CONST_FUNCTION(func) func __attribute__((const)) -+#else -+#define CONST_FUNCTION(func) func -+#endif -+ - #if defined(_MSC_VER) - #define JSON_EXPORT __declspec(dllexport) - #else -@@ -395,7 +401,7 @@ JSON_EXPORT int json_object_object_length(const struct json_object* obj); - /** Get the sizeof (struct json_object). - * @returns a size_t with the sizeof (struct json_object) - */ --JSON_EXPORT size_t json_object_sizeof(void); -+JSON_C_CONST_FUNCTION(JSON_EXPORT size_t json_c_object_sizeof(void)); - - /** Add an object field to a json_object of type json_type_object - * diff --git a/json-c-0.13_json_object_avoid_invalid_free.patch b/json-c-0.13_json_object_avoid_invalid_free.patch deleted file mode 100644 index e266a3b..0000000 --- a/json-c-0.13_json_object_avoid_invalid_free.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 9aca3b6a087a396a81d7e26f4557eb97fecc1386 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= -Date: Wed, 13 Dec 2017 19:22:52 +0100 -Subject: [PATCH] json_object: Avoid invalid free (and thus a segfault) when - ref_count gets < 0 - ---- - json_object.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/json_object.c b/json_object.c -index 042477a71b..7c7438d8ea 100644 ---- a/json_object.c -+++ b/json_object.c -@@ -182,6 +182,11 @@ int json_object_put(struct json_object *jso) - { - if(!jso) return 0; - -+ /* Avoid invalid free and crash explicitly instead of (silently) -+ * segfaulting. -+ */ -+ assert(jso->_ref_count > 0); -+ - #if defined(HAVE_ATOMIC_BUILTINS) && defined(ENABLE_THREADING) - /* Note: this only allow the refcount to remain correct - * when multiple threads are adjusting it. It is still an error diff --git a/json-c.spec b/json-c.spec index 304e2eb..7511239 100644 --- a/json-c.spec +++ b/json-c.spec @@ -1,38 +1,32 @@ %{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} -%global so_ver 3 -%global reldate 20171207 +%global so_ver 4 +%global reldate 20180305 # Uncomment when building a bootstrap for a bumped so-name. # You also need to adjust the parameters below. -#global bootstrap 1 +%global bootstrap 1 %if 0%{?bootstrap} -%global reldate_old 20160607 -%global version_old 0.12.1 -%global so_ver_old 2 +%global reldate_old 20171207 +%global version_old 0.13 +%global so_ver_old 3 %endif -Name: json-c -Version: 0.13 -Release: 7%{?dist} -Summary: JSON implementation in C +Name: json-c +Version: 0.13.1 +Release: 0.1%{?dist} +Summary: JSON implementation in C -License: MIT -URL: https://github.com/%{name}/%{name} -Source0: %{url}/archive/%{name}-%{version}-%{reldate}.tar.gz +License: MIT +URL: https://github.com/%{name}/%{name} +Source0: %{url}/archive/%{name}-%{version}-%{reldate}.tar.gz %if 0%{?bootstrap} -Source1: %{url}/archive/%{name}-%{version_old}-%{reldate_old}.tar.gz +Source1: %{url}/archive/%{name}-%{version_old}-%{reldate_old}.tar.gz %endif -# Upstreamed. -Patch0: %{url}/pull/386.patch#/%{name}-0.13_Makefile_add_aclocal_amflags.patch -Patch1: %{url}/commit/94fd101601c24627ae44498a7a73e9f2d9fb6e91.patch#/%{name}-0.13_json_object_add_size_t_json_c_object_sizeof_1.patch -Patch2: %{url}/commit/5b6d62259afbc1709d4437b8c488de429079cae0.patch#/%{name}-0.13_json_object_add_size_t_json_c_object_sizeof_2.patch -Patch3: %{url}/pull/389.patch#/json-c-0.13_json_object_avoid_invalid_free.patch - -BuildRequires: libtool +BuildRequires: libtool %description JSON-C implements a reference counting object model that allows you @@ -41,25 +35,25 @@ 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} +%package devel +Summary: Development files for %{name} -Requires: %{name}%{?_isa} == %{version}-%{release} +Requires: %{name}%{?_isa} == %{version}-%{release} -%description devel +%description devel This package contains libraries and header files for developing applications that use %{name}. -%package doc -Summary: Reference manual for json-c +%package doc +Summary: Reference manual for json-c -BuildArch: noarch +BuildArch: noarch -BuildRequires: doxygen -BuildRequires: hardlink +BuildRequires: doxygen +BuildRequires: hardlink -%description doc +%description doc This package contains the reference manual for %{name}. @@ -67,30 +61,32 @@ This package contains the reference manual for %{name}. %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} + %{_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 %if 0%{?bootstrap} %{__mkdir} -p bootstrap_ver pushd bootstrap_ver %{__tar} --strip-components=1 -xf %{SOURCE1} -%{__grep} -Rl '\-Werror' . | %{_bindir}/xargs %{__sed} -i -e 's!-Werror!!g' + +%{__sed} -i -e 's!#ACLOCAL_AMFLAGS!ACLOCAL_AMFLAGS!g' Makefile.am %{_bindir}/autoreconf -fiv popd %endif %build -%configure \ - --disable-silent-rules \ - --disable-static \ - --enable-rdrand \ - --enable-shared \ - --enable-threading +%configure \ + --disable-silent-rules \ + --disable-static \ + --enable-rdrand \ + --enable-shared \ + --enable-threading %make_build @@ -98,12 +94,13 @@ popd %if 0%{?bootstrap} pushd bootstrap_ver -%configure \ - --disable-rpath \ - --disable-silent-rules \ - --disable-static \ - --enable-rdrand \ - --enable-shared +%configure \ + --disable-silent-rules \ + --disable-static \ + --enable-rdrand \ + --enable-shared \ + --enable-threading + %make_build popd %endif @@ -112,9 +109,9 @@ popd %install %if 0%{?bootstrap} %make_install -C bootstrap_ver -rm -fr %{buildroot}%{_includedir}/%{name} \ - %{buildroot}%{_libdir}/lib%{name}.so \ - %{buildroot}%{_libdir}/pkgconfig +%{__rm} -fr %{buildroot}%{_includedir}/%{name} \ + %{buildroot}%{_libdir}/lib%{name}.so \ + %{buildroot}%{_libdir}/pkgconfig %endif %make_install @@ -173,6 +170,9 @@ end %changelog +* Tue Mar 06 2018 Björn Esser - 0.13.1-0.1 +- Bootstrapping for so-name bump + * Wed Feb 07 2018 Fedora Release Engineering - 0.13-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/sources b/sources index 73168d7..b38d2c5 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ +SHA512 (json-c-0.13.1-20180305.tar.gz) = 89c448eabe37d408491dd8730cb92c9f8e7463e868fb999eb40a94b47a41c9342231096b242fad891a8d80648439be8ed85cf1137f9f2089db3f656b84b2e6d8 SHA512 (json-c-0.13-20171207.tar.gz) = bac85d9107694b479549a28ce79ae6a2eb937694a7848f7f69fb8a280b20ef39249d9d31aa3f82fd5d66a887dd96b2d17717e6e37b97156a3cc44fdfaa0138e0