]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rpm: build rpm with cmake 10016/head
authorKefu Chai <kchai@redhat.com>
Wed, 29 Jun 2016 12:29:43 +0000 (20:29 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 6 Jul 2016 02:07:20 +0000 (10:07 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
ceph.spec.in

index d6467ec30f4b57678d33e7f3696d0273e4ccc658..c64cbd70d09cc618c692cf63d8c4bd72a3627a60 100644 (file)
@@ -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