diff options
author | Michal Minar <miminar@redhat.com> | 2014-04-24 14:05:39 +0200 |
---|---|---|
committer | Michal Minar <miminar@redhat.com> | 2014-04-24 14:59:33 +0200 |
commit | a6adf59e50a437369810126069adf11508cb11be (patch) | |
tree | 5917ca09fd3205598b65f42bf1d1b76421441cd1 /tools | |
parent | 0ad41e3e50b4502d79cd55419107222368845627 (diff) | |
download | openlmi-scripts-a6adf59e50a437369810126069adf11508cb11be.tar.gz openlmi-scripts-a6adf59e50a437369810126069adf11508cb11be.tar.xz openlmi-scripts-a6adf59e50a437369810126069adf11508cb11be.zip |
doc: created common makefile for documentation
Makefiles for documentation contained redundant code. Created one
generic Makefile which is included by all the others.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/build-with-sphinx.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/build-with-sphinx.sh b/tools/build-with-sphinx.sh new file mode 100755 index 0000000..c8a2620 --- /dev/null +++ b/tools/build-with-sphinx.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# This script creates a temporary python workspace directory, where the +# openlmi-scripts and all specified commands are installed in order for +# sphinx-build to successfuly find them and generate devel documentation out of +# them. +# +# There are several environment variables affecting the execution: +# * SPHINXBUILD +# sphinx binary generating the documentation +# * SRCDIR +# directory with sources +# * REQUIRED_COMMANDS list of commands that shall be installed before +# this command separated with commas + +SPHINXBUILD=${SPHINXBUILD:-sphinx-build} +SRCDIR="${SRCDIR:-.}" +REQUIRED_COMMANDS="${REQUIRED_COMMANDS:-}" +tmp=`mktemp -d` +export PYTHONPATH=$tmp +pushd "$SRCDIR" +echo "$REQUIRED_COMMANDS" | while IFS=, read cmd; do + [ -z "$cmd" ] && continue + pushd ../$cmd + python setup.py develop --install-dir=$tmp || exit 1 + popd +done +python setup.py develop --install-dir=$tmp || exit 1 +popd # .. +echo "Running: ${SPHINXBUILD} $@" +${SPHINXBUILD} "$@" || exit 1 +rm -rf $tmp |