gammalib.sh
2.51 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#! /bin/bash -f
# Set parameters
installdir=$(pwd)/build
makedoc="no"
echo "Checkout latest GammaLib"
rm -rf gammalib
cvs -Q -d /home/cvs export -N -r HEAD "gammalib"
# Extract version number
version=`cat gammalib/configure.ac | grep 'AC_INIT' | awk -F"[" '{print $3}' | sed 's/],//' | sed 's/\./ /g'`
version=`printf "%2.2d-%2.2d-%2.2d" $version`
echo "GammaLib version: "$version
# Set source directory
sourcedir=gammalib-$version
rm -rf $sourcedir
mv gammalib $sourcedir
#
echo "Create Makefile.in and configure scripts"
cd $sourcedir
./autogen.sh
rm -f gammalib.sh
cd ..
#
echo "Create gammalib_wrap.cpp and gammalib.py files for python binding (making swig obsolete)"
inc_inst="-I$sourcedir/inst/mwl/pyext -I$sourcedir/inst/lat/pyext -I$sourcedir/inst/cta/pyext"
opt_inst="-DWITH_INST_MWL -DWITH_INST_LAT -DWITH_INST_CTA"
swig -c++ -python -Wall -includeall -I$sourcedir/src $inc_inst $opt_inst -o $sourcedir/pyext/gammalib_wrap.cpp -outdir $sourcedir/pyext $sourcedir/pyext/gammalib.i
#
if [ "x$makedoc" == "xyes" ] ; then
echo "Create doxygen documentation"
cd $sourcedir/doc
doxygen Doxyfile
cd latex
make
make
dvips -o refman.ps refman
ps2pdf refman.ps
cd ../..
fi
#
echo "Create LaTeX documentation"
cd $sourcedir/doc
#
latex gammalib_um.tex
dvips gammalib_um.dvi -o gammalib_um.ps
ps2pdf gammalib_um.ps
rm -f gammalib_um.dvi gammalib_um.aux gammalib_um.log gammalib_um.tex gammalib_um.toc manual.sty gammalib_um.ps
#
cd dev/coding
latex gammalib_coding.tex
dvips gammalib_coding.dvi -o gammalib_coding.ps
ps2pdf gammalib_coding.ps
cd ../..
mv dev/coding/gammalib_coding.pdf .
#
cd dev/inst
latex gammalib_inst.tex
dvips gammalib_inst.dvi -o gammalib_inst.ps
ps2pdf gammalib_inst.ps
cd ../..
mv dev/inst/gammalib_inst.pdf .
#
cd dev/maths
latex gammalib_maths.tex
dvips gammalib_maths.dvi -o gammalib_maths.ps
ps2pdf gammalib_maths.ps
cd ../..
mv dev/maths/gammalib_maths.pdf .
#
cd dev/sdd
latex gammalib_sdd.tex
dvips gammalib_sdd.dvi -o gammalib_sdd.ps
ps2pdf gammalib_sdd.ps
cd ../..
mv dev/sdd/gammalib_sdd.pdf .
#
cd dev/srs
latex gammalib_srs.tex
dvips gammalib_srs.dvi -o gammalib_srs.ps
ps2pdf gammalib_srs.ps
cd ../..
mv dev/srs/gammalib_srs.pdf .
#
rm -rf dev
cd ../..
echo "Make files read/write"
chmod -R u+rw $sourcedir
echo "Create tarball"
tar cvf - $sourcedir > $sourcedir.tar
rm -f $sourcedir.tar.gz
gzip $sourcedir.tar
#
echo "Configure GammaLib"
cd $sourcedir
./configure --prefix=$installdir
#
echo "Compile GammaLib"
make -j10
#
echo "Check GammaLib"
make check
#
echo "Install GammaLib"
make install