From: Kefu Chai Date: Wed, 29 Jun 2016 12:29:43 +0000 (+0800) Subject: rpm: build rpm with cmake X-Git-Tag: ses5-milestone5~493^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F10016%2Fhead;p=ceph.git rpm: build rpm with cmake Signed-off-by: Kefu Chai --- diff --git a/ceph.spec.in b/ceph.spec.in index d6467ec30f4b..c64cbd70d09c 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -623,49 +623,50 @@ 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_PREFIX=%{_prefix} \ + -DCMAKE_INSTALL_LIBDIR=%{_libdir} \ + -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 @@ -679,15 +680,19 @@ make %{?_smp_mflags} %if 0%{with tests} %check # run in-tree unittests -make %{?_smp_mflags} check +cd build +ctest %{?_smp_mflags} %endif %install +pushd build make DESTDIR=%{buildroot} install -find %{buildroot} -type f -name "*.la" -exec rm -f {} ';' +# we have dropped sysvinit bits +rm -f %{buildroot}/%{_sysconfdir}/init.d/ceph +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