7 install -d -m0755 build-doc
9 if command -v dpkg
>/dev
/null
; then
10 packages
=`cat ${TOPDIR}/doc_deps.deb.txt`
11 for package
in $packages; do
12 if [ "$(dpkg --status -- $package 2>&1 | sed -n 's/^Status: //p')" != "install ok installed" ]; then
13 # add a space after old values
14 missing
="${missing:+$missing }$package"
17 if [ -n "$missing" ]; then
18 echo "$0: missing required packages, please install them:" 1>&2
19 echo "sudo apt-get install -o APT::Install-Recommends=true $missing" 1>&2
22 elif command -v yum
>/dev
/null
; then
23 for package
in ant ditaa doxygen libxslt-devel libxml2-devel graphviz python3-devel python3-pip python3-Cython
; do
24 if ! rpm
-q --whatprovides $package >/dev
/null
; then
25 missing
="${missing:+$missing }$package"
28 if [ -n "$missing" ]; then
29 echo "$0: missing required packages, please install them:" 1>&2
30 echo "yum install $missing"
34 for command in dot doxygen ant ditaa cython
; do
35 if ! command -v "$command" > /dev
/null
; then
36 # add a space after old values
37 missing
="${missing:+$missing }$command"
40 if [ -n "$missing" ]; then
41 echo "$0: missing required command, please install them:" 1>&2
47 # Don't enable -e until after running all the potentially-erroring checks
48 # for availability of commands
51 [ -z "$vdir" ] && vdir="$TOPDIR/build-doc/virtualenv"
53 if [ ! -e $vdir ]; then
57 $vdir/bin
/pip
install --quiet wheel
58 $vdir/bin
/pip
install --quiet \
59 -r $TOPDIR/admin
/doc-requirements.txt \
60 -r $TOPDIR/admin
/doc-python-common-requirements.txt
61 BUILD_DOC
=1 $vdir/bin
/pip
install --quiet \
62 -r $TOPDIR/admin
/doc-pybind.txt
65 $TOPDIR/build-doc
/output
/html \
66 $TOPDIR/build-doc
/output
/man
71 sphinx_targets
="$sphinx_targets $opt"
80 if [ -z "$sphinx_targets" ]; then
81 sphinx_targets
="html man"
86 for target
in $sphinx_targets; do
87 # Build with -W so that warnings are treated as errors and this fails
90 $vdir/bin
/sphinx-build
-W --keep-going -a -b dirhtml
-d doctrees \
91 $TOPDIR/doc
$TOPDIR/build-doc
/output
/$target
94 $vdir/bin
/sphinx-build
-W --keep-going -a -b man
-t man
-d doctrees \
95 $TOPDIR/doc
$TOPDIR/build-doc
/output
/$target
98 $vdir/bin
/pip
install --quiet sphinx-autobuild
99 $vdir/bin
/sphinx-autobuild
--re-ignore '.*\.dot' "$@" \
100 $TOPDIR/doc
$TOPDIR/build-doc
/output
/html
106 # Build and install JavaDocs
108 JAVADIR
=$TOPDIR/src
/java
110 # Clean and build JavaDocs
112 ant
-buildfile $JAVADIR/build.xml docs
114 # Create clean target directory
115 JAVA_OUTDIR
=$TOPDIR/build-doc
/output
/html
/cephfs
/api
/libcephfs-java
/javadoc
119 # Copy JavaDocs to target directory
120 cp -a $JAVADIR/doc
/* $JAVA_OUTDIR/