Update to new upstream release

Introduces SONAME bump, that should have been in 0.12 already
Unify %%doc
General spec-file cleanup
This commit is contained in:
Björn Esser 2017-04-27 11:24:13 +02:00
parent fdf4b42349
commit 301e4e679a
3 changed files with 87 additions and 48 deletions

1
.gitignore vendored
View File

@ -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

View File

@ -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 <lua>
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 <besser82@fedoraproject.org> - 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 <releng@fedoraproject.org> - 0.12-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

View File

@ -1 +1 @@
39705ae46b1c0c64f1d32d26653c8e7e json-c-0.12-20140410.tar.gz
SHA512 (json-c-0.12.1-20160607.tar.gz) = 1e4e63b3a9dbd959049955a2fa548067edd394d7d7fa7a8ae86dbad3a7ed02058bc6353aefacd0cb56f3ec4bc01858c80d74a5264eb381eb4c7c15dee5fb81a6