summaryrefslogtreecommitdiff
path: root/ceph.spec.in
diff options
context:
space:
mode:
authorTommi Virtanen <tommi.virtanen@dreamhost.com>2011-09-08 12:30:05 -0700
committerTommi Virtanen <tommi.virtanen@dreamhost.com>2011-09-08 12:38:11 -0700
commitb4bc9f6104296c99d52fc5fed1dbf0695ddb6d62 (patch)
treefefb34f713c9f0ad2359d13936c27dc4b52399d8 /ceph.spec.in
parent3819bebe16870be1fb6c477c262bc6ca12704a51 (diff)
downloadceph-b4bc9f6104296c99d52fc5fed1dbf0695ddb6d62.tar.gz
rpm: Build without tcmalloc, by default.
You can still say "rpmbuild -ba --with tcmalloc ceph.spec" if you have it. Add BuildRequires on google-perftools when building with tcmalloc. Ensure it's the right architecture. Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
Diffstat (limited to 'ceph.spec.in')
-rw-r--r--ceph.spec.in17
1 files changed, 16 insertions, 1 deletions
diff --git a/ceph.spec.in b/ceph.spec.in
index e73269491a6..3fac4befde1 100644
--- a/ceph.spec.in
+++ b/ceph.spec.in
@@ -1,6 +1,12 @@
%define with_radosgw %{?_with_radosgw: 1} %{!?_with_radosgw: 0}
%define with_gtk2 %{?_with_gtk2: 1} %{!?_with_gtk2: 0}
+# it seems there is no usable tcmalloc rpm for x86_64; parts of
+# google-perftools don't compile on x86_64, and apparently the
+# decision was to not build the package at all, even if tcmalloc
+# itself would have worked just fine.
+%bcond_with tcmalloc
+
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
@@ -19,6 +25,12 @@ BuildRequires: fuse-devel, libtool, libtool-ltdl-devel, boost-devel,
BuildRequires: libedit-devel, fuse-devel, git, perl, gdbm,
BuildRequires: nss-devel, libatomic_ops-devel
BuildRequires: pkgconfig, python, keyutils-libs-devel
+%if %{with tcmalloc}
+# use isa so this will not be satisfied by
+# google-perftools-devel.i686 on a x86_64 box
+# http://rpm.org/wiki/PackagerDocs/ArchDependencies
+BuildRequires: google-perftools-devel%{?_isa}
+%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires(post): chkconfig, binutils, libedit
Requires(preun): chkconfig
@@ -100,9 +112,12 @@ MY_CONF_OPT="$MY_CONF_OPT --with-gtk2"
MY_CONF_OPT="$MY_CONF_OPT --without-gtk2"
%endif
+# be explicit about --with/without-tcmalloc because the autoconf
+# default differs from what's needed for rpm
%{configure} --prefix=/usr --sbindir=/sbin \
--localstatedir=/var --sysconfdir=/etc \
---without-hadoop $MY_CONF_OPT
+--without-hadoop $MY_CONF_OPT \
+%{?with_tcmalloc:--with-tcmalloc} %{!?with_tcmalloc:--without-tcmalloc}
make -j$(getconf _NPROCESSORS_ONLN) CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS"