## START: Set by rpmautospec ## (rpmautospec version 0.2.5) %define autorelease(e:s:pb:) %{?-p:0.}%{lua: release_number = 3; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} ## END: Set by rpmautospec # Generated by rust2rpm 18 %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 %global version_no_tilde %{version} %endif %global forgeurl https://github.com/facebookincubator/below Name: rust-%{crate} Version: 0.4.1 Release: %autorelease 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} # Initial patched metadata # Downgrade edition to 2018 and patch a number of crates to use the ones # distributed in the vendor tarball; this is meant to to be applied only for # EPEL builds Patch0: below-fix-metadata.diff # 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 # patched crates and 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 ExclusiveArch: %{rust_arches} %if 0%{?el8} BuildRequires: rust-toolset BuildRequires: sed # for libbpf-sys BuildRequires: kernel-headers BuildRequires: elfutils-libelf-devel BuildRequires: libbpf-devel BuildRequires: zlib-devel # for libbpf-cargo BuildRequires: clang BuildRequires: rustfmt %else BuildRequires: rust-packaging %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 - 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} Recommends: logrotate %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 %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 %setup -q -n %{crate}-%{version_no_tilde} %if 0%{?el8} %cargo_prep -V 4 %patch0 -p1 cp -p %{SOURCE5} README-epel.md %ifarch s390x # drop opt-level generation to fix s390x OOM problems sed -i 's/opt-level=3/opt-level=1/' .cargo/config %endif %else %cargo_prep %endif cp -p %{SOURCE3} README.md %if 0%{?fedora} %generate_buildrequires %cargo_generate_buildrequires %endif %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 install -d -m1777 %{buildroot}%{_localstatedir}/log/%{crate} %if %{with check} %check %cargo_test %endif %changelog * Tue Jan 25 2022 Fabio Valentini 0.4.1-3 - Rebuild with thread_local 1.1.4 for RUSTSEC-2022-0006 * Fri Jan 21 2022 Fedora Release Engineering 0.4.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Thu Nov 11 2021 Davide Cavalca 0.4.1-1 - Update to 0.4.0; Fixes: RHBZ#2022244 * Thu Oct 28 2021 Davide Cavalca 0.4.0-2 - Update vendoring logic to fix the epel8 build; Fixes: RHBZ#1978414 * Fri Oct 22 2021 Davide Cavalca 0.4.0-1 - Update to 0.4.0; Fixes: RHBZ#2016559 * Sat Jul 31 2021 Davide Cavalca 0.3.0-1 - Update to 0.3.0; Fixes: RHBZ#1983801 * Fri Jul 23 2021 Fedora Release Engineering - 0.2.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Tue Jul 6 2021 Michel Alexandre Salim - 0.2.0-4 - Add README-epel.md with instructions for enabling PSI support - Gate ExclusiveArch s390x to el8 only * Wed Jun 30 2021 Davide Cavalca - 0.2.0-3 - Add vendored dependencies for EPEL and make it build there - Exclude s390x for the EPEL build for now due to an upstream issue - Mark logrotate config file as a config(noreplace) - Add recommends for logrotate - Fix permissions for the below binary * Mon Jun 28 2021 Davide Cavalca - 0.2.0-2 - Install upstream systemd unit - Install upstream logrotate config - Add missing documentation - Expand the description * Tue Jun 15 2021 Davide Cavalca - 0.2.0-1 - Initial package