Build for epel8

epel9
Davide Cavalca 3 years ago
parent cd5172d56f
commit 45252a1224

1
.gitignore vendored

@ -1 +1,2 @@
/resctl-demo-2.1.2.crate
/resctl-demo-2.1.2-vendor.tar.gz

@ -4,6 +4,15 @@
%global crate resctl-demo
%if 0%{?el8}
# disabling this as it chokes on the vendored dependencies
%undefine __brp_mangle_shebangs
# el8 doesn't have these macros
%global __crates_url https://crates.io/api/v1/crates/
%global crates_source %{__crates_url}%{crate}/%{version}/download#/%{crate}-%{version}.crate
%global version_no_tilde %{version}
%endif
Name: rust-%{crate}
Version: 2.1.2
Release: %autorelease
@ -13,10 +22,16 @@ Summary: Guided tour of Linux resource control with live demos
License: ASL 2.0 and BSD and MIT
URL: https://crates.io/crates/resctl-demo
Source: %{crates_source}
# Vendored dependencies for EPEL, update with ./update-vendor-tarball.sh
Source1: %{crate}-%{version}-vendor.tar.gz
ExclusiveArch: %{rust_arches}
%if 0%{?el8}
BuildRequires: rust-toolset
%else
BuildRequires: rust-packaging
%endif
%global _description %{expand:
resctl-demo demonstrates and documents various aspects of resource control
@ -40,10 +55,14 @@ Requires: gnuplot
%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1
%if 0%{?el8}
%cargo_prep -V 1
%else
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
%endif
%build
%cargo_build

@ -1 +1,2 @@
SHA512 (resctl-demo-2.1.2.crate) = 76d7c962aa0611fa1dc750e856499c20b53224078a8ddfe2fe1dc6e580aca6c4147becc45216a19722f8da52959e262271509c44fe2e7582c783cc4005981246
SHA512 (resctl-demo-2.1.2-vendor.tar.gz) = f9f4adeeb2e147744ae0121b6b41ca25b527083139142f8c71be2428dae5fd67d11600f3bd299da51ec5c68087338de80b8be01d0273df90c1aabcd798cd60b3

@ -0,0 +1,25 @@
#!/bin/sh
name='resctl-demo'
specfile="rust-${name}.spec"
version=$(rpm -q --qf '%{VERSION}\n' --specfile "$specfile" | head -1)
nv="${name}-${version}"
crate="${nv}.crate"
vendor_tarball="${nv}-vendor.tar.gz"
if [ -f "$vendor_tarball" ]; then
echo "${vendor_tarball} already exists, aborting"
exit 1
fi
[ -f "$crate" ] || spectool -g "$specfile"
tardir="$PWD"
workdir=$(mktemp -d)
trap 'rm -rf "$workdir"' EXIT
tar xvzf "$tardir/$crate" -C "$workdir"
(cd "${workdir}/${nv}" && \
cargo vendor && \
tar cvzf "${tardir}/${vendor_tarball}" vendor/)
exit 0
Loading…
Cancel
Save