d8a1e8
%bcond_without python
d8a1e8
%if %{with python}
d8a1e8
%define python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
d8a1e8
%define python_prefix %(python -c "import sys; print sys.prefix")
d8a1e8
%{?filter_setup:
d8a1e8
%filter_provides_in %{python_sitearch}/perfmon/.*\.so$
d8a1e8
%filter_setup
d8a1e8
}
d8a1e8
%endif
d8a1e8
d8a1e8
Name:		libpfm
d8a1e8
Version:	4.7.0
db39d7
Release:	10%{?dist}
d8a1e8
d8a1e8
Summary:	Library to encode performance events for use by perf tool
d8a1e8
d8a1e8
Group:		System Environment/Libraries
d8a1e8
License:	MIT
d8a1e8
URL:		http://perfmon2.sourceforge.net/
d8a1e8
Source0:	http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz
d8a1e8
Patch1: libpfm-updates.patch
d8a1e8
Patch2: libpfm-rhbz1440249.patch
d8a1e8
Patch3: libpfm-power9.patch
5ba0e2
Patch4: libpfm-bdx_unc.patch
5ba0e2
Patch5: libpfm-p9_alt.patch
5ba0e2
Patch6: libpfm-p9_uniq.patch
5ba0e2
Patch7: libpfm-intel_1port.patch
db39d7
Patch8: libpfm-s390.patch
d8a1e8
d8a1e8
%if %{with python}
d8a1e8
BuildRequires:	python-devel
d8a1e8
BuildRequires:	python-setuptools-devel
d8a1e8
BuildRequires:	swig
d8a1e8
%endif
d8a1e8
d8a1e8
%description
d8a1e8
d8a1e8
libpfm4 is a library to help encode events for use with operating system
d8a1e8
kernels performance monitoring interfaces. The current version provides support
d8a1e8
for the perf_events interface available in upstream Linux kernels since v2.6.31.
d8a1e8
d8a1e8
%package devel
d8a1e8
Summary:	Development library to encode performance events for perf_events based tools
d8a1e8
Group:		Development/Libraries
d8a1e8
Requires:	%{name}%{?_isa} = %{version}-%{release}
d8a1e8
d8a1e8
%description devel
d8a1e8
Development library and header files to create performance monitoring
d8a1e8
applications for the perf_events interface.
d8a1e8
d8a1e8
%package static
d8a1e8
Summary:	Static library to encode performance events for perf_events based tools
d8a1e8
Group:		Development/Libraries
d8a1e8
Requires:	%{name}%{?_isa} = %{version}-%{release}
d8a1e8
d8a1e8
%description static
d8a1e8
Static version of the libpfm library for performance monitoring
d8a1e8
applications for the perf_events interface.
d8a1e8
d8a1e8
%if %{with python}
d8a1e8
%package python
d8a1e8
Summary:	Python bindings for libpfm and perf_event_open system call
d8a1e8
Group:		Development/Languages
d8a1e8
Requires:	%{name}%{?_isa} = %{version}-%{release}
d8a1e8
d8a1e8
%description python
d8a1e8
Python bindings for libpfm4 and perf_event_open system call.
d8a1e8
%endif
d8a1e8
d8a1e8
%prep
d8a1e8
%setup -q
d8a1e8
%patch1 -p1
d8a1e8
%patch2 -p1
d8a1e8
%patch3 -p1
5ba0e2
%patch4 -p1
5ba0e2
%patch5 -p 1 -b .p9_alt
5ba0e2
%patch6 -p 1 -b .p9_uniq
5ba0e2
%patch7 -p 1 -b .1port
db39d7
%patch8 -p 1 -b .s390
d8a1e8
d8a1e8
%build
d8a1e8
%if %{with python}
d8a1e8
%global python_config CONFIG_PFMLIB_NOPYTHON=n
d8a1e8
%else
d8a1e8
%global python_config CONFIG_PFMLIB_NOPYTHON=y
d8a1e8
%endif
d8a1e8
make %{python_config} %{?_smp_mflags}
d8a1e8
d8a1e8
d8a1e8
%install
d8a1e8
rm -rf $RPM_BUILD_ROOT
d8a1e8
d8a1e8
%if %{with python}
d8a1e8
%global python_config CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX=$RPM_BUILD_ROOT/%{python_prefix}
d8a1e8
%else
d8a1e8
%global python_config CONFIG_PFMLIB_NOPYTHON=y
d8a1e8
%endif
d8a1e8
d8a1e8
make \
d8a1e8
    PREFIX=$RPM_BUILD_ROOT%{_prefix} \
d8a1e8
    LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
d8a1e8
    %{python_config} \
d8a1e8
    LDCONFIG=/bin/true \
d8a1e8
    install
d8a1e8
d8a1e8
%post -p /sbin/ldconfig
d8a1e8
%postun	-p /sbin/ldconfig
d8a1e8
d8a1e8
%files
d8a1e8
%doc README
d8a1e8
%{_libdir}/lib*.so.*
d8a1e8
d8a1e8
%files devel
d8a1e8
%{_includedir}/*
d8a1e8
%{_mandir}/man3/*
d8a1e8
%{_libdir}/lib*.so
d8a1e8
d8a1e8
%files static
d8a1e8
%{_libdir}/lib*.a
d8a1e8
d8a1e8
%if %{with python}
d8a1e8
%files python
d8a1e8
%{python_sitearch}/*
d8a1e8
%endif
d8a1e8
d8a1e8
%changelog
db39d7
* Mon Apr 16 2018 William Cohen <wcohen@redhat.com> - 4.7.0-10
db39d7
- Add support for z13/z13s. rhbz1548505
db39d7
5ba0e2
* Tue Dec 5 2017 William Cohen <wcohen@redhat.com> - 4.7.0-9
5ba0e2
- Correct x86 unit mask naming. rhbz1521076
5ba0e2
5ba0e2
* Mon Dec 4 2017 William Cohen <wcohen@redhat.com> - 4.7.0-8
5ba0e2
- Update IBM Power 9 events. rhbz1510684
5ba0e2
5ba0e2
* Wed Nov 29 2017 William Cohen <wcohen@redhat.com> - 4.7.0-7
5ba0e2
- Update IBM Power 9 events. rhbz1510684
5ba0e2
5ba0e2
* Mon Sep 25 2017 William Cohen <wcohen@redhat.com> - 4.7.0-6
5ba0e2
- Add access to Broadwell Uncore Counters. rhbz1474999
5ba0e2
d8a1e8
* Tue Jun 20 2017 William Cohen <wcohen@redhat.com> - 4.7.0-5
d8a1e8
- Add IBM Power9 support.
d8a1e8
d8a1e8
* Wed Apr 12 2017 William Cohen <wcohen@redhat.com> - 4.7.0-4
d8a1e8
- Correct handling of raw offcore umask handling. rhbz1440249
d8a1e8
d8a1e8
* Thu Mar 23 2017 William Cohen <wcohen@redhat.com> - 4.7.0-3
d8a1e8
- Avoid ABI breakage caused by some Intel KNL related patches. rhbz1412950
d8a1e8
d8a1e8
* Tue Mar 21 2017 William Cohen <wcohen@redhat.com> - 4.7.0-2
d8a1e8
- Updates for IBM Power and Intel KNL. rhbz1385009, rhbz1412950
d8a1e8
d8a1e8
* Thu May 12 2016 William Cohen <wcohen@redhat.com> - 4.7.0-1
d8a1e8
- Rebase to libpfm-4.7.0.
d8a1e8
d8a1e8
* Thu Jun 4 2015 William Cohen <wcohen@redhat.com> - 4.4.0-11
d8a1e8
- Add additional s390 support. rhbz1182187
d8a1e8
d8a1e8
* Fri May 15 2015 William Cohen <wcohen@redhat.com> - 4.4.0-10
d8a1e8
- Add additional s390 support. rhbz1182187
d8a1e8
d8a1e8
* Thu Oct 16 2014 William Cohen <wcohen@redhat.com> - 4.4.0-9
d8a1e8
- Bump and rebuid for chained build. rhbz1126091
d8a1e8
d8a1e8
* Fri Sep 26 2014 William Cohen <wcohen@redhat.com> - 4.4.0-8
d8a1e8
- Update Intel processor support. rhbz1126091
d8a1e8
d8a1e8
* Wed Sep 3 2014 William Cohen <wcohen@redhat.com> - 4.4.0-7
d8a1e8
- Add aarch64 and power8 support for rhbz963457 and rhbz1088557
d8a1e8
d8a1e8
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 4.4.0-6
d8a1e8
- Mass rebuild 2014-01-24
d8a1e8
d8a1e8
* Tue Jan 14 2014 William Cohen <wcohen@redhat.com> - 4.4.0-5
d8a1e8
- Update event descriptions.
d8a1e8
d8a1e8
* Mon Jan 13 2014 William Cohen <wcohen@redhat.com> - 4.4.0-4
d8a1e8
- Add Haswell model numbers.
d8a1e8
d8a1e8
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 4.4.0-3
d8a1e8
- Mass rebuild 2013-12-27
d8a1e8
d8a1e8
* Fri Jul 19 2013 William Cohen <wcohen@redhat.com> 4.4.0-2
d8a1e8
- Add IBM power 8 support.
d8a1e8
d8a1e8
* Mon Jun 17 2013 William Cohen <wcohen@redhat.com> 4.4.0-1
d8a1e8
- Rebase on libpfm-4.4.0.
d8a1e8
d8a1e8
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.3.0-3
d8a1e8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
d8a1e8
d8a1e8
* Tue Aug 28 2012 William Cohen <wcohen@redhat.com> 4.3.0-2
d8a1e8
- Turn off LDCONFIG and remove patch.
d8a1e8
d8a1e8
* Tue Aug 28 2012 William Cohen <wcohen@redhat.com> 4.3.0-1
d8a1e8
- Rebase on libpfm-4.3.0.
d8a1e8
d8a1e8
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.0-8
d8a1e8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
d8a1e8
d8a1e8
* Fri Jun 8 2012 William Cohen <wcohen@redhat.com> 4.2.0-7
d8a1e8
- Eliminate swig error.
d8a1e8
d8a1e8
* Thu Jun 7 2012 William Cohen <wcohen@redhat.com> 4.2.0-6
d8a1e8
- Eliminate rpm_build_root macro in build section.
d8a1e8
- Correct location of shared library files.
d8a1e8
d8a1e8
* Thu Jun 7 2012 William Cohen <wcohen@redhat.com> 4.2.0-5
d8a1e8
- Use siginfo_t for some examples.
d8a1e8
d8a1e8
* Mon Jun 4 2012 William Cohen <wcohen@redhat.com> 4.2.0-4
d8a1e8
- Correct python files.
d8a1e8
d8a1e8
* Wed Mar 28 2012 William Cohen <wcohen@redhat.com> 4.2.0-3
d8a1e8
- Additional spec file fixup for rhbz804666.
d8a1e8
d8a1e8
* Wed Mar 14 2012 William Cohen <wcohen@redhat.com> 4.2.0-2
d8a1e8
- Some spec file fixup.
d8a1e8
d8a1e8
* Wed Jan 12 2011 Arun Sharma <asharma@fb.com> 4.2.0-0
d8a1e8
Initial revision