1 |
|
2 |
############################################################################## |
3 |
# |
4 |
# Copyright (c) 2009-2012 by University of Queensland |
5 |
# http://www.uq.edu.au |
6 |
# |
7 |
# Primary Business: Queensland, Australia |
8 |
# Licensed under the Open Software License version 3.0 |
9 |
# http://www.opensource.org/licenses/osl-3.0.php |
10 |
# |
11 |
# Development until 2012 by Earth Systems Science Computational Center (ESSCC) |
12 |
# Development since 2012 by School of Earth Sciences |
13 |
# |
14 |
############################################################################## |
15 |
|
16 |
import os |
17 |
Import('*') |
18 |
local_env = env.Clone(tools=['pdflatex']) |
19 |
|
20 |
tex_src = Glob('*.tex')+Glob('*.bib')+Glob('*.cls') |
21 |
fig_src = Glob('figures/*.png')+Glob('figures/*.pdf') |
22 |
if local_env['pdflatex']: |
23 |
if local_env['verbose']: |
24 |
interaction='-interaction=nonstopmode' |
25 |
else: |
26 |
interaction='-interaction=batchmode' |
27 |
|
28 |
# Define command to include SVN revision |
29 |
local_env.Append(PDFLATEXFLAGS=[interaction,'\\\\newcommand{\\\\RepVersion}{%s\\\\xspace}\\\\input{cookbook.tex}'%(local_env['svn_revision'])]) |
30 |
cbpdf=local_env.PDF(target='cookbook.pdf', source='cookbook.tex') |
31 |
Depends(cbpdf, fig_src+tex_src) |
32 |
|
33 |
pdf_path=os.path.join(release_dir, 'cookbook', 'cookbook.pdf') |
34 |
pdf_inst=local_env.InstallAs(target=pdf_path, source=cbpdf) |
35 |
env.Alias('cookbook_pdf', pdf_inst) |
36 |
else: |
37 |
env.Alias('cookbook_pdf', '', '@echo "Not building cookbook: PDF output not supported!"') |
38 |
env.AlwaysBuild('cookbook_pdf') |
39 |
|