## START: Set by rpmautospec
## (rpmautospec version 0.3.0)
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

# Generated by rust2rpm 20
%bcond_without check

Name:           softnet-stat
Version:        2.0.0
Release:        %autorelease
Summary:        Parse the `/proc/net/softnet_stat` file into something more readable

# Upstream license specification: GPL-3.0
License:        GPLv3+
URL:            https://github.com/hjr3/softnet-stat
Source:         https://github.com/hjr3/softnet-stat/archive/refs/tags/v%{version}.tar.gz

ExclusiveArch:  %{rust_arches}

BuildRequires:  rust-packaging

%global _description %{expand:
This tool parse raw data provided by kernel in /proc/net/softnet_stat 
to different formats: 
  - human readable format
  - JSON format
  - Prometheus format
to enable easier troubleshooting of the softnet related network issue.}

%description %{_description}

%files
%license LICENSE
%doc README.md
%{_bindir}/softnet-stat

%prep
%autosetup -n softnet-stat-%{version} -p1
%cargo_prep

%generate_buildrequires
%cargo_generate_buildrequires

%build
%cargo_build

%install
%cargo_install

%if %{with check}
%check
%cargo_test
%endif

%changelog
* Fri Sep 02 2022 Qiyu Yan <yanqiyu@fedoraproject.org> 2.0.0-1
- Initial Import (#2047247)