From 301e4e679aef067f5522dbcbf6a03a1830c26416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Thu, 27 Apr 2017 11:24:13 +0200 Subject: [PATCH] Update to new upstream release Introduces SONAME bump, that should have been in 0.12 already Unify %%doc General spec-file cleanup --- .gitignore | 1 + json-c.spec | 132 +++++++++++++++++++++++++++++++++------------------- sources | 2 +- 3 files changed, 87 insertions(+), 48 deletions(-) diff --git a/.gitignore b/.gitignore index 0515ecc..5445e7a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ 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 diff --git a/json-c.spec b/json-c.spec index 70b9f17..9eefe9e 100644 --- a/json-c.spec +++ b/json-c.spec @@ -1,93 +1,131 @@ -%global reldate 20140410 +%global reldate 20160607 +%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} -Name: json-c -Version: 0.12 -Release: 8%{?dist} -Summary: A JSON implementation in C -License: MIT -URL: https://github.com/json-c/json-c/wiki -Source0: https://github.com/json-c/json-c/archive/json-c-%{version}-%{reldate}.tar.gz -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: libtool + +Name: json-c +Version: 0.12.1 +Release: 1%{?dist} +Summary: JSON implementation in C + +License: MIT +URL: https://github.com/%{name}/%{name} +Source0: %{url}/archive/json-c-%{version}-%{reldate}.tar.gz + +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool %description -JSON-C implements a reference counting object model that allows you to easily -construct JSON objects in C, output them as JSON formatted strings and parse -JSON formatted strings back into the C representation of JSON objects. +JSON-C implements a reference counting object model that allows you +to easily construct JSON objects in C, output them as JSON formatted +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} -Requires: %{name}%{?_isa} = %{version}-%{release} -%description devel +%package devel +Summary: Development files for %{name} + +Requires: %{name}%{?_isa} == %{version}-%{release} + +%description devel This package contains libraries and header files for developing applications that use %{name}. -%package doc -Summary: Reference manual for json-c -%if 0%{?fedora} > 10 || 0%{?rhel} > 5 -BuildArch: noarch -%endif -%description doc +%package doc +Summary: Reference manual for json-c + +BuildArch: noarch + +BuildRequires: doxygen +BuildRequires: hardlink + +%description doc This package contains the reference manual for json-c. + %prep -%setup -qn json-c-json-c-%{version}-%{reldate} -# Get rid of maintainer mode cflags. -sed -i 's|-Werror ||g' Makefile.am.inc -# Postponed. -# Bump the soname manually. -# sed -i 's#2:1:0#3:0:0#' Makefile.am +%autosetup -n %{name}-%{name}-%{version}-%{reldate} for doc in ChangeLog; do - iconv -f iso-8859-1 -t utf8 $doc > $doc.new && - touch -r $doc $doc.new && - mv $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 's|-Werror ||g' Makefile.am.inc +%{_bindir}/autoreconf -fiv + + %build -# Get rid of rpath. -autoreconf -fiv -%configure --enable-shared --disable-static --disable-rpath --enable-rdrand +%configure \ + --disable-rpath \ + --disable-silent-rules \ + --disable-static \ + --enable-shared \ + --enable-rdrand %make_build +%{_bindir}/doxygen Doxyfile + + %install %make_install +%{_bindir}/find %{buildroot} -name '*.la' -delete -print + +%{__mkdir} -p %{buildroot}/%{_pkgdocdir} +%{__cp} -pr doc/html ChangeLog README README.* %{buildroot}/%{_pkgdocdir} +%{_sbindir}/hardlink -cvf %{buildroot}/%{_pkgdocdir} -# Get rid of la files -find %{buildroot} -name '*.la' -delete -print %check -make check +%make_build check + %pretrans devel -p -path = "%{_includedir}/json-c" +path = "%{_includedir}/%{name}" st = posix.stat(path) if st and st.type == "link" then os.remove(path) end + %post -p /sbin/ldconfig + %postun -p /sbin/ldconfig + %files -%{!?_licensedir:%global license %%doc} +%doc %dir %{_pkgdocdir} +%license AUTHORS %license COPYING -%{_libdir}/libjson-c.so.* +%{_libdir}/lib%{name}.so.* + %files devel -%doc AUTHORS ChangeLog README README.html -%{_includedir}/json-c/ -%{_libdir}/libjson-c.so -%{_libdir}/pkgconfig/json-c.pc +%doc %dir %{_pkgdocdir} +%doc %{_pkgdocdir}/ChangeLog +%doc %{_pkgdocdir}/README* +%{_includedir}/%{name}/ +%{_libdir}/lib%{name}.so +%{_libdir}/pkgconfig/%{name}.pc + %files doc -%doc doc/html/* +%if 0%{?fedora} || 0%{?rhel} >= 7 +%license %{_datadir}/licenses/%{name}* +%endif # 0%%{?fedora} || 0%%{?rhel} >= 7 +%doc %{_pkgdocdir} + %changelog +* Thu Apr 27 2017 Björn Esser - 0.12.1-1 +- Update to new upstream release +- Introduces SONAME bump, that should have been in 0.12 already +- Unify %%doc +- General spec-file cleanup + * Fri Feb 10 2017 Fedora Release Engineering - 0.12-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/sources b/sources index 262d10b..e23f9ae 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -39705ae46b1c0c64f1d32d26653c8e7e json-c-0.12-20140410.tar.gz +SHA512 (json-c-0.12.1-20160607.tar.gz) = 1e4e63b3a9dbd959049955a2fa548067edd394d7d7fa7a8ae86dbad3a7ed02058bc6353aefacd0cb56f3ec4bc01858c80d74a5264eb381eb4c7c15dee5fb81a6