%global _trivial .0 %global _buildid .1 # Generated by rust2rpm 27 %bcond check 0 %global crate below %global forgeurl https://github.com/facebookincubator/below %global PKGDATE 20250919 Name: rust-below Version: 0.10.0 Release: 1%{dist}%{?_trivial}%{?_buildid} Summary: Interactive tool to view and record historical system data License: Apache-2.0 URL: https://crates.io/crates/below Source: rust-below-0.10.0-processed.tar.gz # * Get these from the repo as they aren't included in the crate Source1: %{forgeurl}/raw/v%{version}/etc/below.service Source2: %{forgeurl}/raw/v%{version}/etc/logrotate.conf # Manually created patch for downstream crate metadata changes # * temporarily loosen version bound on libbpf-* to allow 0.24 and 0.25 # * remove dependency on unstable tokio/tracing # * allow indicatif 0.18: https://github.com/facebookincubator/below/pull/8256 # Patch: below-fix-metadata.diff # Many dependencies not available ExcludeArch: %{ix86} BuildRequires: rust BuildRequires: cargo BuildRequires: llvm BuildRequires: clang BuildRequires: elfutils-libelf-devel %if 0%{?amzn} BuildRequires: rust-toolset %else BuildRequires: cargo-rpm-macros >= 24 %endif BuildRequires: systemd-rpm-macros %global _description %{expand: below is an interactive tool to view and record historical system data. It has support for: - information regarding hardware resource utilization - viewing the cgroup hierarchy - cgroup and process information - pressure stall information (PSI) - record mode to record system data - replay mode to replay historical system data e- live mode to view live system data - dump subcommand to report script-friendly information (e.g. JSON and CSV) below does not have support for cgroup1. The name "below" stems from the fact that the below developers rejected many of atop's design and style decisions.} %description %{_description} %package -n %{crate} Summary: %{summary} # (MIT OR Apache-2.0) AND Unicode-DFS-2016 # 0BSD # Apache-2.0 # Apache-2.0 OR BSL-1.0 # Apache-2.0 OR MIT # Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT # BSD-2-Clause # BSD-2-Clause OR Apache-2.0 OR MIT # LGPL-2.1-only OR BSD-2-Clause # MIT # MIT OR Apache-2.0 # MPL-2.0 OR MIT OR Apache-2.0 # Unlicense OR MIT License: %{shrink: Apache-2.0 AND (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND 0BSD AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (LGPL-2.1-only OR BSD-2-Clause) AND MIT AND (MPL-2.0 OR MIT OR Apache-2.0) AND (Unlicense OR MIT) } # LICENSE.dependencies contains a full license breakdown Recommends: logrotate %description -n %{crate} %{_description} %files -n %{crate} %license LICENSE %license LICENSE.dependencies %license cargo-vendor.txt %doc README.md %{_bindir}/below %{_unitdir}/%{crate}.service %dir %{_sysconfdir}/logrotate.d %config(noreplace) %{_sysconfdir}/logrotate.d/%{crate}.conf %dir %{_localstatedir}/log/%{crate} %post -n %{crate} %systemd_post %{crate}.service %preun -n %{crate} %systemd_preun %{crate}.service %postun -n %{crate} %systemd_postun_with_restart %{crate}.service %prep %autosetup -n %{name}-%{version} -p1 %if 0%{?amzn} %cargo_prep -v vendor %else %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %endif %build %cargo_build %{cargo_license_summary} %if 0%{?amzn} %{cargo_vendor_manifest} %endif %{cargo_license} > LICENSE.dependencies %install /usr/bin/env CARGO_HOME=.cargo RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none' cargo install %{?_smp_mflags} --profile rpm --no-track --path below install -D -p -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{crate}.service install -D -p -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{crate}.conf install -d -m1777 %{buildroot}%{_localstatedir}/log/%{crate} find %{buildroot} %if %{with check} %check # * missing memory.pressure %cargo_test -- -- --exact --skip test::record_replay_integration %endif %changelog %autochangelog