2e5c3f
# Default to no static libraries
2e5c3f
%{!?with_static: %global with_static 1}
2e5c3f
%bcond_without python
2e5c3f
%if %{with python}
2e5c3f
%define python_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))")
2e5c3f
%define python_prefix %(python3 -c "import sys; print (sys.prefix)")
2e5c3f
%{?filter_setup:
2e5c3f
%filter_provides_in %{python3_sitearch}/perfmon/.*\.so$
2e5c3f
%filter_setup
2e5c3f
}
2e5c3f
%endif
2e5c3f
2e5c3f
Name:		libpfm
2e5c3f
Version:	4.11.0
2e5c3f
Release:	6%{?dist}
2e5c3f
2e5c3f
Summary:	Library to encode performance events for use by perf tool
2e5c3f
2e5c3f
License:	MIT
2e5c3f
URL:		http://perfmon2.sourceforge.net/
2e5c3f
Source0:	http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz
2e5c3f
Patch2:		libpfm-python3-setup.patch
2e5c3f
2e5c3f
BuildRequires: make
2e5c3f
BuildRequires:	gcc
2e5c3f
%if %{with python}
2e5c3f
BuildRequires:	python3
2e5c3f
BuildRequires:	python3-devel
2e5c3f
BuildRequires:	python3-setuptools
2e5c3f
BuildRequires:	swig
2e5c3f
%endif
2e5c3f
2e5c3f
%description
2e5c3f
2e5c3f
libpfm4 is a library to help encode events for use with operating system
2e5c3f
kernels performance monitoring interfaces. The current version provides support
2e5c3f
for the perf_events interface available in upstream Linux kernels since v2.6.31.
2e5c3f
2e5c3f
%package devel
2e5c3f
Summary:	Development library to encode performance events for perf_events based tools
2e5c3f
Requires:	%{name}%{?_isa} = %{version}-%{release}
2e5c3f
2e5c3f
%description devel
2e5c3f
Development library and header files to create performance monitoring
2e5c3f
applications for the perf_events interface.
2e5c3f
2e5c3f
%if %{with_static}
2e5c3f
%package static
2e5c3f
Summary:	Static library to encode performance events for perf_events based tools
2e5c3f
Requires:	%{name}%{?_isa} = %{version}-%{release}
2e5c3f
2e5c3f
%description static
2e5c3f
Static version of the libpfm library for performance monitoring
2e5c3f
applications for the perf_events interface.
2e5c3f
%endif
2e5c3f
2e5c3f
%if %{with python}
2e5c3f
%package -n python3-libpfm
2e5c3f
%{?python_provide:%python_provide python3-libpfm}
2e5c3f
# Remove before F30
2e5c3f
Provides: %{name}-python = %{version}-%{release}
2e5c3f
Provides: %{name}-python%{?_isa} = %{version}-%{release}
2e5c3f
Obsoletes: %{name}-python < %{version}-%{release}
2e5c3f
Summary:	Python bindings for libpfm and perf_event_open system call
2e5c3f
Requires:	%{name}%{?_isa} = %{version}-%{release}
2e5c3f
2e5c3f
%description -n python3-libpfm
2e5c3f
Python bindings for libpfm4 and perf_event_open system call.
2e5c3f
%endif
2e5c3f
2e5c3f
%prep
2e5c3f
%setup -q
2e5c3f
%patch2 -p1 -b .python3
2e5c3f
2e5c3f
%build
2e5c3f
%if %{with python}
2e5c3f
%global python_config CONFIG_PFMLIB_NOPYTHON=n
2e5c3f
%else
2e5c3f
%global python_config CONFIG_PFMLIB_NOPYTHON=y
2e5c3f
%endif
2e5c3f
%make_build %{python_config} \
2e5c3f
     OPTIM="%{optflags}" LDFLAGS="%{build_ldflags}"
2e5c3f
2e5c3f
2e5c3f
%install
2e5c3f
rm -rf $RPM_BUILD_ROOT
2e5c3f
2e5c3f
%if %{with python}
2e5c3f
%global python_config CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX=$RPM_BUILD_ROOT/%{python_prefix}
2e5c3f
%else
2e5c3f
%global python_config CONFIG_PFMLIB_NOPYTHON=y
2e5c3f
%endif
2e5c3f
2e5c3f
make \
2e5c3f
    PREFIX=$RPM_BUILD_ROOT%{_prefix} \
2e5c3f
    LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
2e5c3f
    %{python_config} \
2e5c3f
    LDCONFIG=/bin/true \
2e5c3f
    install
2e5c3f
2e5c3f
%if !%{with_static}
2e5c3f
rm $RPM_BUILD_ROOT%{_libdir}/lib*.a
2e5c3f
%endif
2e5c3f
2e5c3f
%ldconfig_scriptlets
2e5c3f
2e5c3f
%files
2e5c3f
%doc README
2e5c3f
%{_libdir}/lib*.so.*
2e5c3f
2e5c3f
%files devel
2e5c3f
%{_includedir}/*
2e5c3f
%{_mandir}/man3/*
2e5c3f
%{_libdir}/lib*.so
2e5c3f
2e5c3f
%if %{with_static}
2e5c3f
%files static
2e5c3f
%{_libdir}/lib*.a
2e5c3f
%endif
2e5c3f
2e5c3f
%if %{with python}
2e5c3f
%files -n python3-libpfm
2e5c3f
%{python3_sitearch}/*
2e5c3f
%endif
2e5c3f
2e5c3f
%changelog
2e5c3f
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 4.11.0-6
2e5c3f
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
2e5c3f
  Related: rhbz#1991688
2e5c3f
2e5c3f
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 4.11.0-5
2e5c3f
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
2e5c3f
2e5c3f
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.11.0-4
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
2e5c3f
2e5c3f
* Sat Jan 23 2021 William Cohen <wcohen@redhat.com> - 4.11.0-3
2e5c3f
- Reenable generation of static libraries for time being.
2e5c3f
2e5c3f
* Fri Jan 22 2021 William Cohen <wcohen@redhat.com> - 4.11.0-2
2e5c3f
- By default disable generation of static libraries
2e5c3f
2e5c3f
* Tue Sep 08 2020 William Cohen <wcohen@redhat.com> - 4.11.0-1
2e5c3f
- Rebase on libpfm-4.11.0.
2e5c3f
2e5c3f
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.1-13
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
2e5c3f
2e5c3f
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 4.10.1-12
2e5c3f
- Use make macros
2e5c3f
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
2e5c3f
2e5c3f
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 4.10.1-11
2e5c3f
- Rebuilt for Python 3.9
2e5c3f
2e5c3f
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.1-10
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
2e5c3f
2e5c3f
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 4.10.1-9
2e5c3f
- Rebuilt for Python 3.8.0rc1 (#1748018)
2e5c3f
2e5c3f
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 4.10.1-8
2e5c3f
- Rebuilt for Python 3.8
2e5c3f
2e5c3f
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.1-7
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
2e5c3f
2e5c3f
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.1-6
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
2e5c3f
2e5c3f
* Tue Jul 17 2018 Miro Hrončok <mhroncok@redhat.com> - 4.10.1-5
2e5c3f
- Update Python macros to new packaging standards
2e5c3f
  (See https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package)
2e5c3f
2e5c3f
* Sun Jul 15 2018 William Cohen <wcohen@redhat.com> - 4.10.1-4
2e5c3f
- Add gcc Buildrequires.
2e5c3f
2e5c3f
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.1-3
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
2e5c3f
2e5c3f
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 4.10.1-2
2e5c3f
- Rebuilt for Python 3.7
2e5c3f
2e5c3f
* Fri Jun 15 2018 William Cohen <wcohen@redhat.com> - 4.10.1-1
2e5c3f
- Rebase on libpfm-4.10.1.
2e5c3f
2e5c3f
* Tue Jun 12 2018 William Cohen <wcohen@redhat.com> - 4.10.0-2
2e5c3f
- Use upstream libpfm cavium patch.
2e5c3f
2e5c3f
* Fri Jun 8 2018 William Cohen <wcohen@redhat.com> - 4.10.0-1
2e5c3f
- Rebase on libpfm-4.10.0.
2e5c3f
- Use Python 3.
2e5c3f
2e5c3f
* Mon Feb 26 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.9.0-6
2e5c3f
- Pass in LDFLAGS for build.
2e5c3f
2e5c3f
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.9.0-5
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
2e5c3f
2e5c3f
* Tue Jan 30 2018 William Cohen <wcohen@redhat.com> - 4.9.0-4
2e5c3f
- Address truncation issues.
2e5c3f
2e5c3f
* Tue Jan 30 2018 William Cohen <wcohen@redhat.com> - 4.9.0-3
2e5c3f
- Use the RPM build flags. (RHBZ #1540262)
2e5c3f
2e5c3f
* Tue Jan 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 4.9.0-2
2e5c3f
- Update Python 2 dependency declarations to new packaging standards
2e5c3f
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
2e5c3f
2e5c3f
* Thu Jan 4 2018 William Cohen <wcohen@redhat.com> - 4.9.0-1
2e5c3f
- Rebase on libpfm-4.9.0.
2e5c3f
2e5c3f
* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.8.0-8
2e5c3f
- Add Provides for the old name without %%_isa
2e5c3f
2e5c3f
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.8.0-7
2e5c3f
- Python 2 binary package renamed to python2-libpfm
2e5c3f
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
2e5c3f
2e5c3f
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.8.0-6
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
2e5c3f
2e5c3f
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.8.0-5
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
2e5c3f
2e5c3f
* Fri Jul 07 2017 Igor Gnatenko <ignatenko@redhat.com> - 4.8.0-4
2e5c3f
- Rebuild due to bug in RPM (RHBZ #1468476)
2e5c3f
2e5c3f
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.8.0-3
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2e5c3f
2e5c3f
* Mon Nov 7 2016 William Cohen <wcohen@redhat.com> - 4.8.0-1
2e5c3f
- Rebase on libpfm-4.8.0.
2e5c3f
2e5c3f
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.7.0-2
2e5c3f
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
2e5c3f
2e5c3f
* Thu Feb 11 2016 William Cohen <wcohen@redhat.com> - 4.7.0-1
2e5c3f
- Rebase on libpfm-4.7.0.
2e5c3f
2e5c3f
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.6.0-4
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
2e5c3f
2e5c3f
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.6.0-3
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
2e5c3f
2e5c3f
* Thu Jun 4 2015 William Cohen <wcohen@redhat.com> - 4.6.0-2
2e5c3f
- Correct requires for subpackages.
2e5c3f
2e5c3f
* Thu Mar 5 2015 William Cohen <wcohen@redhat.com> - 4.6.0-1
2e5c3f
- Rebase on libpfm-4.6.0.
2e5c3f
2e5c3f
* Wed Feb 11 2015 William Cohen <wcohen@redhat.com> - 4.5.0-6
2e5c3f
- Bump version and rebuild.
2e5c3f
2e5c3f
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.5.0-5
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
2e5c3f
2e5c3f
* Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 4.5.0-4
2e5c3f
- Replace python-setuptools-devel BR with python-setuptools
2e5c3f
2e5c3f
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.5.0-3
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2e5c3f
2e5c3f
* Fri May 23 2014 William Cohen <wcohen@redhat.com> 4.5.0-2
2e5c3f
- Add cortex a53 support.
2e5c3f
2e5c3f
* Fri May 23 2014 William Cohen <wcohen@redhat.com> 4.5.0-1
2e5c3f
- Rebase on libpfm-4.5.0.
2e5c3f
2e5c3f
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.4.0-3
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
2e5c3f
2e5c3f
* Fri Jul 19 2013 William Cohen <wcohen@redhat.com> 4.4.0-2
2e5c3f
- Add IBM power 8 support.
2e5c3f
2e5c3f
* Mon Jun 17 2013 William Cohen <wcohen@redhat.com> 4.4.0-1
2e5c3f
- Rebase on libpfm-4.4.0.
2e5c3f
2e5c3f
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.3.0-3
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
2e5c3f
2e5c3f
* Tue Aug 28 2012 William Cohen <wcohen@redhat.com> 4.3.0-2
2e5c3f
- Turn off LDCONFIG and remove patch.
2e5c3f
2e5c3f
* Tue Aug 28 2012 William Cohen <wcohen@redhat.com> 4.3.0-1
2e5c3f
- Rebase on libpfm-4.3.0.
2e5c3f
2e5c3f
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.0-8
2e5c3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
2e5c3f
2e5c3f
* Fri Jun 8 2012 William Cohen <wcohen@redhat.com> 4.2.0-7
2e5c3f
- Eliminate swig error.
2e5c3f
2e5c3f
* Thu Jun 7 2012 William Cohen <wcohen@redhat.com> 4.2.0-6
2e5c3f
- Eliminate rpm_build_root macro in build section.
2e5c3f
- Correct location of shared library files.
2e5c3f
2e5c3f
* Thu Jun 7 2012 William Cohen <wcohen@redhat.com> 4.2.0-5
2e5c3f
- Use siginfo_t for some examples.
2e5c3f
2e5c3f
* Mon Jun 4 2012 William Cohen <wcohen@redhat.com> 4.2.0-4
2e5c3f
- Correct python files.
2e5c3f
2e5c3f
* Wed Mar 28 2012 William Cohen <wcohen@redhat.com> 4.2.0-3
2e5c3f
- Additional spec file fixup for rhbz804666.
2e5c3f
2e5c3f
* Wed Mar 14 2012 William Cohen <wcohen@redhat.com> 4.2.0-2
2e5c3f
- Some spec file fixup.
2e5c3f
2e5c3f
* Wed Jan 12 2011 Arun Sharma <asharma@fb.com> 4.2.0-0
2e5c3f
Initial revision