## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## 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 # The documentation doesn't build at the moment, use the prebuilt one instead %bcond_with doc %if 0%{?fedora} && 0%{?fedora} >= 42 # kernel 6.13.6 from Fedora 41 is too old for v4.1.2 %bcond_without system_amd_hsmp %else %bcond_with system_amd_hsmp %endif Name: esmi_ib_library Version: 4.1.2 %global major_version %(echo %{version} | cut -d. -f1) %global minor_version %(echo %{version} | cut -d. -f2) %global soversion %{version}.0 %global srcversion esmi_pkg_ver-%{version} Release: %autorelease Summary: E-SMI: EPYC System management Interface In-band Library License: NCSA URL: https://github.com/amd/esmi_ib_library Source: %{url}/archive/%{srcversion}/%{name}-%{srcversion}.tar.gz # for OS releases where amd_hsmp.h from kernel-headers is too old Source: https://github.com/amd/amd_hsmp/raw/0773094d8a59c641150c8b04f16bc782eaee2bd9/amd_hsmp.h # https://github.com/amd/esmi_ib_library/pull/18 Patch: esmi-fix-finding-amd_hsmp-include.patch # Patch to use the bundled amd_hsmp.h we download rather than the system one Patch100: esmi-use-bundled-amd_hsmp-include.patch # This is a hardware enablement package for AMD x86_64 platforms ExclusiveArch: x86_64 BuildRequires: chrpath BuildRequires: cmake BuildRequires: gcc-c++ %if %{with system_amd_hsmp} BuildRequires: kernel-headers %endif BuildRequires: sed %if %{with doc} BuildRequires: doxygen BuildRequires: make BuildRequires: texlive-latex %endif Suggests: %{name}-doc = %{version}-%{release} %description The EPYC System Management Interface In-band Library, or E-SMI library, is part of the EPYC System Management Inband software stack. It is a C library for Linux that provides a user space interface to monitor and control the CPU's power, energy, performance and other system management features. %package devel Summary: Development headers and libraries for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel This package contains development headers and libraries for %{name}. %package doc Summary: Additional documentation for %{name} BuildArch: noarch %description doc This package contains additional documentation for %{name}. %package -n e_smi_tool Summary: E-SMI: EPYC™ System management Interface tool %description -n e_smi_tool This package contains E-SMI tool, a program based on the E-SMI In-band library that provides options to Monitor and Control System Management functionality. %prep %autosetup -N -n %{name}-%{srcversion} %autopatch -p1 -M 99 # The amd_hsmp.h provided by kernel-headers is out of date %if %{without system_amd_hsmp} cp -p %{SOURCE1} include/e_smi/amd_hsmp.h %autopatch -p1 -m 100 -M 199 %endif # Use FHS install paths and patch version detection sed -i CMakeLists.txt \ -e 's:${E_SMI}/bin:%{_bindir}:g' \ -e 's:e_smi/include:%{_includedir}:g' \ -e 's:${E_SMI}/lib/static:%{_libdir}:g' \ -e 's:${E_SMI}/lib:%{_libdir}:g' \ -e 's:${E_SMI}/doc:%{_pkgdocdir}:g' \ -e 's:get_package_version_number("1.0.0.0":get_version_from_tag("%{soversion}":' %if %{with doc} # Remove prebuilt docs rm ESMI_IB_Release_Notes.pdf ESMI_Manual.pdf %endif %build %cmake %cmake_build %if %{with doc} make -C %{_vpath_builddir} doc %endif %install %cmake_install # Strip rpath chrpath -d %{buildroot}/%{_bindir}/e_smi_tool %check %ctest %files %license License.txt %dir %{_pkgdocdir} %doc %{_pkgdocdir}/README.md %doc %{_pkgdocdir}/RELEASENOTES.md %{_libdir}/libe_smi64.so.%{major_version} %{_libdir}/libe_smi64.so.%{version} %files devel %{_includedir}/e_smi/ %{_libdir}/libe_smi64.so %files doc %license License.txt %dir %{_pkgdocdir} %doc %{_pkgdocdir}/ESMI_IB_Release_Notes.pdf %doc %{_pkgdocdir}/ESMI_Manual.pdf %files -n e_smi_tool %{_bindir}/e_smi_tool %changelog ## START: Generated by rpmautospec * Tue Mar 18 2025 Michel Lind - 4.1.2-1 - Update to 4.1.2; Fixes: RHBZ#2267230 - Update version parsing to make it easier to update the spec - Also enable Packit * Thu Jan 16 2025 Fedora Release Engineering - 3.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild * Wed Jul 17 2024 Fedora Release Engineering - 3.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Thu May 30 2024 Software Management Team - 3.0-2 - Eliminate use of obsolete %%patchN syntax (#2283636) * Wed Jan 24 2024 Davide Cavalca - 3.0-1 - Update to 3.0; Fixes: RHBZ#2260128 * Wed Jan 24 2024 Fedora Release Engineering - 1.5.0^20220622gitf4ce871-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Fri Jan 19 2024 Fedora Release Engineering - 1.5.0^20220622gitf4ce871-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Wed Jul 19 2023 Fedora Release Engineering - 1.5.0^20220622gitf4ce871-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Fri Mar 31 2023 Davide Cavalca - 1.5.0^20220622gitf4ce871-3 - Number patches for compatibility with el8 * Wed Mar 29 2023 Davide Cavalca - 1.5.0^20220622gitf4ce871-2 - Fix build on EPEL 8 and EPEL 9 * Wed Mar 08 2023 Davide Cavalca - 1.5.0^20220622gitf4ce871-1 - Initial import; Fixes: RHBZ#2174487 ## END: Generated by rpmautospec