diff --git a/libpfm.spec b/libpfm.spec index ab04d61..d25908b 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -1,3 +1,5 @@ +# Default to no static libraries +%{!?with_static: %global with_static 0} %bcond_without python %if %{with python} %define python_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") @@ -10,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -19,6 +21,7 @@ URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz Patch2: libpfm-python3-setup.patch +BuildRequires: make BuildRequires: gcc %if %{with python} BuildRequires: python3 @@ -41,6 +44,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Development library and header files to create performance monitoring applications for the perf_events interface. +%if %{with_static} %package static Summary: Static library to encode performance events for perf_events based tools Requires: %{name}%{?_isa} = %{version}-%{release} @@ -48,6 +52,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %description static Static version of the libpfm library for performance monitoring applications for the perf_events interface. +%endif %if %{with python} %package -n python3-libpfm @@ -93,6 +98,10 @@ make \ LDCONFIG=/bin/true \ install +%if !%{with_static} +rm $RPM_BUILD_ROOT%{_libdir}/lib*.a +%endif + %ldconfig_scriptlets %files @@ -104,8 +113,10 @@ make \ %{_mandir}/man3/* %{_libdir}/lib*.so +%if %{with_static} %files static %{_libdir}/lib*.a +%endif %if %{with python} %files -n python3-libpfm @@ -113,6 +124,9 @@ make \ %endif %changelog +* Fri Jan 22 2021 William Cohen - 4.11.0-2 +- By default disable generation of static libraries + * Tue Sep 08 2020 William Cohen - 4.11.0-1 - Rebase on libpfm-4.11.0.