summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Lowell <gary.lowell@inktank.com>2012-12-18 19:40:32 -0800
committerGary Lowell <gary.lowell@inktank.com>2012-12-18 19:40:32 -0800
commit46344105e7b349ca98849fd60079950771251630 (patch)
treea2708f263e71ad84ba07bcedf2a969e022043dca
parentfd482a27818538e3561bb83b7ecd12c3056bb3af (diff)
downloadceph-46344105e7b349ca98849fd60079950771251630.tar.gz
ceph.spec.in: Add packages for libcephfs-jni and libcephfs-java
Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
-rw-r--r--ceph.spec.in47
1 files changed, 44 insertions, 3 deletions
diff --git a/ceph.spec.in b/ceph.spec.in
index c64108c9da8..6f95c56c8ca 100644
--- a/ceph.spec.in
+++ b/ceph.spec.in
@@ -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