From ac0b2a91da40ede0c000a09d47cf809f0ae74a14 Mon Sep 17 00:00:00 2001 From: jiaxiya Date: Sat, 7 Dec 2019 00:33:37 +0800 Subject: [PATCH] address comments --- libpfm.spec | 78 +++++++++++++---------------------------------------- 1 file changed, 19 insertions(+), 59 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index 877064a..9e1be03 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -1,12 +1,5 @@ -%bcond_without python -%if %{with python} %define python_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %define python_prefix %(python3 -c "import sys; print (sys.prefix)") -%{?filter_setup: -%filter_provides_in %{python3_sitearch}/perfmon/.*\.so$ -%filter_setup -} -%endif Name: libpfm Version: 4.10.1 @@ -17,71 +10,40 @@ URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz -# PATCH-FIX、python version -Patch2: 0001-libpfm-python3-setup.patch - -BuildRequires: gcc -%if %{with python} -BuildRequires: python3 python3-devel python3-setuptools swig -%endif +Patch1: 0001-libpfm-python3-setup.patch +BuildRequires: python3 python3-devel python3-setuptools swig gcc %description This is a user library called libpfm4 to help setup performance events for use with the perf_events Linux kernel interface. -%package devel -Summary: Development library to encode performance events for perf_events based tools -Requires: %{name}%{?_isa} = %{version}-%{release} -%description devel -Development library and header files to create performance monitoring -applications for the perf_events interface. +%package devel +Summary: Library to provide perf_events in linux +%description devel +Library package used for development for perf_events interface. + +%package -n python3-libpfm +Provides: %{name}-python = %{version}-%{release} +Obsoletes: %{name}-python < %{version}-%{release} +Summary: Python bindings for libpfm + +%description -n python3-libpfm +Python bindings for libpfm4 used for perf_events %package_help -%if %{with python} -%package -n python3-libpfm -%{?python_provide:%python_provide python3-libpfm} -# Remove before F30 -Provides: %{name}-python = %{version}-%{release} -Provides: %{name}-python%{?_isa} = %{version}-%{release} -Obsoletes: %{name}-python < %{version}-%{release} -Summary: Python bindings for libpfm and perf_event_open system call -Requires: %{name}%{?_isa} = %{version}-%{release} - -%description -n python3-libpfm -Python bindings for libpfm4 and perf_event_open system call. -%endif - %prep -%setup -q -%patch2 -p1 -b .python3 +%autosetup -p1 %build -%if %{with python} -%global python_config CONFIG_PFMLIB_NOPYTHON=n -%else -%global python_config CONFIG_PFMLIB_NOPYTHON=y -%endif -make %{python_config} %{?_smp_mflags} \ - OPTIM="%{optflags}" LDFLAGS="%{build_ldflags}" - +%make_build CONFIG_PFMLIB_NOPYTHON=n %install rm -rf $RPM_BUILD_ROOT -%if %{with python} -%global python_config CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX=$RPM_BUILD_ROOT/%{python_prefix} -%else -%global python_config CONFIG_PFMLIB_NOPYTHON=y -%endif - -make \ - PREFIX=$RPM_BUILD_ROOT%{_prefix} \ - LIBDIR=$RPM_BUILD_ROOT%{_libdir} \ - %{python_config} \ - LDCONFIG=/bin/true \ - install +make PREFIX=$RPM_BUILD_ROOT%{_prefix} LIBDIR=$RPM_BUILD_ROOT%{_libdir} \ + CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX=$RPM_BUILD_ROOT/%{python_prefix} LDCONFIG=/bin/true install %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -95,10 +57,8 @@ make \ %{_libdir}/lib*.so %{_libdir}/lib*.a -%if %{with python} %files -n python3-libpfm %{python3_sitearch}/* -%endif %files help %{_mandir}/man3/* @@ -106,5 +66,5 @@ make \ %changelog -* Sat Nov 30 2019 openEuler Buildteam - 4.10.1-6 +* Sun Dec 1 2019 jiaxiya - 4.10.1-6 - Package init