You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rust-below/rust-below.spec

134 lines
3.4 KiB

# Generated by rust2rpm 18
4 years ago
%bcond_without check
%global __cargo_skip_build 0
%global crate below
%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
%endif
%global forgeurl https://github.com/facebookincubator/below
4 years ago
Name: rust-%{crate}
Version: 0.3.0
Release: %autorelease
4 years ago
Summary: Interactive tool to view and record historical system data
# Upstream license specification: Apache-2.0
License: ASL 2.0
URL: https://crates.io/crates/below
Source: %{crates_source}
# 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
Source3: %{forgeurl}/raw/v%{version}/README.md#/README-upstream.md
# vendored dependencies for EPEL
# update with ./update-vendor-tarball.sh after bumping the specfile version
Source4: %{crate}-%{version}-vendor.tar.gz
# EPEL specific doc
Source5: README-epel.md
4 years ago
ExclusiveArch: %{rust_arches}
%if 0%{?el8}
BuildRequires: rust-toolset
# for libbpf-sys
BuildRequires: kernel-headers
BuildRequires: elfutils-libelf-devel
BuildRequires: libbpf-devel
BuildRequires: zlib-devel
# for libbpf-cargo
BuildRequires: clang
BuildRequires: rustfmt
%else
4 years ago
BuildRequires: rust-packaging
%endif
BuildRequires: systemd-rpm-macros
4 years ago
%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
- 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.}
4 years ago
%description %{_description}
%package -n %{crate}
Summary: %{summary}
Recommends: logrotate
4 years ago
%description -n %{crate} %{_description}
%files -n %{crate}
%license LICENSE
%doc README.md
%if 0%{?el8}
%doc README-epel.md
%endif
%attr(755, root, root) %{_bindir}/%{crate}
%{_unitdir}/%{crate}.service
%config(noreplace) %{_sysconfdir}/logrotate.d/%{crate}.conf
4 years ago
%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
4 years ago
%prep
%if 0%{?el8}
%setup -q -n %{crate}-%{version}
%cargo_prep -V 4
cp -p %{SOURCE5} README-epel.md
%else
4 years ago
%autosetup -n %{crate}-%{version_no_tilde} -p1
%cargo_prep
%endif
cp -p %{SOURCE3} README.md
4 years ago
%if 0%{?fedora}
4 years ago
%generate_buildrequires
%cargo_generate_buildrequires
%endif
4 years ago
%build
%cargo_build
%install
%cargo_install
install -D -p -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{crate}.service
install -D -p -m0644 %{SOURCE2} \
%{buildroot}%{_sysconfdir}/logrotate.d/%{crate}.conf
4 years ago
install -d -m1777 %{buildroot}%{_localstatedir}/log/%{crate}
%if %{with check}
%check
%cargo_test
%endif
%changelog
%autochangelog