File gperftools.spec of Package gperftools

# spec file for package gperftools
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# 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

Name:           gperftools
Version:        2.5
Release:        0
Summary:        Performance Tools for C++
License:        BSD-3-Clause
Group:          Development/Libraries/C and C++
Patch1:         %{name}_fix_unassigned_malloc_in_unittest.patch
Patch2:         %{name}_gcc46.patch
Patch3:         ucontext.patch
Patch4:         gperftools-s390.patch
Patch5:         gperftools-aarch64.patch
BuildRequires:  autoconf >= 2.59
BuildRequires:  automake
BuildRequires:  gcc-c++
BuildRequires:  libtool
%ifnarch s390x s390
BuildRequires:  libunwind-devel
BuildRequires:  pkg-config
%ifnarch s390
BuildRequires:  valgrind-devel
Provides:       google-perftools
Obsoletes:      google-perftools
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

The gperftools package contains some utilities to improve and analyze the
performance of C++ programs.  This includes an optimized thread-caching
malloc() and cpu and heap profiling utilities.

%package -n libprofiler0
Summary:        CPU and Heap profiling library
Group:          System/Libraries

%description -n libprofiler0
This subpackage contains a library with cpu and heap profiling.

%package -n libtcmalloc4
Summary:        Thread-caching malloc library
Group:          System/Libraries

%description -n libtcmalloc4
This subpackage contains a library with optimized thread-caching

%package devel
Summary:        Performance tools for C++
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       libprofiler0 = %{version}
Requires:       libstdc++-devel
Requires:       libtcmalloc4 = %{version}
Provides:       google-perftools-devel
Obsoletes:      google-perftools-devel

%description devel
The gperftools-devel package contains static and debug libraries and header
files for developing applications that use the gperftools package.

%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1

autoreconf -fi
%ifnarch s390
VALGRIND_FL=`pkg-config --cflags valgrind`
export CXXFLAGS="%{optflags} -fno-strict-aliasing $VALGRIND_FL"
export CFLAGS="%{optflags} -fno-strict-aliasing $VALGRIND_FL"
%configure \
  --disable-static \
  --with-gnu-ld \
  --with-pic \
make %{?_smp_mflags}

make DESTDIR=%{buildroot} install %{?_smp_mflags}
find %{buildroot} -type f -name "*.la" -delete -print

%post   -n libprofiler0 -p /sbin/ldconfig

%postun -n libprofiler0 -p /sbin/ldconfig

%post   -n libtcmalloc4 -p /sbin/ldconfig

%postun -n libtcmalloc4 -p /sbin/ldconfig


%files -n libprofiler0

%files -n libtcmalloc4

%files devel

openSUSE Build Service is sponsored by