libpfm/libpfm.spec
Tony Jones 27c8f24039 Accepting request 1084911 from home:dirkmueller:Factory
- update to 4.13:
  * update Intel SKL/SKX/CLX event table
  * add ARM Neoverse V2 core PMU support
  * move ARM Neoverse N2 to ARMv9 support
  * add ARM v9 support basic infrastructure
  * add Arm Neoverse V1 core PMU support
  * Update Intel SapphireRapid event table
  * update Intel Icelake event table
  * update AMD Zen4 event table
  * add AMD Zen4 core PMU support
  * correctly detect all AMD Zen3 processors
  * fix CPU_CLK_UNHALTED.REF_DISTRIBUTED on Intel Icelake

OBS-URL: https://build.opensuse.org/request/show/1084911
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libpfm?expand=0&rev=62
2023-05-05 15:58:00 +00:00

177 lines
5.2 KiB
RPMSpec

#
# spec file for package libpfm
#
# Copyright (c) 2023 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/
#
%global python_config CONFIG_PFMLIB_NOPYTHON=y
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define vname libpfm4
%bcond_without python2
Name: libpfm
Version: 4.13.0
Release: 0
Summary: Library to encode performance events
License: MIT
Group: Development/Libraries/C and C++
URL: https://perfmon2.sourceforge.net/
Source: https://downloads.sourceforge.net/project/perfmon2/libpfm4/%{name}-%{version}.tar.gz
Source1: baselibs.conf
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: python-rpm-macros
BuildRequires: swig >= 2.0.5
%if 0%{?suse_version} >= 1550
# TW: generate subpackages for every python3 flavor
%define python_subpackage_only 1
%python_subpackages
%else
%define python_sitearch %python3_sitearch
%define python_files() -n python3-%{**}
%endif
%description
This package provides a library that can be used to encode events into the
format required by the operating systems performance monitoring subsystem.
%package -n %{vname}
Summary: Runtime library to encode performance events for use by perf tool
Group: System/Libraries
%description -n %{vname}
This package provides a library that can be used to encode events into the
format required by the operating systems performance monitoring subsystem.
The library does not make any performance monitoring system calls, it simply
provides a method to convert an event name, expressed as a string, to an event
encoding. The user of the library may use this event encoding in a subsequent
system call.
The current libpfm4 provides support for the perf_events interface which was
introduced in Linux v2.6.31.
%package devel
Summary: Development library to encode performance events for perf_events interface
Group: Development/Libraries/C and C++
Requires: %{vname} = %{version}
%description devel
This package provides development libraries and header files used to encode performance events for perf_events interface.
%package devel-static
Summary: Static library version of libpfm
Group: Development/Libraries/C and C++
Requires: %{name}-devel = %{version}
%description devel-static
This package contains the static variant of libpfm.
%if 0%{?python_subpackage_only}
%package -n python-%{name}
Summary: Python bindings for libpfm and perf_event_open system call
Group: Development/Libraries/Python
Requires: %{vname} = %{version}
%description -n python-%{name}
This package provides python bindings for the libpfm4 package and the perf_event_open system call.
%else
%package -n python2-%{name}
Summary: Python bindings for libpfm and perf_event_open system call
Group: Development/Libraries/Python
Provides: python-%{name}
Obsoletes: python-%{name}
Requires: %{vname} = %{version}
%description -n python2-%{name}
This package provides python bindings for the libpfm4 package and the perf_event_open system call.
%package -n python3-%{name}
Summary: Python3 bindings for libpfm and perf_event_open system call
Group: Development/Libraries/Python
Requires: %{vname} = %{version}
%description -n python3-%{name}
This package provides python3 bindings for the libpfm4 package and the perf_event_open system call.
%endif
%prep
%setup -q
# disable werror
sed -i \
-e 's:-Werror::g' \
config.mk
%autopatch -p1
%build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
export CFLAGS="%{optflags}"
make %{?_smp_mflags} %{python_config}
pushd python
%python_build
popd
%install
%global python_config %{python_config}
make \
PREFIX="%{buildroot}/%{_prefix}" \
LIBDIR="%{buildroot}/%{_libdir}" \
%{python_config} \
LDCONFIG=/bin/true \
install
install -D -p -m 0755 examples/check_events \
%{buildroot}/%{_bindir}/check_events
install -D -p -m 0755 examples/showevtinfo \
%{buildroot}/%{_bindir}/showevtinfo
install -D -p -m 0755 perf_examples/evt2raw \
%{buildroot}/%{_bindir}/evt2raw
pushd python
%python_install
popd
%post -n %{vname} -p /sbin/ldconfig
%postun -n %{vname} -p /sbin/ldconfig
%files -n %{vname}
%doc README
%{_libdir}/libpfm.so.*
%files devel
%{_includedir}/*
%{_mandir}/man3/*
%{_libdir}/lib*.so
%{_bindir}/check_events
%{_bindir}/showevtinfo
%{_bindir}/evt2raw
%files devel-static
%{_libdir}/lib*.a
%files %{python_files %{name}}
%{python_sitearch}/perfmon
%{python_sitearch}/perfmon-*-info
%if %{with python2} && ! 0%{?python_subpackage_only}
%files -n python2-%{name}
%{python2_sitearch}/*
%endif
%changelog