Build instructions update: Cesare Guardino
[foam-extend-3.2.git] / ThirdParty / AllMake.stage5
blob0d86392f2f61d3145c81ab3160d29e4b4e56a7d4
1 #!/bin/bash
2 #------------------------------------------------------------------------------
3 # ========= |
4 # \\ / F ield | foam-extend: Open Source CFD
5 # \\ / O peration |
6 # \\ / A nd | For copyright notice see file Copyright
7 # \\/ M anipulation |
8 #------------------------------------------------------------------------------
9 # License
10 # This file is part of foam-extend.
12 # foam-extend is free software: you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by the
14 # Free Software Foundation, either version 3 of the License, or (at your
15 # option) any later version.
17 # foam-extend is distributed in the hope that it will be useful, but
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 # General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 # Script
26 # AllMake.stage5
28 # Description
29 # Build script for ThirdParty packages not requiring rpm packaging
32 # Requirements:
33 # 1: Your foam-extend environment must be properly initialized
34 # 2: foam-extend must already been compiled because swak4Foam depends on
35 # foam-extend include files and libraries
37 # Author:
38 # Martin Beaudoin, Hydro-Quebec, (2012)
40 #------------------------------------------------------------------------------
41 # run from Third-party directory only
42 cd ${0%/*} || exit 1
44 wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
45 echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
46 echo " The environment variables are inconsistent with the installation."
47 echo " Check the foam-extend entries in your dot-files and source them."
48 exit 1
51 #------------------------------------------------------------------------------
53 echo "========================================"
54 echo "Starting ThirdParty AllMake: Stage5 "
55 echo "========================================"
56 echo
58 # swak4Foam - Version 0.3.1
59 # swak4Foam - Version 0.3.2
60 # In fact, we are basically tracking the head branch from the Mercurial repository
61 # which is also replicated under the Breeder_2.0 section of the Subversion repository
64 SWAK_RELEASE_VERSION=0.3.2
66 if [ -z "$SWAK4FOAM_SYSTEM" ]
67 then
68 # Do we need to download the source code?
69 # We choose to put the source code under ./rpmBuild/BUILD prior to compiling.
70 # We will not generate a rpm package, but all ThirdParty source code will be
71 # centralized under the same scratch area
72 if [ ! -e ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION ];
73 then
74 echo "Checking for a Mercurial client: hg"
75 command -v hg >/dev/null
76 if [ $? -eq 0 ];
77 then
78 echo "Using Mercurial/hg to download the source code for swak4Foam"
80 cd ./rpmBuild/BUILD;
81 hg clone http://hg.code.sf.net/p/openfoam-extend/swak4Foam swak4Foam-$SWAK_RELEASE_VERSION;
82 cd swak4Foam-$SWAK_RELEASE_VERSION;
83 hg checkout version_${SWAK_RELEASE_VERSION}_v2.x
85 else
86 echo "Warning: Mercurial/hg is not installed. Switching to an alternate Subversion repository"
87 command -v svn >/dev/null
88 if [ $? -eq 0 ];
89 then
90 echo "Using Subversion/svn to download the source code for swak4Foam"
91 (cd ./rpmBuild/BUILD; svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_2.0/libraries/swak4Foam swak4Foam-$SWAK_RELEASE_VERSION)
92 else
93 echo "Error: Please install either a Mercurial or Subversion client in order to download the source code for swak4Foam"
94 exit -1
97 # We move the compilation results directly to $FOAM_SITE_APPBIN and $FOAM_SITE_LIBBIN
98 # If you prefer to keep the libraries and tools under $FOAM_USER_LIBBIN and $FOAM_USER_APPBIN, simply
99 # comment out the next two lines
100 (cd ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION; find . -name files | xargs -n 1 sed -i.old "s/FOAM_USER/FOAM_SITE/g")
101 (cd ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION; find . -name options | xargs -n 1 sed -i.old "s/FOAM_USER/FOAM_SITE/g")
103 # We recompile everything
104 (cd ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION; ./Allwclean; ./Allwmake)
105 else
106 echo "The source code for swak4Foam is already present under ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION"
107 echo "Please remove this directory if you want to refresh your installation of swak4Foam"
109 echo ""
110 else
111 echo "Using system installed swak4Foam"
112 echo ""
115 echo "========================================"
116 echo "Done ThirdParty AllMake: Stage5 "
117 echo "========================================"
118 echo
120 # ----------------------------------------------------------------- end-of-file