summaryrefslogtreecommitdiffstats
path: root/docs/scripts/sphinx-make.sh
blob: 36596f219f53e0dc56b6c5e9491d27c81ccfd9e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

if [ "$1" == "venv" ]
then
    OS_ID=$(grep '^ID=' /etc/os-release  | cut -f2- -d= | sed -e 's/\"//g')
    if [ "$OS_ID" == "ubuntu" ]
    then
	sudo apt-get install -y python3-pip
    fi
    if [ "$OS_ID" == "centos" ]
    then
	sudo yum install -y python3-pip
    fi
    pip3 install --user virtualenv
    python3 -m virtualenv $VENV_DIR
    source $VENV_DIR/bin/activate;
    pip3 install -r $DOCS_DIR/etc/requirements.txt
else
    source $VENV_DIR/bin/activate;
    VERSION=`source $WS_ROOT/src/scripts/version`
    TM=`TZ=GMT date`
    sed -ie "s/**VPP Version:\*\* .*/**VPP Version:** $VERSION/" $DOCS_DIR/about.rst
    sed -ie "s/**Built on:\*\* .*/**Built on:** $TM/" $DOCS_DIR/about.rst
    rm $DOCS_DIR/about.rste
    make -C $DOCS_DIR $1
fi

deactivate