Blob Blame History Raw
%global modulename %{name}-c++

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

License:        MIT
URL:            https://capnproto.org
Source0:        https://capnproto.org/%{modulename}-%{version}.tar.gz

# Patches pending upstream
# Make libraries versioned
# See: https://github.com/capnproto/capnproto/pull/495
Patch100:       capnproto-0.6.1-CMake-Add-versioning-to-the-libraries.patch

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

# Due to the nature of the patches, we need to rebuild the build scripts
%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires:  cmake >= 3.1
%endif

%if 0%{?rhel} && 0%{?rhel} < 8
BuildRequires:  cmake3 >= 3.1
%endif

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

%description
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}.


%prep
%autosetup -n %{modulename}-%{version} -p2

%build
%{?cmake3:%cmake3}%{!?cmake3:%cmake}

# 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

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


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


%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig


%files
%{_bindir}/capnp
%{_bindir}/capnpc
%{_bindir}/capnpc-c++
%{_bindir}/capnpc-capnp

%files libs
%license LICENSE.txt
%{_libdir}/*.so.*

%files devel
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_libdir}/cmake/CapnProto/

%changelog
* Fri Jun 09 2017 Neal Gompa <ngompa13@gmail.com> - 0.6.1-3
- Update patch based on upstream feedback

* Fri Jun 09 2017 Neal Gompa <ngompa13@gmail.com> - 0.6.1-2
- Adjust soversion patch to maintain binary compat across patch versions

* Fri Jun 09 2017 Neal Gompa <ngompa13@gmail.com> - 0.6.1-1
- Update to 0.6.1

* Mon Feb 27 2017 Neal Gompa <ngompa13@gmail.com> - 0.5.3-4
- Add patch to fix FTBFS with GCC 7 (#1423291)

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Apr 28 2016 Neal Gompa <ngompa13@gmail.com> - 0.5.3-2
- Add patches to fix ppc builds

* Tue Apr 26 2016 Neal Gompa <ngompa13@gmail.com> - 0.5.3-1
- Initial packaging