2 #------------------------------------------------------------------------------
4 # \\ / F ield | foam-extend: Open Source CFD
6 # \\ / A nd | For copyright notice see file Copyright
8 #------------------------------------------------------------------------------
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/>.
29 # Build script for ThirdParty packages not requiring rpm packaging
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
38 # Martin Beaudoin, Hydro-Quebec, (2012)
40 #------------------------------------------------------------------------------
41 # run from Third-party directory only
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."
51 #------------------------------------------------------------------------------
53 echo "========================================"
54 echo "Starting ThirdParty AllMake: Stage5 "
55 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" ]
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 ];
74 echo "Checking for a Mercurial client: hg"
75 command -v hg
>/dev
/null
78 echo "Using Mercurial/hg to download the source code for swak4Foam"
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
86 echo "Warning: Mercurial/hg is not installed. Switching to an alternate Subversion repository"
87 command -v svn
>/dev
/null
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)
93 echo "Error: Please install either a Mercurial or Subversion client in order to download the source code for swak4Foam"
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
)
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"
111 echo "Using system installed swak4Foam"
115 echo "========================================"
116 echo "Done ThirdParty AllMake: Stage5 "
117 echo "========================================"
120 # ----------------------------------------------------------------- end-of-file