File capnproto.spec of Package capnproto

%global modulename %{name}-c++

Name:           capnproto
Release:        1%{?dist}
Summary:        A data interchange format and capability-based RPC system

License:        MIT

# Patches from Debian to fix FTBFS and tests on PowerPC
Patch0:         capnproto-0.5.3-fix-eagain-test-failure.patch
Patch1:         capnproto-0.5.3-big-endian-async-unix.patch

# We need C++
BuildRequires:  gcc-c++

# Due to the nature of the patches, we need to rebuild the build scripts
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  m4
BuildRequires:  libtool

# Ensure that we use matching version of libraries
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}

Cap’n Proto is an insanely fast data interchange format
and capability-based RPC system. Think JSON, except binary.
Or think Protocol Buffers, except faster. In fact, in benchmarks,
Cap’n Proto is INFINITY TIMES faster than Protocol Buffers.

This package contains the schema compiler and command-line
encoder/decoder tools.

%package        libs
Summary:        Libraries for %{name}

%description    libs
The %{name}-libs package contains the libraries for using %{name}
in applications.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%autosetup -n %{modulename}-%{version} -p1

autoreconf -fiv
%configure --disable-static

# Kill hardcoded paths
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

# Make runs a simple test, and that test needs to be able to find the
# just-built libraries.
LD_LIBRARY_PATH=$(pwd)/.libs:$(pwd)/gtest/lib/.libs %make_build

# The make check builds bundled gtest (but doesn't install it!)
LD_LIBRARY_PATH=$(pwd)/.libs:$(pwd)/gtest/lib/.libs %make_build check

find %{buildroot} -name '*.la' -exec rm -f {} ';'

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig


%files libs
%license LICENSE.txt

%files devel

* Fri Jun 09 2017 Neal Gompa <> -
- Update to to resolve CVE-2017-7892

* Thu Apr 28 2016 Neal Gompa <> - 0.5.3-2
- Add patches to fix ppc builds

* Tue Apr 26 2016 Neal Gompa <> - 0.5.3-1
- Initial packaging