Permalink
Browse files

doc: add doc for pybind of rgw

Signed-off-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information...
1 parent cb351a9 commit 8fd95430fe254d0c745b23a10f86aa2bdd8659ec @tchaikov tchaikov committed Nov 8, 2016
Showing with 39 additions and 39 deletions.
  1. +19 −39 admin/build-doc
  2. +6 −0 doc/api/index.rst
  3. +14 −0 doc/radosgw/api.rst
  4. 0 src/pybind/rgw/{rgw_file.pyx → rgw.pyx}
View
@@ -72,49 +72,29 @@ mkdir -p $vdir/lib
export LD_LIBRARY_PATH="$vdir/lib"
export PYTHONPATH=$TOPDIR/src/pybind
-ln -sf librados.so.2 $vdir/lib/librados.so
-gcc -shared -o $vdir/lib/librados.so.2 -xc /dev/null
-BUILD_DOC=1 \
- 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/rados
-nm $vdir/lib/python*/*-packages/rados.so | grep 'U rados_' | \
- awk '{ print "void "$2"(void) {}" }' | \
- gcc -shared -o $vdir/lib/librados.so.2 -xc -
-
# FIXME(sileht): I dunno how to pass the include-dirs correctly with pip
# for build_ext step, it should be:
# --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
-BUILD_DOC=1 \
- 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/rbd
-nm $vdir/lib/python*/*-packages/rbd.so | grep 'U rbd_' | \
- awk '{ print "void "$2"(void) {}" }' | \
- gcc -shared -o $vdir/lib/librbd.so.1 -xc -
-
-
-ln -sf libcephfs.so.1 $vdir/lib/libcephfs.so
-gcc -shared -o $vdir/lib/libcephfs.so.1 -xc /dev/null
-BUILD_DOC=1 \
- 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
-
+for bind in rados rbd cephfs rgw; do
+ if [ ${bind} != rados ]; then
+ cp -f $TOPDIR/src/pybind/rados/rados.pxd $TOPDIR/src/pybind/${bind}/
+ fi
+ ln -sf lib${bind}.so.1 $vdir/lib/lib${bind}.so
+ gcc -shared -o $vdir/lib/lib${bind}.so.1 -xc /dev/null
+ BUILD_DOC=1 \
+ 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/${bind}
+ # rgwfile_version(), librgw_create(), rgw_mount()
+ nm $vdir/lib/python*/*-packages/${bind}.so | grep -E "U (lib)?${bind}" | \
+ awk '{ print "void "$2"(void) {}" }' | \
+ gcc -shared -o $vdir/lib/lib${bind}.so.1 -xc -
+ if [ ${bind} != rados ]; then
+ rm -f $TOPDIR/src/pybind/${bind}/rados.pxd
+ fi
+done
$vdir/bin/sphinx-build -a -n -b dirhtml -d doctrees $TOPDIR/doc $TOPDIR/build-doc/output/html
$vdir/bin/sphinx-build -a -b man -t man -d doctrees $TOPDIR/doc $TOPDIR/build-doc/output/man
View
@@ -26,6 +26,12 @@ See `librbdpy`_.
.. _librbdpy: ../rbd/librbdpy
+Ceph RADOS Gateway APIs
+=======================
+
+See `librgw-py`_.
+
+.. _librgw-py: ../radosgw/api
Calamari APIs
=============
View
@@ -0,0 +1,14 @@
+===============
+librgw (Python)
+===============
+
+.. highlight:: python
+
+The `rgw` python module provides file-like access to rgw.
+
+API Reference
+=============
+
+.. automodule:: rgw
+ :members: LibRGWFS, FileHandle
+
File renamed without changes.

0 comments on commit 8fd9543

Please sign in to comment.