[packages/gperftools] add minimal bcond, x32 builds with-minimal since 2.0 release

glen glen at pld-linux.org
Mon Jul 27 10:18:39 CEST 2015


commit 84e51d2882d4e7846f4e8e3b56f4c2f2dde15c77
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Jul 27 11:06:31 2015 +0300

    add minimal bcond, x32 builds with-minimal since 2.0 release

 gperftools.spec | 69 ++++++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 46 insertions(+), 23 deletions(-)
---
diff --git a/gperftools.spec b/gperftools.spec
index 69cb0d1..e9e4b2f 100644
--- a/gperftools.spec
+++ b/gperftools.spec
@@ -1,10 +1,19 @@
 # NOTE: shared /%{_lib}/libtcmalloc* is useless without /usr/%{_lib}/libstdc++.so.6
-#
+# TODO:
+# - subpackages for "minimal" and the rest?
+
+# Conditional build:
+%bcond_with	minimal		# build only build only tcmalloc-minimal
+
+%ifarch x32
+%define	with_minimal	1
+%endif
+
 Summary:	Fast, multi-threaded malloc and performance analysis tools
 Summary(pl.UTF-8):	Szybka, wielowątkowa implementacja malloc i narzędzia do analizy wydajności
 Name:		gperftools
 Version:	2.1
-Release:	1
+Release:	2
 License:	BSD
 Group:		Libraries
 # Source0Download: http://code.google.com/p/gperftools/downloads/list
@@ -106,19 +115,19 @@ statyczne.
 %build
 %configure \
 %ifnarch %{x8664} ia64
-	ac_cv_lib_unwind_backtrace=no
+	ac_cv_lib_unwind_backtrace=no \
 %endif
+	%{?with_minimal:--enable-minimal}
 
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT/%{_lib}
-
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
-for pkg in libtcmalloc libtcmalloc_minimal; do
+for pkg in %{!?with_minimal:libtcmalloc} libtcmalloc_minimal; do
 	mv $RPM_BUILD_ROOT%{_libdir}/${pkg}.so.* \
 		$RPM_BUILD_ROOT/%{_lib}
 	ln -snf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/${pkg}.so.*.*.*) \
@@ -126,7 +135,7 @@ for pkg in libtcmalloc libtcmalloc_minimal; do
 done
 
 # clean docdir
-%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version}
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -141,6 +150,9 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 # note: INSTALL contains many perftools-specific notes
 %doc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO doc/*{html,png,gif,txt}
+%attr(755,root,root) %{_libdir}/libtcmalloc_minimal_debug.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libtcmalloc_minimal_debug.so.4
+%if %{without minimal}
 %attr(755,root,root) %{_bindir}/pprof
 %attr(755,root,root) %{_libdir}/libprofiler.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libprofiler.so.0
@@ -148,45 +160,49 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %ghost %{_libdir}/libtcmalloc_and_profiler.so.4
 %attr(755,root,root) %{_libdir}/libtcmalloc_debug.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libtcmalloc_debug.so.4
-%attr(755,root,root) %{_libdir}/libtcmalloc_minimal_debug.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libtcmalloc_minimal_debug.so.4
 %{_mandir}/man1/pprof.1*
+%endif
 
 %files devel
 %defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libtcmalloc_minimal_debug.so
+%{_libdir}/libtcmalloc_minimal_debug.la
+%{_pkgconfigdir}/libtcmalloc_minimal_debug.pc
+%{_pkgconfigdir}/libprofiler.pc
+%{_includedir}/google/profiler.h
+%{_pkgconfigdir}/libtcmalloc_debug.pc
+
+%if %{without minimal}
 %attr(755,root,root) %{_libdir}/libtcmalloc_and_profiler.so
 %attr(755,root,root) %{_libdir}/libtcmalloc_debug.so
-%attr(755,root,root) %{_libdir}/libtcmalloc_minimal_debug.so
 %attr(755,root,root) %{_libdir}/libprofiler.so
 %{_libdir}/libtcmalloc_and_profiler.la
 %{_libdir}/libtcmalloc_debug.la
-%{_libdir}/libtcmalloc_minimal_debug.la
 %{_libdir}/libprofiler.la
-%{_includedir}/google/profiler.h
 %{_includedir}/gperftools/profiler.h
-%{_pkgconfigdir}/libprofiler.pc
-%{_pkgconfigdir}/libtcmalloc_debug.pc
-%{_pkgconfigdir}/libtcmalloc_minimal_debug.pc
+%endif
 
 %files static
 %defattr(644,root,root,755)
+%{_libdir}/libtcmalloc_minimal_debug.a
+%if %{without minimal}
 %{_libdir}/libprofiler.a
 %{_libdir}/libtcmalloc_and_profiler.a
 %{_libdir}/libtcmalloc_debug.a
-%{_libdir}/libtcmalloc_minimal_debug.a
+%endif
 
 %files -n libtcmalloc
 %defattr(644,root,root,755)
-%attr(755,root,root) /%{_lib}/libtcmalloc.so.*.*.*
-%attr(755,root,root) %ghost /%{_lib}/libtcmalloc.so.4
 %attr(755,root,root) /%{_lib}/libtcmalloc_minimal.so.*.*.*
 %attr(755,root,root) %ghost /%{_lib}/libtcmalloc_minimal.so.4
+%if %{without minimal}
+%attr(755,root,root) /%{_lib}/libtcmalloc.so.*.*.*
+%attr(755,root,root) %ghost /%{_lib}/libtcmalloc.so.4
+%endif
 
 %files -n libtcmalloc-devel
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libtcmalloc.so
 %attr(755,root,root) %{_libdir}/libtcmalloc_minimal.so
-%{_libdir}/libtcmalloc.la
 %{_libdir}/libtcmalloc_minimal.la
 %dir %{_includedir}/google
 %{_includedir}/google/heap-*.h
@@ -194,16 +210,23 @@ rm -rf $RPM_BUILD_ROOT
 %{_includedir}/google/malloc_hook*.h
 %{_includedir}/google/stacktrace.h
 %{_includedir}/google/tcmalloc.h
-%dir %{_includedir}/gperftools
-%{_includedir}/gperftools/heap-*.h
 %{_includedir}/gperftools/malloc_extension*.h
 %{_includedir}/gperftools/malloc_hook*.h
-%{_includedir}/gperftools/stacktrace.h
 %{_includedir}/gperftools/tcmalloc.h
 %{_pkgconfigdir}/libtcmalloc.pc
 %{_pkgconfigdir}/libtcmalloc_minimal.pc
 
+%if %{without minimal}
+%attr(755,root,root) %{_libdir}/libtcmalloc.so
+%{_libdir}/libtcmalloc.la
+%dir %{_includedir}/gperftools
+%{_includedir}/gperftools/heap-*.h
+%{_includedir}/gperftools/stacktrace.h
+%endif
+
 %files -n libtcmalloc-static
 %defattr(644,root,root,755)
-%{_libdir}/libtcmalloc.a
 %{_libdir}/libtcmalloc_minimal.a
+%if %{without minimal}
+%{_libdir}/libtcmalloc.a
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gperftools.git/commitdiff/84e51d2882d4e7846f4e8e3b56f4c2f2dde15c77



More information about the pld-cvs-commit mailing list