removed commented code
[engrid.git] / build.bash
blob2b6488721539e9fa1b0ef93dc9c7a552417c9ddb
1 #!/usr/bin/env bash
2 #
3 # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 # + +
5 # + This file is part of enGrid. +
6 # + +
7 # + Copyright 2008-2011 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-15-32"
30 echo " fedora-15-64"
31 echo " fedora-14-32"
32 echo " fedora-14-64"
33 echo " ubuntu"
34 echo " opensuse-11.2-32"
35 echo " opensuse-11.2-64"
36 echo " opensuse-11.3-32"
37 echo " opensuse-11.3-64"
38 echo " opensuse-11.4-32"
39 echo " opensuse-11.4-64"
42 # Check if all parameters are present
43 # If no, exit
44 if [ $# -ne 1 ]
45 then
46 help
47 else
48 echo ""
49 echo "This script makes use of the command 'sudo' to execute"
50 echo "the system's package manager in order to install all"
51 echo "required dependencies"
52 echo ""
53 whoami=`sudo whoami`
54 if [ "$(whoami)" != 'root' ]
55 then
56 echo "You seem to not be able to execute commands as root (via sudo)."
57 echo "Please make sure you have sufficient permissions; alternatively"
58 echo "you can directly execute this script as root."
59 echo ""
60 else
61 config_name=$1
62 if [ $1 = 'ubuntu' ]
63 then
64 sudo apt-get install git-core subversion libvtk5-qt4-dev qt4-dev-tools
65 elif [ $1 = 'opensuse-11.2-32' ]
66 then
67 sudo zypper addrepo http://download.opensuse.org/repositories/science/openSUSE_11.2/ science
68 sudo zypper install git-core subversion libqt4-devel make vtk-qt vtk-devel
69 config_name="opensuse32"
70 elif [ $1 = 'opensuse-11.3-32' ]
71 then
72 sudo zypper addrepo http://download.opensuse.org/repositories/science/openSUSE_11.3/ science
73 sudo zypper install git-core subversion libqt4-devel make vtk-qt vtk-devel
74 config_name="opensuse"
75 elif [ $1 = 'opensuse-11.4-32' ]
76 then
77 sudo zypper addrepo http://download.opensuse.org/repositories/science/openSUSE_11.4/ science
78 sudo zypper install git-core subversion libqt4-devel make vtk-qt vtk-devel
79 config_name="opensuse32"
80 elif [ $1 = 'opensuse-11.2-64' ]
81 then
82 sudo zypper addrepo http://download.opensuse.org/repositories/science/openSUSE_11.2/ science
83 sudo zypper install git-core subversion libqt4-devel make vtk-qt vtk-devel
84 config_name="opensuse64"
85 elif [ $1 = 'opensuse-11.3-64' ]
86 then
87 sudo zypper addrepo http://download.opensuse.org/repositories/science/openSUSE_11.3/ science
88 sudo zypper install git-core subversion libqt4-devel make vtk-qt vtk-devel
89 config_name="opensuse64"
90 elif [ $1 = 'opensuse-11.4-64' ]
91 then
92 sudo zypper addrepo http://download.opensuse.org/repositories/science/openSUSE_11.4/ science
93 sudo zypper install git-core subversion libqt4-devel make vtk-qt vtk-devel
94 config_name="opensuse64"
95 elif [ $1 = 'fedora-15-32' ]
96 then
97 sudo yum -y install git
98 sudo yum -y install subversion
99 sudo yum -y install wget
100 sudo yum -y install gcc-c++
101 sudo yum -y install vtk-qt
102 config_name="fedora32"
103 elif [ $1 = 'fedora-15-64' ]
104 then
105 sudo yum -y install git
106 sudo yum -y install subversion
107 sudo yum -y install wget
108 sudo yum -y install gcc-c++
109 sudo yum -y install vtk-qt
110 config_name="fedora64"
111 elif [ $1 = 'fedora-14-64' ]
112 then
113 sudo yum -y install git
114 sudo yum -y install subversion
115 sudo yum -y install wget
116 sudo yum -y install gcc-c++
117 sudo yum -y install vtk-qt
118 config_name="fedora64"
119 else
120 help
122 git clone git://engrid.git.sourceforge.net/gitroot/engrid/engrid
123 echo $config_name > engrid/config.txt
124 cd engrid
125 git checkout -b release-1.3 remotes/origin/release-1.3
126 cd src
127 source scripts/setup_pathes.bash $config_name
128 source scripts/build-nglib.sh
129 cd libengrid
130 qmake
131 make -j4
132 cd ..
133 qmake
134 make
135 cd ../..
136 echo ""
137 echo "You can start enGrid by typing: `pwd`/engrid/run.bash (as non-root user)"
138 echo "If you want to install a link in '/usr/bin' as well as an entry in the"
139 echo "desktop menus, please execute 'source engrid/setup_generic.bash'"
140 echo ""