Salome HOME
Merge branch 'spns/20216' of https://codev-tuleap.cea.fr/plugins/git/salome/sat_salom...
[tools/sat_salome.git] / products / compil_scripts / gl2ps-1.4.0.sh
1 #!/bin/bash
2 echo "##########################################################################"
3 echo "ispc" $VERSION
4 echo "##########################################################################"
5 if [[ $DIST_NAME == "DB" && $DIST_VERSION == "10" ]]
6 then
7     # seems like SAT does not create BUILD_DIR ( ask for patch integration)
8     mkdir -p $INSTALL_DIR && mkdir -p $BUILD_DIR && cd $BUILD_DIR
9     # check wether a folder named
10     FMT_EXISTS=0
11     if [[ -e "$HOME/.texlive2018/texmf-var/web2c/pdftex/pdflatex.fmt" ]]
12     then
13         FMT_EXISTS=1
14         mv $HOME/.texlive2018/texmf-var/web2c/pdftex/pdflatex.fmt $HOME/.texlive2018/texmf-var/web2c/pdftex/pdflatex.fmt.old
15     fi
16
17     CMAKE_OPTIONS=""
18     CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_INSTALL}"
19     CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Release"
20     CMAKE_OPTIONS+=" -DENABLE_PNG=ON"
21     CMAKE_OPTIONS+=" -DENABLE_ZLIB=ON"
22     CMAKE_OPTIONS+=" -DENABLE_GLUT=OFF"
23     echo
24     echo "*** cmake" ${CMAKE_OPTIONS}
25     cmake ${CMAKE_OPTIONS} $SOURCE_DIR
26     if [ $? -ne 0 ]
27     then
28         echo "ERROR on cmake"
29         exit 1
30     fi
31     
32     echo
33     echo "*** make"
34     make
35     if [ $? -ne 0 ]
36     then
37         echo "ERROR on make"
38         exit 2
39     fi
40     
41     echo
42     echo "*** make"
43     make install
44     if [ $? -ne 0 ]
45     then
46         echo "ERROR on make install"
47         exit 3
48     fi
49     
50     #
51     if [[ $FMT_EXISTS -eq 1 ]]
52        then
53         mv $HOME/.texlive2018/texmf-var/web2c/pdftex/pdflatex.fmt.old $HOME/.texlive2018/texmf-var/web2c/pdftex/pdflatex.fmt
54     fi   
55     echo
56     echo "########## END"
57 else
58     echo "ERROR distribution: issue with: $DIST_NAME $DIST_VERSION - please fix gl2ps.sh script..."
59     exit 1
60 fi