## START: Set by rpmautospec
## (rpmautospec version 0.6.0)
## RPMAUTOSPEC: autorelease, autochangelog
%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

Name:		wult
Version:	1.12.26
Release:	%autorelease
Summary:	A tool for measuring C-state latency in Linux

License:	BSD-3-Clause AND GPL-2.0-only
Url:		https://github.com/intel/wult
Source0:	%url/archive/v%{version}/%{name}-%{version}.tar.gz

# exclude backup kernel driver and duplications
Patch0:		exclude-dirs.patch

# measuring C-state latency for Intel architectures  
ExclusiveArch:	x86_64

BuildRequires:	bpftool
BuildRequires:	clang
BuildRequires:	gcc
BuildRequires:	make
BuildRequires:	kernel-devel
BuildRequires:	libbpf-devel
BuildRequires:	python3-devel
BuildRequires:	python3-pytest
Requires:	pciutils
Requires:	pepc
Requires:	python3-%{name} = %{version}-%{release}

%description
The name Wult comes from "Wake Up Latency Tracer". Wult measures C-state
latency by scheduling a delayed interrupt at a known time in the future, so it
relies on devices allowing for delayed interrupts. Today wult can use LAPIC as
the source of delayed interrupts, as well as I210 PCIe Gigabit Ethernet
adapter. However, other devices could be supported as well, for example other
Intel Ethernet adapters.

%package -n python3-%{name}
Summary:	Wult Python library
BuildArch:	noarch

%description -n python3-%{name}
Wult Python libraries

%prep
%autosetup -p1 -n %{name}-%{version}

%generate_buildrequires
%pyproject_buildrequires -r

%build
%pyproject_wheel

%make_build -C helpers/ndl-helper
%make_build -C helpers/wult-freq-helper
%make_build -C helpers/wult-hrt-helper
%make_build -C helpers/wult-tdt-helper

%install
%pyproject_install
%pyproject_save_files wultlibs wulttools

install -pDm755 helpers/ndl-helper/ndl-helper %{buildroot}%{_bindir}/ndl-helper
install -pDm755 helpers/wult-freq-helper/wult-freq-helper %{buildroot}%{_bindir}/wult-freq-helper
install -pDm755 helpers/wult-hrt-helper/wult-hrt-helper %{buildroot}%{_bindir}/wult-hrt-helper
install -pDm755 helpers/wult-tdt-helper/wult-tdt-helper %{buildroot}%{_bindir}/wult-tdt-helper

%check
%pytest -v

%files
%doc README.md CHANGELOG.md
%license LICENSE.md
%{_bindir}/exercise-sut
%{_bindir}/ndl
%{_bindir}/ndl-helper
%{_bindir}/pbe
%{_bindir}/wult
%{_bindir}/wult-freq-helper
%{_bindir}/wult-hrt-helper
%{_bindir}/wult-tdt-helper
%{_datadir}/wult
%{_mandir}/man1/exercise-sut*.1.gz
%{_mandir}/man1/ndl-*1.gz
%{_mandir}/man1/pbe-*1.gz
%{_mandir}/man1/wult-*.1.gz

%files -n python3-%{name} -f %{pyproject_files}

%changelog
## START: Generated by rpmautospec
* Fri Sep 20 2024 Ali Erdinc Koroglu <aekoroglu@linux.intel.com> - 1.12.26-1
- Update to 1.12.26

* Fri Aug 02 2024 Ali Erdinc Koroglu <aekoroglu@linux.intel.com> - 1.12.23-1
- Update to 1.12.23

* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.20-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Fri Jul 12 2024 Ali Erdinc Koroglu <aekoroglu@linux.intel.com> - 1.12.20-1
- update to 1.12.20

* Tue Jun 18 2024 Python Maint <python-maint@redhat.com> - 1.12.18-2
- Rebuilt for Python 3.13

* Mon Apr 15 2024 Ali Erdinc Koroglu <aekoroglu@linux.intel.com> - 1.12.18-1
- update to 1.12.18

* Mon Feb 26 2024 Ali Erdinc Koroglu <aekoroglu@linux.intel.com> - 1.12.16-1
- Update to 1.12.16

* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.14-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Tue Jan 16 2024 Ali Erdinc Koroglu <aekoroglu@linux.intel.com> - 1.12.14-1
- Update to 1.12.14

* Tue Oct 31 2023 Ali Erdinc Koroglu <aekoroglu@linux.intel.com> - 1.12.13-1
- Update to 1.12.13

* Thu Aug 24 2023 Ali Erdinc Koroglu <aekoroglu@linux.intel.com> - 1.12.9-1
- update to 1.12.9

* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Tue Jul 11 2023 Python Maint <python-maint@redhat.com> - 1.12.2-2
- Rebuilt for Python 3.12

* Wed Jun 28 2023 Ali Erdinc Koroglu <aekoroglu@linux.intel.com> - 1.12.2-1
- update to 1.12.2

* Tue Jun 13 2023 Ali Erdinc Koroglu <aekoroglu@linux.intel.com> - 1.12.1-1
- update to 1.12.1

* Tue May 09 2023 Ali Erdinc Koroglu <aekoroglu@linux.intel.com> - 1.11.16-1
- Update to 1.11.16

* Tue Mar 21 2023 aekoroglu <aekoroglu@linux.intel.com> - 1.11.5-1
- Update 1.11.5

* Mon Mar 06 2023 aekoroglu <aekoroglu@linux.intel.com> - 1.11.3-1
- update to 1.11.3

* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.54-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Tue Jan 17 2023 aekoroglu <aekoroglu@linux.intel.com> - 1.10.54-1
- Initial release
## END: Generated by rpmautospec