Blob Blame History Raw
# Generated by rust2rpm
%bcond_without check
%global debug_package %{nil}

%global crate rmp

Name:           rust-%{crate}
Version:        0.8.7
Release:        1%{?dist}
Summary:        Pure Rust MessagePack serialization implementation

# https://github.com/3Hren/msgpack-rust/issues/192
License:        MIT
URL:            https://crates.io/crates/rmp
Source:         %{crates_source}
# Initial patched metadata
# - Bump num-traits to 0.2 https://github.com/3Hren/msgpack-rust/pull/193
# - Bump quickcheck to 0.8 https://github.com/3Hren/msgpack-rust/pull/194
Patch0:         rmp-fix-metadata.diff
# Patch which fix some tests
Patch1:         https://github.com/3Hren/msgpack-rust/commit/e96d118f7b915ff65e6c14dcccdecffb664f94ab.patch#/0001-fix-weaken-cursor-restrictions-in-tests.patch
ExclusiveArch:  %{rust_arches}

BuildRequires:  rust-packaging
BuildRequires:  (crate(byteorder/default) >= 1.0.0 with crate(byteorder/default) < 2.0.0)
BuildRequires:  (crate(num-traits/default) >= 0.2.0 with crate(num-traits/default) < 0.3.0)
%if %{with check}
BuildRequires:  (crate(quickcheck/default) >= 0.8.0 with crate(quickcheck/default) < 0.9.0)
%endif

%global _description \
Pure Rust MessagePack serialization implementation.

%description %{_description}

%package        devel
Summary:        %{summary}
BuildArch:      noarch

%description    devel %{_description}

This package contains library source intended for building other packages
which use "%{crate}" crate.

%files          devel
%doc CHANGELOG.md README.md
%{cargo_registry}/%{crate}-%{version}/

%package     -n %{name}+default-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+default-devel %{_description}

This package contains library source intended for building other packages
which use "default" feature of "%{crate}" crate.

%files       -n %{name}+default-devel
%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml

%prep
%autosetup -N -n %{crate}-%{version_no_tilde}
%patch0 -p1
%patch1 -p2
%cargo_prep

%build
%cargo_build

%install
%cargo_install

%if %{with check}
%check
%cargo_test
%endif

%changelog
* Thu Mar 28 07:18:34 CET 2019 Robert-André Mauchin <zebob.m@gmail.com> - 0.8.7-1
- Initial package