diff options
author | Jack Lloyd <[email protected]> | 2017-09-24 19:14:44 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-09-24 19:14:44 -0400 |
commit | 3fd5092d5ae8ad6d9cba0a737f1f74f5823dea33 (patch) | |
tree | c768aee33583f23f5c5b8b479088fc1db012d7c1 /src | |
parent | b3dacffa086336385f8bf8cee8edeeb8c1c5af10 (diff) |
Make it possible to build the website from outside src dir
[ci skip]
Diffstat (limited to 'src')
-rw-r--r-- | src/build-data/botan.doxy.in | 2 | ||||
-rwxr-xr-x | src/scripts/website.sh | 47 |
2 files changed, 30 insertions, 19 deletions
diff --git a/src/build-data/botan.doxy.in b/src/build-data/botan.doxy.in index 2b203a323..d3d4944e2 100644 --- a/src/build-data/botan.doxy.in +++ b/src/build-data/botan.doxy.in @@ -79,7 +79,7 @@ WARN_AS_ERROR = YES #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = src/lib +INPUT = %{src_dir}/lib INPUT_ENCODING = UTF-8 FILE_PATTERNS = RECURSIVE = YES diff --git a/src/scripts/website.sh b/src/scripts/website.sh index 9662537e7..1284798ee 100755 --- a/src/scripts/website.sh +++ b/src/scripts/website.sh @@ -1,35 +1,46 @@ #!/bin/bash set -e -which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if available +# TODO rewrite in Python -SPHINX_CONFIG=./src/configs/sphinx +#which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if available -WEBSITE_DIR=./www-botan -WEBSITE_SRC_DIR=./www-src +script_path=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P) +botan_dir=$(cd ${script_path}/../.. && pwd -P) -rm -rf $WEBSITE_SRC_DIR $WEBSITE_DIR -mkdir -p $WEBSITE_SRC_DIR +SPHINX_CONFIG=${botan_dir}/src/configs/sphinx + +WEBSITE_DIR=./botan-website +TMP_DIR=$(mktemp -d) + +mkdir -p $WEBSITE_DIR + +${botan_dir}/configure.py --with-doxygen --with-sphinx --quiet + +# build doxygen +doxygen build/botan.doxy +mv build/docs/doxygen $WEBSITE_DIR/doxygen # build online manual -cp readme.rst $WEBSITE_SRC_DIR/index.rst -cp -r news.rst doc/security.rst $WEBSITE_SRC_DIR +cp ${botan_dir}/readme.rst $TMP_DIR/index.rst +cp -r ${botan_dir}/news.rst ${botan_dir}/doc/security.rst $TMP_DIR echo -e ".. toctree::\n\n index\n news\n security\n \ Users Manual <https://botan.randombit.net/manual>\n \ -API Reference <https://botan.randombit.net/doxygen>" > $WEBSITE_SRC_DIR/contents.rst +API Reference <https://botan.randombit.net/doxygen>" > $TMP_DIR/contents.rst + +sphinx-build -t website -c "$SPHINX_CONFIG" -b "html" $TMP_DIR $WEBSITE_DIR +sphinx-build -t website -c "$SPHINX_CONFIG" -b "html" ${botan_dir}/doc/manual $WEBSITE_DIR/manual +cp ${botan_dir}/license.txt ${botan_dir}/doc/pgpkey.txt $WEBSITE_DIR -sphinx-build -t website -c "$SPHINX_CONFIG" -b "html" $WEBSITE_SRC_DIR $WEBSITE_DIR -sphinx-build -t website -c "$SPHINX_CONFIG" -b "html" doc/manual $WEBSITE_DIR/manual rm -rf $WEBSITE_DIR/.doctrees rm -f $WEBSITE_DIR/.buildinfo rm -rf $WEBSITE_DIR/manual/.doctrees rm -f $WEBSITE_DIR/manual/.buildinfo -cp license.txt doc/pgpkey.txt $WEBSITE_DIR + # build manual as pdf for download -sphinx-build -t website -c "$SPHINX_CONFIG" -b "latex" doc/manual handbook-latex -(cd handbook-latex && pdflatex botan.tex && pdflatex botan.tex) -cp handbook-latex/botan.pdf $WEBSITE_DIR/manual/botan.pdf +sphinx-build -t website -c "$SPHINX_CONFIG" -b "latex" ${botan_dir}/doc/manual $TMP_DIR/latex +(cd $TMP_DIR/latex && pdflatex botan.tex && pdflatex botan.tex) +mv $TMP_DIR/latex/botan.pdf $WEBSITE_DIR/manual/botan.pdf + +rm -rf www-src build Makefile -# build doxygen -doxygen build/botan.doxy -mv build/docs/doxygen $WEBSITE_DIR/doxygen |