File libcpucycles.spec of Package libcpucycles
#
# spec file for package libcpucycles
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define sover 1
Name: libcpucycles
Version: 20250925
Release: 0
Summary: A C microlibrary for counting CPU cycles
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License: MIT
Group: Development/Libraries/C and C++
URL: https://cpucycles.cr.yp.to/
Source: https://cpucycles.cr.yp.to/libcpucycles-%{version}.tar.gz
# PATCH-FIX-SUSE: Ignore not recognized configure arguments and fix install paths
Patch1: fix-configure.patch
BuildRequires: gcc
BuildRequires: python3
%description
libcpucycles is a microlibrary for counting CPU cycles.
Cycle counts are not as detailed as Falk diagrams but are the most precise timers available to typical software;
they are central tools used in understanding and improving software performance.
%package -n libcpucycles%{sover}
Summary: A C microlibrary for counting CPU cycles
Group: Development/Libraries/C and C++
%description -n libcpucycles%{sover}
libcpucycles is a microlibrary for counting CPU cycles.
Cycle counts are not as detailed as Falk diagrams but are the most precise timers available to typical software;
they are central tools used in understanding and improving software performance.
%package devel
Summary: Development files for libcpucycles library
Group: Development/Languages/C and C++
Requires: libcpucycles%{sover} = %{version}
%description devel
Development files for libcpucycles library - libcpucycles is a microlibrary for counting CPU cycles.
Cycle counts are not as detailed as Falk diagrams but are the most precise timers available to typical software;
they are central tools used in understanding and improving software performance.
%package -n cpucycles
Summary: Command-line tool for counting CPU cycles (libcpucycles)
Group: Development/Languages/Other
Requires: libcpucycles%{sover} = %{version}
%description -n cpucycles
Command-line tool for counting CPU cycles (libcpucycles)
%prep
%autosetup -p1
%build
%configure
%make_build
%install
%make_install
chmod +x %{buildroot}%{_libdir}/libcpucycles.so.%{sover}
%check
%post -n libcpucycles%{sover} -p /sbin/ldconfig
%postun -n libcpucycles%{sover} -p /sbin/ldconfig
%files -n libcpucycles%{sover}
%license doc/license.md
%doc %{_mandir}/man3/cpucycles.3.gz
%{_libdir}/libcpucycles.so.%{sover}
%files devel
%{_includedir}/cpucycles.h
%{_libdir}/libcpucycles.so
%files -n cpucycles
%{_bindir}/cpucycles-info
%license doc/license.md
%doc %{_mandir}/man1/cpucycles-info.1.gz
%changelog