Skip to content

Commit

Permalink
rpm: build rpm with cmake
Browse files Browse the repository at this point in the history
Signed-off-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
tchaikov committed Jul 1, 2016
1 parent b6a69ae commit c57998c
Showing 1 changed file with 33 additions and 32 deletions.
65 changes: 33 additions & 32 deletions ceph.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -623,49 +623,48 @@ for i in /usr/{lib64,lib}/jvm/java/include{,/linux}; do
done
%endif

./autogen.sh

%if %{with lowmem_builder}
RPM_OPT_FLAGS="$RPM_OPT_FLAGS --param ggc-min-expand=20 --param ggc-min-heapsize=32768"
%endif
export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/i386/i486/'`

%{configure} CPPFLAGS="$java_inc" \
--prefix=/usr \
--libexecdir=%{_libexecdir} \
--localstatedir=%{_localstatedir} \
--sysconfdir=%{_sysconfdir} \
export CPPFLAGS="$java_inc"
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"

mkdir build
cd build
%cmake .. \
-DCMAKE_INSTALL_LIBEXECDIR=%{_libexecdir} \
-DCMAKE_INSTALL_LOCALSTATEDIR=%{_localstatedir} \
-DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} \
-DCMAKE_INSTALL_MANDIR=%{_mandir} \
-DCMAKE_INSTALL_DOCDIR=%{_docdir}/ceph \
-DWITH_MANPAGE=ON \
-DWITH_SYSTEMD=ON \
%if 0%{?rhel} && ! 0%{?centos}
--enable-subman \
%endif
--with-systemdsystemunitdir=%_unitdir \
--docdir=%{_docdir}/ceph \
--with-man-pages \
--mandir="%_mandir" \
--with-nss \
--without-cryptopp \
--with-debug \
%if 0%{with cephfs_java}
--enable-cephfs-java \
-DWITH_SUBMAN=ON \
%endif
%if 0%{with xio}
--enable-xio \
-DWITH_XIO=ON \
%endif
%if 0%{with cephfs_java}
-DWITH_CEPHFS_JAVA=ON \
%endif
%if 0%{with selinux}
--with-selinux \
-DWITH_SELINUX=ON \
%endif
--with-librocksdb-static=check \
--with-radosgw \
%if %{without lttng}
--without-lttng \
--without-babeltrace \
%if %{with lttng}
-DWITH_LTTNG=ON \
-DHAVE_BABELTRACE=ON \
%else
-DWITH_LTTNG=OFF \
-DHAVE_BABELTRACE=OFF \
%endif
$CEPH_EXTRA_CONFIGURE_ARGS \
%{?_with_ocf} \
%if %{without tcmalloc}
--without-tcmalloc \
$CEPH_EXTRA_CMAKE_ARGS \
%if 0%{with ocf}
-DWITH_OCF=ON
%endif
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS"

%if %{with lowmem_builder}
%if 0%{?jobs} > 8
Expand All @@ -679,15 +678,17 @@ make %{?_smp_mflags}
%if 0%{with tests}
%check
# run in-tree unittests
make %{?_smp_mflags} check
cd build
ctest -V %{?_smp_mflags}

%endif



%install
pushd build
make DESTDIR=%{buildroot} install
find %{buildroot} -type f -name "*.la" -exec rm -f {} ';'
popd
install -D src/etc-rbdmap %{buildroot}%{_sysconfdir}/ceph/rbdmap
%if 0%{?fedora} || 0%{?rhel}
install -m 0644 -D etc/sysconfig/ceph %{buildroot}%{_sysconfdir}/sysconfig/ceph
Expand Down

0 comments on commit c57998c

Please sign in to comment.