2013-01-09 08:45:20 +00:00
|
|
|
#
|
|
|
|
# spec file for package libpfm
|
|
|
|
#
|
2016-01-20 08:17:01 +00:00
|
|
|
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
2013-01-09 08:45:20 +00:00
|
|
|
#
|
|
|
|
# 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 http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2015-03-13 14:14:52 +00:00
|
|
|
%define vname libpfm4
|
2013-01-09 08:45:20 +00:00
|
|
|
Name: libpfm
|
2016-06-17 08:02:26 +00:00
|
|
|
Version: 4.7.0
|
2013-01-09 08:45:20 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Library to encode performance events
|
|
|
|
License: MIT
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Url: http://perfmon2.sourceforge.net/
|
2013-12-05 03:32:39 +00:00
|
|
|
Source: http://downloads.sourceforge.net/project/perfmon2/libpfm4/%{name}-%{version}.tar.gz
|
2013-01-28 14:24:42 +00:00
|
|
|
Source1: baselibs.conf
|
2013-01-09 08:45:20 +00:00
|
|
|
BuildRequires: python-devel
|
|
|
|
BuildRequires: swig
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2013-01-08 19:38:34 +00:00
|
|
|
|
|
|
|
%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}
|
2013-01-09 13:19:10 +00:00
|
|
|
Summary: Runtime library to encode performance events for use by perf tool
|
|
|
|
Group: System/Libraries
|
2013-01-08 19:38:34 +00:00
|
|
|
|
|
|
|
%description -n %{vname}
|
2015-03-13 14:14:52 +00:00
|
|
|
This package provides a library that can be used to encode events into the
|
2013-01-08 19:38:34 +00:00
|
|
|
format required by the operating systems performance monitoring subsystem.
|
2015-03-13 14:14:52 +00:00
|
|
|
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
|
2013-01-08 19:38:34 +00:00
|
|
|
system call.
|
|
|
|
|
|
|
|
The current libpfm4 provides support for the perf_events interface which was
|
|
|
|
introduced in Linux v2.6.31.
|
|
|
|
|
2013-01-09 13:19:10 +00:00
|
|
|
%package devel
|
2013-01-09 08:45:20 +00:00
|
|
|
Summary: Development library to encode performance events for perf_events interface
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Requires: %{vname} = %{version}
|
2013-01-08 19:38:34 +00:00
|
|
|
|
|
|
|
%description devel
|
|
|
|
This package provides development libraries and header files used to encode performance events for perf_events interface.
|
|
|
|
|
2013-01-09 13:19:10 +00:00
|
|
|
%package devel-static
|
2013-01-09 08:45:20 +00:00
|
|
|
Summary: Static library version of libpfm
|
|
|
|
Group: Development/Libraries/C and C++
|
2015-03-13 14:14:52 +00:00
|
|
|
Requires: %{name}-devel = %{version}
|
2013-01-08 19:38:34 +00:00
|
|
|
|
|
|
|
%description devel-static
|
|
|
|
This package contains the static variant of libpfm.
|
|
|
|
|
2015-03-13 14:14:52 +00:00
|
|
|
%package -n python-%{name}
|
2013-01-09 08:45:20 +00:00
|
|
|
Summary: Python bindings for libpfm and perf_event_open system call
|
|
|
|
Group: Development/Libraries/Python
|
|
|
|
Requires: %{vname} = %{version}
|
2013-01-08 19:38:34 +00:00
|
|
|
|
2015-03-13 14:14:52 +00:00
|
|
|
%description -n python-%{name}
|
2013-01-08 19:38:34 +00:00
|
|
|
This package provides python bindings for the libpfm4 package and the perf_event_open system call.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
2016-06-17 08:08:26 +00:00
|
|
|
# disable werror
|
|
|
|
sed -i \
|
|
|
|
-e 's:-Werror::g' \
|
|
|
|
config.mk
|
2013-01-08 19:38:34 +00:00
|
|
|
|
|
|
|
%build
|
2016-06-17 08:08:26 +00:00
|
|
|
export CFLAGS="%{optflags}"
|
2013-01-08 19:38:34 +00:00
|
|
|
%global python_config CONFIG_PFMLIB_NOPYTHON=n
|
|
|
|
make %{?_smp_mflags} %{python_config}
|
|
|
|
|
|
|
|
%install
|
2015-03-13 14:14:52 +00:00
|
|
|
%global python_config CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX="%{buildroot}/%{py_prefix}"
|
2013-01-08 19:38:34 +00:00
|
|
|
make \
|
2015-03-13 14:14:52 +00:00
|
|
|
PREFIX="%{buildroot}/%{_prefix}" \
|
|
|
|
LIBDIR="%{buildroot}/%{_libdir}" \
|
2013-01-08 19:38:34 +00:00
|
|
|
%{python_config} \
|
|
|
|
LDCONFIG=/bin/true \
|
|
|
|
install
|
2016-01-20 08:17:01 +00:00
|
|
|
mkdir -p %{buildroot}/%{_bindir}
|
|
|
|
install -m 0755 examples/check_events %{buildroot}/%{_bindir}/check_events
|
|
|
|
install -m 0755 examples/showevtinfo %{buildroot}/%{_bindir}/showevtinfo
|
|
|
|
install -m 0755 perf_examples/evt2raw %{buildroot}/%{_bindir}/evt2raw
|
2013-01-08 19:38:34 +00:00
|
|
|
|
|
|
|
# temp hack to fix rpmlint file-contains-buildroot for *.pyc
|
|
|
|
# http://lists.opensuse.org/opensuse-factory/2012-01/msg00235.html
|
|
|
|
find "%{buildroot}/%{python_sitearch}/" -name '*.pyc' -delete
|
2015-03-13 14:14:52 +00:00
|
|
|
python -c 'import compileall; compileall.compile_dir("%{buildroot}%{python_sitearch}/", ddir="%{python_sitearch}/", force=1)'
|
2013-01-08 19:38:34 +00:00
|
|
|
|
|
|
|
%post -n %{vname} -p /sbin/ldconfig
|
2015-03-13 14:14:52 +00:00
|
|
|
|
2013-01-08 19:38:34 +00:00
|
|
|
%postun -n %{vname} -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%files -n %{vname}
|
|
|
|
%defattr(644,root,root,755)
|
|
|
|
%doc README
|
|
|
|
%attr(755,root,root) %{_libdir}/lib*.so.*
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(644,root,root,755)
|
|
|
|
%{_includedir}/*
|
|
|
|
%{_mandir}/man3/*
|
|
|
|
%{_libdir}/lib*.so
|
2016-01-20 08:17:01 +00:00
|
|
|
%attr(755,root,root) %{_bindir}/check_events
|
|
|
|
%attr(755,root,root) %{_bindir}/showevtinfo
|
|
|
|
%attr(755,root,root) %{_bindir}/evt2raw
|
2013-01-08 19:38:34 +00:00
|
|
|
|
|
|
|
%files devel-static
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/lib*.a
|
|
|
|
|
2015-03-13 14:14:52 +00:00
|
|
|
%files -n python-%{name}
|
2013-01-08 19:38:34 +00:00
|
|
|
%defattr(644,root,root,755)
|
|
|
|
%attr(755,root,root) %{python_sitearch}/*
|
|
|
|
|
|
|
|
%changelog
|