diff --git a/.gitignore b/.gitignore index 6bda929..6766398 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /conmon-rs-0.5.1.tar.gz +/conmonrs-v0.5.1-vendor.tar.gz diff --git a/SPECS/conmon-rs.spec b/SPECS/conmon-rs.spec index 52fed41..e412db8 100644 --- a/SPECS/conmon-rs.spec +++ b/SPECS/conmon-rs.spec @@ -18,13 +18,19 @@ Release: 1%{?dist} Summary: Container monitor in Rust License: ASL 2.0 and BSD and ISC and MIT URL: https://github.com/containers/conmon-rs -Source0: https://github.com/containers/conmon-rs/archive/v%{version}/%{name}-%{version}.tar.gz - +Source0: https://github.com/containers/conmon-rs/releases/download/v%{version}/%{name}-%{version}.tar.gz +# Only for CentOS/RHEL builds +Source1: https://github.com/containers/conmon-rs/releases/download/v%{version}/%{bin_name}-v%{version}-vendor.tar.gz BuildRequires: capnproto BuildRequires: cargo BuildRequires: git-core BuildRequires: make BuildRequires: protobuf-compiler +%if 0%{?rhel} +BuildRequires: rust-toolset +%else +BuildRequires: rust-packaging +%endif Provides: %{bin_name} ExclusiveArch: %{rust_arches} @@ -32,7 +38,17 @@ ExclusiveArch: %{rust_arches} %{summary}. %prep -%autosetup -Sgit -n %{name}-%{version} +%autosetup -n %{name}-%{version} +%if 0%{?rhel} +%cargo_prep -V 1 +%else +%cargo_prep +%endif + +%if !0%{?rhel} +%generate_buildrequires +%cargo_generate_buildrequires +%endif %build %{__make} release diff --git a/sources b/sources index d2ebe0d..f677f17 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (conmon-rs-0.5.1.tar.gz) = 5bb949ed4dfe4e2c87502df451e67e3a44f5bfa193a7d4ea9ebe3cdc86c98a1d43aeb1272ed01358e865f0952bea7e3ab1e9263f7f11818ecb631284ef582176 +SHA512 (conmonrs-v0.5.1-vendor.tar.gz) = 5ccd23b31e294d76a49be9918e57fcc356c46cb3360fb2bc5b53e0681134ad4a2f25b362dbd232c48b6d58f7fc38b4db0bab5f6ff1ab26d14e9450225f508f06