Permalink
Browse files

ceph.spec.in: Add packages for libcephfs-jni and libcephfs-java

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
  • Loading branch information...
1 parent fd482a2 commit 46344105e7b349ca98849fd60079950771251630 @glowell2 glowell2 committed Dec 19, 2012
Showing with 44 additions and 3 deletions.
  1. +44 −3 ceph.spec.in
View
@@ -189,8 +189,26 @@ Requires: libcephfs1 = %{version}-%{release}
%description -n ceph-test
This package contains Ceph benchmarks and test tools.
-# Enable building of debug package on distributions that don't automatically
-# build it.
+%package -n libcephfs-jni
+Summary: Java Native Interface library for CephFS Java bindings.
+Group: System Environment/Libraries
+License: LGPL-2.0
+Requires: java
+Requires: libcephfs1 = %{version}-%{release}
+BuildRequires: java-devel
+%description -n libcephfs-jni
+This package contains the Java Native Interface library for CephFS Java
+bindings.
+
+%package -n libcephfs-java
+Summary: Java libraries for the Ceph File System.
+Group: System Environment/Libraries
+License: LGPL-2.0
+Requires: java
+Requires: libcephfs-jni = %{version}-%{release}-
+BuildRequires: java-devel
+%description -n libcephfs-java
+This package contains the Java libraries for the Ceph File System.
%if (0%{?centos} || 0%{?opensuse} || 0%{?suse_version})
%debug_package
@@ -203,6 +221,11 @@ This package contains Ceph benchmarks and test tools.
%setup -q
%build
+# Find jni.h
+for i in -I/usr/lib/jvm/java/include{,/linux}; do
+ java_inc="$java_inc $i"
+done
+
./autogen.sh
MY_CONF_OPT=""
@@ -212,7 +235,8 @@ export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/i386/i486/'`
# be explicit about --with/without-tcmalloc because the
# autoconf default differs from what's needed for rpm
-%{configure} --prefix=/usr \
+%{configure} CPPFLAGS="$java_inc" \
+ --prefix=/usr \
--sbindir=/sbin \
--localstatedir=/var \
--sysconfdir=/etc \
@@ -222,6 +246,7 @@ export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/i386/i486/'`
--without-cryptopp \
--with-rest-bench \
--with-debug \
+ --enable-cephfs-java \
$MY_CONF_OPT \
%{?_with_ocf} \
%{?with_tcmalloc:--with-tcmalloc} %{!?with_tcmalloc:--without-tcmalloc} \
@@ -253,6 +278,13 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/ceph/
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/ceph/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ceph/
+# Relocate java packages to expected locations in buildroot.
+mkdir -p $RPM_BUILD_ROOT/usr/lib/jni
+mv $RPM_BUILD_ROOT/usr/lib64/libcephfs_jni.so* $RPM_BUILD_ROOT/usr/lib/jni/.
+mkdir -p $RPM_BUILD_ROOT/usr/share/java
+mv $RPM_BUILD_ROOT/usr/lib64/libcephfs.jar $RPM_BUILD_ROOT/usr/share/java/.
+mv $RPM_BUILD_ROOT/usr/lib64/libcephfs-test.jar $RPM_BUILD_ROOT/usr/share/java/.
+
%clean
rm -rf $RPM_BUILD_ROOT
@@ -523,4 +555,13 @@ fi
%{_bindir}/tpbench
%{_bindir}/xattr_bench
+%files -n libcephfs-jni
+%defattr(-,root,root,-)
+/usr/lib/jni/libcephfs_jni.so*
+
+%files -n libcephfs-java
+%defattr(-,root,root,-)
+/usr/share/java/libcephfs.jar
+/usr/share/java/libcephfs-test.jar
+
%changelog

0 comments on commit 4634410

Please sign in to comment.