ctools.sh
1.1 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
#! /bin/bash -f
# Set parameters
installdir=$(pwd)/build
echo "Checkout latest ctools"
rm -rf ctools
cvs -Q -d /home/cvs export -N -r HEAD "ctools"
# Extract version number
version=`cat ctools/configure.ac | grep 'AC_INIT' | awk -F"[" '{print $3}' | sed 's/],//' | sed 's/\./ /g'`
version=`printf "%2.2d-%2.2d-%2.2d" $version`
echo "ctools version: "$version
# Set directory name
sourcedir=ctools-$version
rm -rf $sourcedir
mv ctools $sourcedir
echo "Create Makefile.in and configure scripts"
cd $sourcedir
./autogen.sh
rm -f ctools.sh
cd ..
echo "Create ctool_wrap.cpp and ctool.py files for python binding (making swig obsolete)"
swig -c++ -python -Wall -includeall -I$installdir/share/gammalib/swig -o $sourcedir/pyext/ctools_wrap.cpp -outdir $sourcedir/pyext $sourcedir/pyext/ctools.i
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 ctools"
cd $sourcedir
./configure --prefix=$installdir
echo "Compile ctools"
make -j10
echo "Check ctools"
make check
echo "Install ctools"
make install