diff --git a/.gitignore b/.gitignore index 71c0ef5..ddb3aeb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1 @@ -json-c.spec~ -clog -/json-c-0.11-20130402.tar.gz -/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 +/json-c-*.tar.gz diff --git a/0001-Fix-CMake-tests-for-enforced-strict-prototypes.patch b/0001-Fix-CMake-tests-for-enforced-strict-prototypes.patch new file mode 100644 index 0000000..014412e --- /dev/null +++ b/0001-Fix-CMake-tests-for-enforced-strict-prototypes.patch @@ -0,0 +1,34 @@ +From 053eaa61d7f69dec0b9d744809b189c80583150b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Tue, 14 Apr 2020 20:42:32 +0200 +Subject: [PATCH] Fix CMake tests for enforced strict prototypes. + +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 04d21f9..c645d58 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -260,7 +260,7 @@ if (NOT ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")) + /* uClibc toolchains without threading barf when _REENTRANT is defined */ + #define _REENTRANT 1 + #include +- int main () ++ int main (void) + { + return 0; + } +@@ -276,7 +276,7 @@ if (NOT ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")) + list(APPEND CMAKE_REQUIRED_LIBRARIES "-Wl,-Bsymbolic-functions") + check_c_source_compiles( + [=[ +- int main () ++ int main (void) + { + return 0; + } +-- +2.26.0 + diff --git a/json-c.spec b/json-c.spec index 6b41510..fedddbe 100644 --- a/json-c.spec +++ b/json-c.spec @@ -1,28 +1,33 @@ %{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} -%global so_ver 4 -%global reldate 20180305 +# We don't want accidental SONAME bumps. +%global so_ver 4 + + +# Use 'commit' for snapshots and 'tag' for releases. +%global commit ab5425a6a600807d2c17eaa7d1dc7b4093f794aa +#global tag json-c-0.13.1-20180305 +%global forgeurl https://github.com/json-c/json-c +%forgemeta Name: json-c -Version: 0.13.1 -Release: 11%{?dist} +Version: 0.13.99 +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 +URL: %{forgeurl} +Source0: %{forgesource} -# Cherry-picked from upstream. -Patch0: %{url}/commit/da4b34355da023c439e96bc6ca31886cd69d6bdb.patch#/%{name}-0.13.1-parse_test_UTF8_BOM.patch -Patch1: %{url}/commit/f8c632f579c71012f9aca81543b880a579f634fc.patch#/%{name}-0.13.1-fix_incorrect_casts_in_calls_to_ctype_functions.patch -Patch2: %{url}/commit/8bd62177e796386fb6382db101c90b57b6138afe.patch#/%{name}-0.13.1-fix_typos.patch +Patch0001: 0001-Fix-CMake-tests-for-enforced-strict-prototypes.patch -BuildRequires: autoconf -BuildRequires: automake +BuildRequires: cmake BuildRequires: gcc -BuildRequires: libtool BuildRequires: make +%ifarch %{valgrind_arches} +BuildRequires: valgrind +%endif %description JSON-C implements a reference counting object model that allows you @@ -33,7 +38,6 @@ of JSON objects. It aims to conform to RFC 7159. %package devel Summary: Development files for %{name} - Requires: %{name}%{?_isa} = %{version}-%{release} %description devel @@ -54,43 +58,37 @@ This package contains the reference manual for %{name}. %prep -%autosetup -n %{name}-%{name}-%{version}-%{reldate} -p 1 - -for doc in ChangeLog; do - iconv -f iso-8859-1 -t utf8 ${doc} > ${doc}.new - touch -r ${doc} ${doc}.new - mv -f ${doc}.new ${doc} -done - -sed -i -e 's!#ACLOCAL_AMFLAGS!ACLOCAL_AMFLAGS!g' Makefile.am -autoreconf -fiv +%forgeautosetup -p 1 %build -%configure \ - --disable-silent-rules \ - --disable-static \ - --disable-rdrand \ - --enable-Bsymbolic \ - --enable-shared \ - --enable-threading -%make_build -doxygen Doxyfile +mkdir -p %{_vpath_builddir} +%cmake \ + -DCMAKE_BUILD_TYPE:STRING=RELEASE \ + -DCMAKE_C_FLAGS_RELEASE:STRING="" \ + -DDISABLE_BSYMBOLIC:BOOL=OFF \ + -DDISABLE_WERROR:BOOL=OFF \ + -DENABLE_RDRAND:BOOL=OFF \ + -DENABLE_THREADING:BOOL=ON \ + -B $PWD/%{_vpath_builddir} \ + -S $PWD +%make_build -C %{_vpath_builddir} all doc %install -%make_install - -find %{buildroot} -name '*.a' -delete -print -find %{buildroot} -name '*.la' -delete -print +%make_install -C %{_vpath_builddir} +# Documentation mkdir -p %{buildroot}%{_pkgdocdir} -cp -pr doc/html ChangeLog README README.* %{buildroot}%{_pkgdocdir} +cp -a %{_vpath_builddir}/doc/html ChangeLog README README.* \ + %{buildroot}%{_pkgdocdir} hardlink -cvf %{buildroot}%{_pkgdocdir} %check -%make_build check +pushd %{_vpath_builddir} +ctest %{_smp_mflags} --output-on-failure +popd %ldconfig_scriptlets @@ -107,6 +105,7 @@ hardlink -cvf %{buildroot}%{_pkgdocdir} %doc %{_pkgdocdir}/ChangeLog %doc %{_pkgdocdir}/README* %{_includedir}/%{name} +%{_libdir}/cmake/%{name} %{_libdir}/lib%{name}.so %{_libdir}/pkgconfig/%{name}.pc @@ -119,6 +118,9 @@ hardlink -cvf %{buildroot}%{_pkgdocdir} %changelog +* Tue Apr 14 2020 Björn Esser - 0.13.99-0.1.20200414gitab5425a +- Update to recent git snapshot using forge macros + * Sun Apr 12 2020 Björn Esser - 0.13.1-11 - Drop bootstrap logic, as the package is no dependency of @build anymore - Add some explicit BuildRequires, which were implicit diff --git a/sources b/sources index 1ee247c..a66a668 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (json-c-0.13.1-20180305.tar.gz) = 89c448eabe37d408491dd8730cb92c9f8e7463e868fb999eb40a94b47a41c9342231096b242fad891a8d80648439be8ed85cf1137f9f2089db3f656b84b2e6d8 +SHA512 (json-c-ab5425a6a600807d2c17eaa7d1dc7b4093f794aa.tar.gz) = 435fa8435d2fb5da33f09e5afb55a217d01bbae159b525be636078c20f5a5e714315c40bb820b9eedb4f5777a1b3992bdb8c77ad6a8604419240713a9a8239dd