c68534
%bcond_without python
c68534
%if %{with python}
c68534
%define python_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))")
c68534
%define python_prefix %(python3 -c "import sys; print (sys.prefix)")
c68534
%{?filter_setup:
c68534
%filter_provides_in %{python_sitearch}/perfmon/.*\.so$
c68534
%filter_setup
c68534
}
c68534
%endif
c68534
c68534
Name:		libpfm
c68534
Version:	4.10.1
d23d5c
Release:	5%{?dist}
c68534
c68534
Summary:	Library to encode performance events for use by perf tool
c68534
c68534
Group:		System Environment/Libraries
c68534
License:	MIT
c68534
URL:		http://perfmon2.sourceforge.net/
c68534
Source0:	http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz
c68534
Patch2:		libpfm-python3-setup.patch
9fef47
Patch3:		libpfm-zseries.patch
f8a042
Patch4:		libpfm-tx2.patch
869785
Patch5:		libpfm-a64fx.patch
d23d5c
Patch6:		libpfm-flags.patch
d23d5c
Patch7:		libpfm-amd_merge.patch
d23d5c
Patch8:		libpfm-zen23.patch
c68534
c68534
%if %{with python}
c68534
BuildRequires:	python3
c68534
BuildRequires:	python3-devel
c68534
BuildRequires:	python3-setuptools
c68534
BuildRequires:	swig
c68534
%endif
c68534
c68534
%description
c68534
c68534
libpfm4 is a library to help encode events for use with operating system
c68534
kernels performance monitoring interfaces. The current version provides support
c68534
for the perf_events interface available in upstream Linux kernels since v2.6.31.
c68534
c68534
%package devel
c68534
Summary:	Development library to encode performance events for perf_events based tools
c68534
Group:		Development/Libraries
c68534
Requires:	%{name}%{?_isa} = %{version}-%{release}
c68534
c68534
%description devel
c68534
Development library and header files to create performance monitoring
c68534
applications for the perf_events interface.
c68534
c68534
%package static
c68534
Summary:	Static library to encode performance events for perf_events based tools
c68534
Group:		Development/Libraries
c68534
Requires:	%{name}%{?_isa} = %{version}-%{release}
c68534
c68534
%description static
c68534
Static version of the libpfm library for performance monitoring
c68534
applications for the perf_events interface.
c68534
c68534
%if %{with python}
c68534
%package -n python3-libpfm
c68534
%{?python_provide:%python_provide python3-libpfm}
c68534
# Remove before F30
c68534
Provides: %{name}-python = %{version}-%{release}
c68534
Provides: %{name}-python%{?_isa} = %{version}-%{release}
c68534
Obsoletes: %{name}-python < %{version}-%{release}
c68534
Summary:	Python bindings for libpfm and perf_event_open system call
c68534
Group:		Development/Languages
c68534
Requires:	%{name}%{?_isa} = %{version}-%{release}
c68534
c68534
%description -n python3-libpfm
c68534
Python bindings for libpfm4 and perf_event_open system call.
c68534
%endif
c68534
c68534
%prep
c68534
%setup -q
c68534
%patch2 -p1 -b .python3
9fef47
%patch3 -p1 -b .zseries
f8a042
%patch4 -p1 -b .tx2
869785
%patch5 -p1 -b .a64fx
d23d5c
%patch6 -p1
d23d5c
%patch7 -p1
d23d5c
%patch8 -p1
c68534
c68534
%build
c68534
%if %{with python}
c68534
%global python_config CONFIG_PFMLIB_NOPYTHON=n
c68534
%else
c68534
%global python_config CONFIG_PFMLIB_NOPYTHON=y
c68534
%endif
c68534
make %{python_config} %{?_smp_mflags} \
c68534
     OPTIM="%{optflags}" LDFLAGS="%{build_ldflags}"
c68534
c68534
c68534
%install
c68534
rm -rf $RPM_BUILD_ROOT
c68534
c68534
%if %{with python}
c68534
%global python_config CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX=$RPM_BUILD_ROOT/%{python_prefix}
c68534
%else
c68534
%global python_config CONFIG_PFMLIB_NOPYTHON=y
c68534
%endif
c68534
c68534
make \
c68534
    PREFIX=$RPM_BUILD_ROOT%{_prefix} \
c68534
    LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
c68534
    %{python_config} \
c68534
    LDCONFIG=/bin/true \
c68534
    install
c68534
c68534
%post -p /sbin/ldconfig
c68534
%postun	-p /sbin/ldconfig
c68534
c68534
%files
c68534
%doc README
c68534
%{_libdir}/lib*.so.*
c68534
c68534
%files devel
c68534
%{_includedir}/*
c68534
%{_mandir}/man3/*
c68534
%{_libdir}/lib*.so
c68534
c68534
%files static
c68534
%{_libdir}/lib*.a
c68534
c68534
%if %{with python}
c68534
%files -n python3-libpfm
c68534
%{python_sitearch}/*
c68534
%endif
c68534
c68534
%changelog
d23d5c
* Sun May 8 2022 William Cohen <wcohen@redhat.com> - 4.10.1-5
d23d5c
- Add AMD Zen 2/3 support (RHBZ #2067218)
d23d5c
869785
* Thu May 20 2021 William Cohen <wcohen@redhat.com> - 4.10.1-4
869785
- Add Fujitsu A64FX support (RHBZ #1908126)
869785
			     
f8a042
* Wed May 27 2020 William Cohen <wcohen@redhat.com> - 4.10.1-3
f8a042
- Add Marvell TunderX2 UNC support. (RHBZ #1726070)
f8a042
9fef47
* Tue Oct 15 2019 William Cohen <wcohen@redhat.com> - 4.10.1-2
9fef47
- Add IBM zseries support. (RHBZ #1731019)
9fef47
c68534
* Fri Jun 15 2018 William Cohen <wcohen@redhat.com> - 4.10.1-1
c68534
- Rebase on libpfm-4.10.1.
c68534
c68534
* Tue Jun 12 2018 William Cohen <wcohen@redhat.com> - 4.10.0-2
c68534
- Use upstream libpfm cavium patch.
c68534
c68534
* Fri Jun 8 2018 William Cohen <wcohen@redhat.com> - 4.10.0-1
c68534
- Rebase on libpfm-4.10.0.
c68534
- Use Python 3.
c68534
c68534
* Mon Feb 26 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.9.0-6
c68534
- Pass in LDFLAGS for build.
c68534
c68534
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.9.0-5
c68534
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c68534
c68534
* Tue Jan 30 2018 William Cohen <wcohen@redhat.com> - 4.9.0-4
c68534
- Address truncation issues.
c68534
c68534
* Tue Jan 30 2018 William Cohen <wcohen@redhat.com> - 4.9.0-3
c68534
- Use the RPM build flags. (RHBZ #1540262)
c68534
c68534
* Tue Jan 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 4.9.0-2
c68534
- Update Python 2 dependency declarations to new packaging standards
c68534
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
c68534
c68534
* Thu Jan 4 2018 William Cohen <wcohen@redhat.com> - 4.9.0-1
c68534
- Rebase on libpfm-4.9.0.
c68534
c68534
* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.8.0-8
c68534
- Add Provides for the old name without %%_isa
c68534
c68534
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.8.0-7
c68534
- Python 2 binary package renamed to python2-libpfm
c68534
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
c68534
c68534
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.8.0-6
c68534
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
c68534
c68534
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.8.0-5
c68534
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
c68534
c68534
* Fri Jul 07 2017 Igor Gnatenko <ignatenko@redhat.com> - 4.8.0-4
c68534
- Rebuild due to bug in RPM (RHBZ #1468476)
c68534
c68534
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.8.0-3
c68534
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
c68534
c68534
* Mon Nov 7 2016 William Cohen <wcohen@redhat.com> - 4.8.0-1
c68534
- Rebase on libpfm-4.8.0.
c68534
c68534
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.7.0-2
c68534
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
c68534
c68534
* Thu Feb 11 2016 William Cohen <wcohen@redhat.com> - 4.7.0-1
c68534
- Rebase on libpfm-4.7.0.
c68534
c68534
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.6.0-4
c68534
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
c68534
c68534
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.6.0-3
c68534
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
c68534
c68534
* Thu Jun 4 2015 William Cohen <wcohen@redhat.com> - 4.6.0-2
c68534
- Correct requires for subpackages.
c68534
c68534
* Thu Mar 5 2015 William Cohen <wcohen@redhat.com> - 4.6.0-1
c68534
- Rebase on libpfm-4.6.0.
c68534
c68534
* Wed Feb 11 2015 William Cohen <wcohen@redhat.com> - 4.5.0-6
c68534
- Bump version and rebuild.
c68534
c68534
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.5.0-5
c68534
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
c68534
c68534
* Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 4.5.0-4
c68534
- Replace python-setuptools-devel BR with python-setuptools
c68534
c68534
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.5.0-3
c68534
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
c68534
c68534
* Fri May 23 2014 William Cohen <wcohen@redhat.com> 4.5.0-2
c68534
- Add cortex a53 support.
c68534
c68534
* Fri May 23 2014 William Cohen <wcohen@redhat.com> 4.5.0-1
c68534
- Rebase on libpfm-4.5.0.
c68534
c68534
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.4.0-3
c68534
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
c68534
c68534
* Fri Jul 19 2013 William Cohen <wcohen@redhat.com> 4.4.0-2
c68534
- Add IBM power 8 support.
c68534
c68534
* Mon Jun 17 2013 William Cohen <wcohen@redhat.com> 4.4.0-1
c68534
- Rebase on libpfm-4.4.0.
c68534
c68534
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.3.0-3
c68534
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
c68534
c68534
* Tue Aug 28 2012 William Cohen <wcohen@redhat.com> 4.3.0-2
c68534
- Turn off LDCONFIG and remove patch.
c68534
c68534
* Tue Aug 28 2012 William Cohen <wcohen@redhat.com> 4.3.0-1
c68534
- Rebase on libpfm-4.3.0.
c68534
c68534
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.0-8
c68534
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
c68534
c68534
* Fri Jun 8 2012 William Cohen <wcohen@redhat.com> 4.2.0-7
c68534
- Eliminate swig error.
c68534
c68534
* Thu Jun 7 2012 William Cohen <wcohen@redhat.com> 4.2.0-6
c68534
- Eliminate rpm_build_root macro in build section.
c68534
- Correct location of shared library files.
c68534
c68534
* Thu Jun 7 2012 William Cohen <wcohen@redhat.com> 4.2.0-5
c68534
- Use siginfo_t for some examples.
c68534
c68534
* Mon Jun 4 2012 William Cohen <wcohen@redhat.com> 4.2.0-4
c68534
- Correct python files.
c68534
c68534
* Wed Mar 28 2012 William Cohen <wcohen@redhat.com> 4.2.0-3
c68534
- Additional spec file fixup for rhbz804666.
c68534
c68534
* Wed Mar 14 2012 William Cohen <wcohen@redhat.com> 4.2.0-2
c68534
- Some spec file fixup.
c68534
c68534
* Wed Jan 12 2011 Arun Sharma <asharma@fb.com> 4.2.0-0
c68534
Initial revision