commit e80e71b563a635e9762d54e5fd7921d2a79260451f95ff1390e44245a4022cba Author: Philipp Thomas Date: Tue Jan 8 19:38:34 2013 +0000 Accepting request 147587 from home:jones_tony:oprofile_test Initial checkin (discussion: http://lists.opensuse.org/opensuse-factory/2013-01/msg00010.html) OBS-URL: https://build.opensuse.org/request/show/147587 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libpfm?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/libpfm-4.3.0.tar.bz2 b/libpfm-4.3.0.tar.bz2 new file mode 100644 index 0000000..7596b95 --- /dev/null +++ b/libpfm-4.3.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a861dbb42a266513a70ec7bccf696d659bcecf5d4b4a94c6e90deaf7dd00ee93 +size 399868 diff --git a/libpfm.changes b/libpfm.changes new file mode 100644 index 0000000..a01c673 --- /dev/null +++ b/libpfm.changes @@ -0,0 +1,19 @@ +------------------------------------------------------------------- +Tue Jan 8 00:13:39 UTC 2013 - tonyj@suse.com + +- Changes to python builds, drop duplicate defns already in system macros. +- Fix build when with_python=0 + +------------------------------------------------------------------- +Fri Jan 4 08:19:57 UTC 2013 - jengelh@inai.de + +- Parallel build, remove redundant %clean section, consistent use + of %buildroot +- Follow python package naming guidelines +- Separate out static library into distinct subpackage + +------------------------------------------------------------------- +Sat Dec 29 20:52:00 UTC 2012 - tonyj@suse.com + +- Initial checkin of libpfm4 (version 4.3). + diff --git a/libpfm.spec b/libpfm.spec new file mode 100644 index 0000000..da7e17c --- /dev/null +++ b/libpfm.spec @@ -0,0 +1,121 @@ +%{!?with_python: %global with_python 1} + +Name: libpfm +Version: 4.3.0 +Release: 1 +%define vname libpfm4 +Summary: Library to encode performance events +Group: Development/Libraries/C and C++ +License: MIT +URL: http://perfmon2.sourceforge.net/ +Source: %{name}-%{version}.tar.bz2 +%if %{with_python} +BuildRequires: python-devel +BuildRequires: swig +%endif +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%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: Library to encode performance events for use by perf tool +Group: Development/Libraries/C and C++ + +%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 %{with_python} +%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. +%endif + +%prep +%setup -q + +%build +%if %{with_python} +%global python_config CONFIG_PFMLIB_NOPYTHON=n +%else +%global python_config CONFIG_PFMLIB_NOPYTHON=y +%endif +make %{?_smp_mflags} %{python_config} + + +%install + +%if %{with_python} +%global python_config CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX="%buildroot/%py_prefix" +%else +%global python_config CONFIG_PFMLIB_NOPYTHON=y +%endif + +make \ + PREFIX="%buildroot/%_prefix" \ + LIBDIR="%buildroot/%_libdir" \ + %{python_config} \ + LDCONFIG=/bin/true \ + install + +%if %{with_python} +# 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 +%__python -c 'import compileall; compileall.compile_dir("%{buildroot}%{python_sitearch}/", ddir="%{python_sitearch}/", force=1)' +%endif + +%post -n %{vname} -p /sbin/ldconfig +%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 + +%files devel-static +%defattr(-,root,root) +%{_libdir}/lib*.a + +%if %{with_python} +%files -n python-%name +%defattr(644,root,root,755) +%attr(755,root,root) %{python_sitearch}/* +%endif + +%changelog