ceph/admin/build-doc
Tommi Virtanen 2bdf9078ef doc: Reorganize pip calls to use a requirements file.
The conditional before running pip install was unnecessary,
"pip install" on already installed packages is fast (as long
as it's not --upgrade), and --quiet makes it not spam the
console.

Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-12-06 12:13:03 -08:00

63 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
set -e
cd "$(dirname "$0")"
cd ..
install -d -m0755 build-doc
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
if [ ! -e build-doc/doxygen/xml ]; then
doxygen
fi
cat src/osd/PG.h src/osd/PG.cc | doc/scripts/gen_state_diagram.py > doc/dev/peering_graph.generated.dot
cd build-doc
if [ ! -e virtualenv ]; then
virtualenv --no-site-packages virtualenv
fi
./virtualenv/bin/pip install --quiet -r ../admin/doc-requirements.txt
# ugly kludge until breathe is distutils-friendly
install -d breathe
cd breathe
if [ ! -e .git ]; then
git init
fi
if [ -z "$(git rev-parse --default HEAD)" ]; then
git pull --ff-only https://github.com/michaeljones/breathe.git master
fi
cd ..
install -d -m0755 \
output/html \
output/man
PYTHONPATH=`pwd`/../src/pybind ./virtualenv/bin/sphinx-build -a -b dirhtml -d doctrees ../doc output/html
./virtualenv/bin/sphinx-build -a -b man -d doctrees ../doc output/man