prints face orientation quality now
[engrid.git] / build.bash
blob05384d6f550a03bc4d3ad18d8b81a70fedcf0358
1 #!/usr/bin/env bash
2 #
3 # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 # + +
5 # + This file is part of enGrid. +
6 # + +
7 # + Copyright 2008-2013 enGits GmbH +
8 # + +
9 # + enGrid is free software: you can redistribute it and/or modify +
10 # + it under the terms of the GNU General Public License as published by +
11 # + the Free Software Foundation, either version 3 of the License, or +
12 # + (at your option) any later version. +
13 # + +
14 # + enGrid is distributed in the hope that it will be useful, +
15 # + but WITHOUT ANY WARRANTY; without even the implied warranty of +
16 # + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
17 # + GNU General Public License for more details. +
18 # + +
19 # + You should have received a copy of the GNU General Public License +
20 # + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
21 # + +
22 # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
25 help ()
27 echo "usage :"
28 echo "`basename $0` CONFIGURATION"
29 echo "CONFIGURATION = fedora"
30 echo " ubuntu"
31 echo " opensuse-11.2"
32 echo " opensuse-11.3"
33 echo " opensuse-11.4"
34 echo " opensuse-12.1"
35 echo " opensuse-12.2"
38 # Check if all parameters are present
39 # If no, exit
40 if [ $# -ne 1 ]
41 then
42 help
43 else
44 echo ""
45 echo "This script makes use of the command 'sudo' to execute"
46 echo "the system's package manager in order to install all"
47 echo "required dependencies"
48 echo ""
49 whoami=`sudo whoami`
50 if [ "$whoami" != 'root' ]
51 then
52 echo "You seem to not be able to execute commands as root (via sudo)."
53 echo "Please make sure you have sufficient permissions; alternatively"
54 echo "you can directly execute this script as root."
55 echo ""
56 else
57 config_name=$1
58 if [ $1 = 'ubuntu' ]
59 then
60 sudo apt-get install git-core subversion g++ libvtk5-qt4-dev qt4-dev-tools patch
61 elif [ $1 = 'opensuse-11.2' ]
62 then
63 sudo zypper addrepo http://download.opensuse.org/repositories/science/openSUSE_11.2/ science
64 sudo zypper install git-core subversion libqt4-devel make vtk-qt vtk-devel patch
65 elif [ $1 = 'opensuse-11.3' ]
66 then
67 sudo zypper addrepo http://download.opensuse.org/repositories/science/openSUSE_11.3/ science
68 sudo zypper install git-core subversion libqt4-devel make vtk-qt vtk-devel patch
69 elif [ $1 = 'opensuse-11.4' ]
70 then
71 sudo zypper addrepo http://download.opensuse.org/repositories/science/openSUSE_11.4/ science
72 sudo zypper install git-core subversion libqt4-devel make vtk-qt vtk-devel patch
73 elif [ $1 = 'opensuse-12.1' ]
74 then
75 sudo zypper addrepo http://download.opensuse.org/repositories/science/openSUSE_12.1/ science
76 sudo zypper install git-core subversion libqt4-devel make vtk-qt vtk-devel patch
77 elif [ $1 = 'opensuse-12.2' ]
78 then
79 sudo zypper addrepo http://download.opensuse.org/repositories/science/openSUSE_12.2/ science
80 sudo zypper install git-core subversion libqt4-devel make vtk-qt vtk-devel patch
81 elif [ $1 = 'fedora' ]
82 then
83 sudo yum -y install git
84 sudo yum -y install subversion
85 sudo yum -y install wget
86 sudo yum -y install gcc-c++
87 sudo yum -y install vtk-qt
88 sudo yum -y install vtk-devel
89 sudo yum -y install patch
90 else
91 help
94 for url_address in git://github.com/enGits/engrid.git \
95 https://github.com/enGits/engrid.git \
96 git://repo.or.cz/engrid-github.git \
97 http://repo.or.cz/r/engrid-github.git; do
99 if git clone $url_address engrid ; then
100 break;
101 else
102 echo "Repository $url_address failed. Trying the next one..."
104 done
106 cd engrid
107 #git checkout -b release-1.4 remotes/origin/release-1.4
108 git checkout 1.4.0
109 cd src
110 source scripts/setup_pathes.bash
111 source scripts/build-nglib.sh
112 cd libengrid
113 qmake
114 make -j4
115 cd ..
116 qmake
117 make
118 cd ../..
119 echo ""
120 echo "You can start enGrid by typing: `pwd`/engrid/run.bash (as non-root user)"
121 echo "If you want to install a link in '/usr/bin' as well as an entry in the"
122 echo "desktop menus, please execute 'engrid/setup_generic.bash'"
123 echo ""