Skip to content

Instantly share code, notes, and snippets.

@dkastl
Last active July 10, 2016 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkastl/5617030 to your computer and use it in GitHub Desktop.
Save dkastl/5617030 to your computer and use it in GitHub Desktop.
Build pgRouting
#!/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
@dkastl
Copy link
Author

dkastl commented Sep 20, 2013

To update translations and build localized documentation:

rm -Rf doc/i18n/de
rm -Rf doc/i18n/es
rm -Rf doc/i18n/fr
rm -Rf doc/i18n/ja

tx pull -f -l de
tx pull -f -l es
tx pull -f -l fr
tx pull -f -l ja

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

sphinx-build -b latex -a -E -D language='de' -c build/doc/_build . build/doc/latex/de
sphinx-build -b latex -a -E -D language='es' -c build/doc/_build . build/doc/latex/es
sphinx-build -b latex -a -E -D language='fr' -c build/doc/_build . build/doc/latex/fr
sphinx-build -b latex -a -E -D language='ja' -c build/doc/_build . build/doc/latex/ja

cp build/doc/html/en/index.html build/doc/html/de/index.html
cp build/doc/html/en/index.html build/doc/html/es/index.html
cp build/doc/html/en/index.html build/doc/html/fr/index.html
cp build/doc/html/en/index.html build/doc/html/ja/index.html

cd build/doc/latex/de && pdflatex -interaction=nonstopmode "pgRoutingDocumentation.tex" && cd ../../../../
cd build/doc/latex/es && pdflatex -interaction=nonstopmode "pgRoutingDocumentation.tex" && cd ../../../../
cd build/doc/latex/fr && pdflatex -interaction=nonstopmode "pgRoutingDocumentation.tex" && cd ../../../../
# Japanese does not work right now

@dkastl
Copy link
Author

dkastl commented Sep 20, 2013

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

@dkastl
Copy link
Author

dkastl commented Sep 20, 2013

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