## START: Set by rpmautospec
## (rpmautospec version 0.3.0)
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 8;
    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 go2rpm 1.6.0
%ifarch x86_64
%bcond_without check
%endif

# https://github.com/intel/goresctrl
%global goipath         github.com/intel/goresctrl
Version:                0.2.0

%gometa

%global common_description %{expand:
Golang library for managing resctrl filesystem.}

%global golicenses      LICENSE
%global godocs          doc README.md

Name:           %{goname}
Release:        %autorelease
Summary:        Golang library for managing resctrl filesystem

# Upstream license specification: Apache-2.0
License:        ASL 2.0
URL:            %{gourl}
Source0:        %{gosource}

BuildRequires:  golang(github.com/hashicorp/go-multierror)
BuildRequires:  golang(github.com/opencontainers/runtime-spec/specs-go)
BuildRequires:  golang(github.com/prometheus/client_golang/prometheus)
BuildRequires:  golang(golang.org/x/sys/unix)
BuildRequires:  golang(k8s.io/apimachinery/pkg/api/resource)
BuildRequires:  golang(sigs.k8s.io/yaml)

%if %{with check}
# Tests
BuildRequires:  golang(github.com/google/go-cmp/cmp)
%endif

%description
%{common_description}

%gopkg

%prep
%goprep

%ifarch x86_64
%build
for cmd in cmd/* ; do
  %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
done
%endif

%install
%gopkginstall
%ifarch x86_64
install -m 0755 -vd                     %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
%endif

%if %{with check}
%check
%gocheck -d pkg/blockio
%endif

%ifarch x86_64
%files
%license LICENSE
%doc doc README.md
%{_bindir}/*
%endif

%gopkgfiles

%changelog
* Sun Jan 30 2022 Robert-André Mauchin <zebob.m@gmail.com> 0.2.0-2
- Uncommitted changes

* Sun Jan 30 2022 Robert-André Mauchin <zebob.m@gmail.com> 0.2.0-1
- Initial release