Skip to content

Commit

Permalink
pybind: move cephfs to Cython
Browse files Browse the repository at this point in the history
This change moves cephfs binding to Cython.

Closes-bug: #14818
Signed-off-by: Mehdi Abaakouk <sileht@redhat.com>
  • Loading branch information
Mehdi Abaakouk committed Feb 29, 2016
1 parent 8c054f7 commit 10f125f
Show file tree
Hide file tree
Showing 12 changed files with 971 additions and 605 deletions.
15 changes: 14 additions & 1 deletion admin/build-doc
Expand Up @@ -85,6 +85,7 @@ nm $vdir/lib/python*/*-packages/rados.so | grep 'U rados_' | \
# --global-option=build_ext --global-option="--cython-include-dirs $TOPDIR/src/pybind/rados/"
# but that doesn't work, so copying the file in the rbd module directly, that's ok for docs
cp -f $TOPDIR/src/pybind/rados/rados.pxd $TOPDIR/src/pybind/rbd/
cp -f $TOPDIR/src/pybind/rados/rados.pxd $TOPDIR/src/pybind/cephfs/

ln -sf librbd.so.1 $vdir/lib/librbd.so
gcc -shared -o $vdir/lib/librbd.so.1 -xc /dev/null
Expand All @@ -96,7 +97,19 @@ nm $vdir/lib/python*/*-packages/rbd.so | grep 'U rbd_' | \
awk '{ print "void "$2"(void) {}" }' | \
gcc -shared -o $vdir/lib/librbd.so.1 -xc -

rm -f $TOPDIR/src/pybind/rbd/rados.pxd

ln -sf libcephfs.so.1 $vdir/lib/libcephfs.so
gcc -shared -o $vdir/lib/libcephfs.so.1 -xc /dev/null
CFLAGS="-iquote $TOPDIR/src/include" \
CPPFLAGS="-iquote $TOPDIR/src/include" \
LDFLAGS="-L$vdir/lib -Wl,--no-as-needed" \
$vdir/bin/pip install $TOPDIR/src/pybind/cephfs
nm $vdir/lib/python*/*-packages/cephfs.so | grep 'U cephfs_' | \
awk '{ print "void "$2"(void) {}" }' | \
gcc -shared -o $vdir/lib/libcephfs.so.1 -xc -

rm -f $TOPDIR/src/pybind/rbd/rados.pxd $TOPDIR/src/pybind/cephfs/rados.pxd


$vdir/bin/sphinx-build -a -n -b dirhtml -d doctrees $TOPDIR/doc $TOPDIR/build-doc/output/html
$vdir/bin/sphinx-build -a -b man -d doctrees $TOPDIR/doc $TOPDIR/build-doc/output/man
Expand Down
3 changes: 2 additions & 1 deletion ceph.spec.in
Expand Up @@ -1254,7 +1254,8 @@ ln -sf %{_libdir}/librbd.so.1 /usr/lib64/qemu/librbd.so.1
#################################################################################
%files -n python-cephfs
%defattr(-,root,root,-)
%{python_sitelib}/cephfs.py*
%{python_sitearch}/cephfs.so
%{python_sitearch}/cephfs-*.egg-info
%{python_sitelib}/ceph_volume_client.py*

#################################################################################
Expand Down
3 changes: 2 additions & 1 deletion debian/python-cephfs.install
@@ -1,2 +1,3 @@
usr/lib/python*/dist-packages/cephfs.py*
usr/lib/python*/dist-packages/ceph_volume_client.py*
usr/lib/python*/dist-packages/cephfs.so
usr/lib/python*/dist-packages/cephfs-*.egg-info
1 change: 0 additions & 1 deletion src/Makefile-client.am
Expand Up @@ -77,7 +77,6 @@ cephfs_SOURCES = cephfs.cc
cephfs_LDADD = $(LIBCOMMON)
bin_PROGRAMS += cephfs

python_PYTHON += pybind/cephfs.py
python_PYTHON += pybind/ceph_volume_client.py

# libcephfs (this should go somewhere else in the future)
Expand Down
2 changes: 1 addition & 1 deletion src/civetweb
Submodule civetweb updated 1 files
+0 −4 src/civetweb.c
17 changes: 10 additions & 7 deletions src/pybind/Makefile.am
@@ -1,7 +1,5 @@

if ENABLE_CLIENT
if WITH_RADOS
if WITH_RBD
if WITH_CYTHON

PY_DISTUTILS = \
Expand All @@ -11,10 +9,15 @@ PY_DISTUTILS = \
CYTHON_BUILD_DIR="$(shell readlink -f $(builddir))/build" \
${PYTHON} ./setup.py

include pybind/rbd/Makefile.am
if WITH_RADOS
include pybind/rados/Makefile.am
if WITH_RBD
include pybind/rbd/Makefile.am
endif # WITH_RBD
if WITH_CEPHFS
include pybind/cephfs/Makefile.am
endif # WITH_CEPHFS
endif # WITH_RADOS

endif
endif
endif
endif
endif # WITH_CYTHON
endif # ENABLE_CLIENT

0 comments on commit 10f125f

Please sign in to comment.