#
# spec file for package riemann-c-client
#
# Copyright (c) 2014 Peter Czanik, Budapest, Hungary.
#

Name:		riemann-c-client
Version:	1.10.4
Release:	2%{?dist}
Summary:	The riemann C client
License:	GPLv2
Url:		https://github.com/algernon/riemann-c-client
Source:		https://github.com/algernon/riemann-c-client/releases/download/riemann-c-client-%{version}/riemann-c-client-%{version}.tar.xz
BuildRequires:	pkgconfig
BuildRequires:	protobuf-c-devel
BuildRequires:	json-c-devel
BuildRequires:	chrpath
BuildRequires:  gnutls-devel
BuildRequires:	gcc

%description
This is a C client library for the Riemann monitoring system, providing a
convenient and simple API, high test coverage and a copyleft license,
along with API and ABI stability.

%package devel
Summary:	Development files for riemann-c-client
Requires:	%{name}%{?_isa} = %{version}-%{release}
Requires:	protobuf-c-devel%{?_isa}
Requires:	json-c-devel

%description devel
This package provides files necessary for riemann-c-client development.

%prep
%setup -q

%build
%if "%{dist}" == ".el6"
PKG_CONFIG_PATH=/%{_lib}/pkgconfig %configure --disable-static
%else
%configure --disable-static
%endif

make %{_smp_mflags}

%install
make DESTDIR=${RPM_BUILD_ROOT} install

chrpath --delete $RPM_BUILD_ROOT%{_bindir}/riemann-client

rm %{buildroot}/%{_libdir}/libriemann-client.la

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%doc README.md NEWS.md
%{_libdir}/libriemann-client.so.*
%{_bindir}/riemann-client
%{_mandir}/man1/*.1*

%files devel
%{_includedir}/riemann/
%{_libdir}/libriemann-client.so
%{_libdir}/pkgconfig/riemann-client.pc

%changelog
* Sun May 12 2019 Peter Czanik <peter@czanik.hu> - 1.10.4
- update to version 1.10.4

* Tue Sep  6 2016 Peter Czanik <czanik@balabit.hu> - 1.9.01
- update to 1.9.0 with mostly TLS relatedfixes

* Fri Apr 24 2015 Peter Czanik - 1.6.1-4
- new upstream which brings TLS support
- add patch to fix gnutls support on F20
- add workaround to detect json on EL6

* Thu Aug 14 2014 Peter Czanik <czanik@balabit.hu> - 1.2.1-3
- cleanup based on reviews at (#1129630)

* Mon Aug 11 2014 Peter Czanik <czanik@balabit.hu> - 1.2.1-1
- update to 1.2.1 (bugfix release)

* Thu Feb 27 2014 Peter Czanik <czanik@balabit.hu> - 1.1.0-1
- initial release