Last active
July 10, 2016 14:35
-
-
Save dkastl/5617030 to your computer and use it in GitHub Desktop.
Build pgRouting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install dependencies Ubuntu 14.04 | |
sudo apt-get install git cmake build-essential libcgal-dev libboost-graph-dev libboost-thread-dev python-sphinx texlive texlive-latex-extra postgresql-9.4-postgis-2.1 postgresql-server-dev-all checkinstall | |
# Clone the repository | |
git clone git@github.com:pgRouting/pgrouting.git && cd pgrouting && git checkout develop | |
# Compile | |
rm -Rf build | |
cmake -H. -Bbuild -DBUILD_LATEX=ON -DWITH_DOC=ON | |
cd build | |
make all doc | |
cd .. | |
# Build and replace package | |
sudo dpkg -r pgrouting && cd build && sudo checkinstall -y --nodoc --pkgversion=2.0.0 --pkgname=pgrouting && cd .. | |
# Rebuild docs | |
sphinx-build -b html -a -d build/doc/_doctrees/ -c build/doc/_build . build/html | |
# Create gh-pages | |
git checkout gh-pages && rm -Rf dev | |
cp -r build/html dev | |
cp build/latex/pgRoutingDocumentation.pdf dev/ | |
gzip -c build/man/pgrouting.7 > dev/pgrouting.7.gz | |
git add dev && cp build/index.html . | |
git commit -m "updated to latest commit of develop branch" . && git push origin gh-pages | |
# Translations | |
# http://sphinx.readthedocs.org/en/latest/intl.html | |
# https://www.transifex.com/projects/p/pgrouting/ | |
sudo pip install sphinx-intl | |
sudo pip install transifex-client | |
# Remove translation related files and folders | |
rm -Rf .tx | |
rm -Rf doc/i18n | |
tx init | |
# Create | |
sphinx-intl update -c build/doc/_build/conf.py -p doc/i18n/pot -d doc/i18n -l es -l fr -l de -l ja | |
# Build | |
sphinx-intl build -c build/doc/_build/conf.py -p doc/i18n/pot -d doc/i18n | |
# Update | |
sphinx-intl update -c build/doc/_build/conf.py -p doc/i18n/pot -d doc/i18n | |
# Register POT files for upload | |
sphinx-intl update-txconfig-resources -c build/doc/_build/conf.py -p doc/i18n/pot -d doc/i18n --transifex-project-name=pgrouting | |
# Upload/Download from/to Transifex | |
tx push -s | |
tx pull -l de | |
tx pull -l de -f --minimum-perc=1 | |
sphinx-intl build -c build/doc/_build/conf.py -p doc/i18n/pot -d doc/i18n | |
sphinx-build -b html -a -E -D language='de' -c build/doc/_build . build/doc/html/de | |
sphinx-build -b html -a -E -D language='es' -c build/doc/_build . build/doc/html/es | |
sphinx-build -b html -a -E -D language='fr' -c build/doc/_build . build/doc/html/fr | |
sphinx-build -b html -a -E -D language='ja' -c build/doc/_build . build/doc/html/ja |
Update GH Pages:
git checkout -- VERSION
git checkout gh-pages
git pull origin gh-pages
rm -Rf 2.0
cp -R build/doc/html 2.0
mv 2.0/index.html .
cp build/doc/latex/en/pgRoutingDocumentation.pdf 2.0/en
cp build/doc/latex/es/pgRoutingDocumentation.pdf 2.0/es/
cp build/doc/latex/fr/pgRoutingDocumentation.pdf 2.0/fr/
gzip -c build/doc/man/en/pgrouting.7 > 2.0/en/pgrouting.7.gz
git add 2.0
git commit -m "multilingual pgRouting 2.0.0 docs" .
git push origin gh-page
Recreate .pot files:
sphinx-build -b gettext -c build/doc/_build . doc/i18n/pot
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To update translations and build localized documentation: