2011-08-19 23:43:21 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
cd ..
|
|
|
|
|
2011-08-29 22:43:41 +00:00
|
|
|
install -d -m0755 build-doc
|
|
|
|
|
2011-12-06 20:04:03 +00:00
|
|
|
if command -v dpkg >/dev/null; then
|
|
|
|
for package in python-dev python-pip python-virtualenv doxygen ditaa; do
|
|
|
|
if [ "$(dpkg --status -- $package|sed -n 's/^Status: //p')" != "install ok installed" ]; then
|
|
|
|
# add a space after old values
|
|
|
|
missing="${missing:+$missing }$package"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -n "$missing" ]; then
|
|
|
|
echo "$0: missing required packages, please install them:" 1>&2
|
|
|
|
echo "sudo apt-get install $missing"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
for command in virtualenv doxygen ditaa; do
|
|
|
|
if ! command -v "$command" >/dev/null; then
|
|
|
|
# add a space after old values
|
|
|
|
missing="${missing:+$missing }$package"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -n "$missing" ]; then
|
|
|
|
echo "$0: missing required command, please install them:" 1>&2
|
|
|
|
echo "$missing"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2011-08-29 22:43:41 +00:00
|
|
|
if [ ! -e build-doc/doxygen/xml ]; then
|
|
|
|
doxygen
|
|
|
|
fi
|
|
|
|
|
2011-11-30 00:24:35 +00:00
|
|
|
cat src/osd/PG.h src/osd/PG.cc | doc/scripts/gen_state_diagram.py > doc/dev/peering_graph.generated.dot
|
|
|
|
|
2011-08-19 23:43:21 +00:00
|
|
|
cd build-doc
|
|
|
|
|
2012-03-12 23:46:31 +00:00
|
|
|
[ -z "$vdir" ] && vdir="./virtualenv"
|
|
|
|
|
|
|
|
if [ ! -e $vdir ]; then
|
2012-10-03 21:02:55 +00:00
|
|
|
virtualenv --system-site-packages $vdir
|
|
|
|
fi
|
|
|
|
$vdir/bin/pip install -r ../admin/doc-requirements.txt
|
|
|
|
|
|
|
|
sphinx_build="$vdir/bin/sphinx-build"
|
|
|
|
if [ ! -e $sphinx_build ]; then
|
|
|
|
# If sphinx is not installed inside the virtualenv (that is, we
|
|
|
|
# have a system-wide sphinx installed and it is new enough), use
|
|
|
|
# that. As we need to use the python interpreter from inside the
|
|
|
|
# virtualenv to make the sphinx extensions visible, we need need
|
|
|
|
# to know the full path to the sphinx-build script.
|
|
|
|
sphinx_build="$(command -v -p sphinx-build)"
|
2011-08-19 23:43:21 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
install -d -m0755 \
|
|
|
|
output/html \
|
|
|
|
output/man
|
2012-10-03 21:02:55 +00:00
|
|
|
PYTHONPATH="$(pwd)/../src/pybind" "$vdir/bin/python" "$sphinx_build" -a -b dirhtml -d doctrees ../doc output/html
|
|
|
|
"$vdir/bin/python" "$sphinx_build" -a -b man -d doctrees ../doc output/man
|