Merge commit '8d83cebef638c75e56f746690399d78a572f079a'
[foam-extend-4.0.git] / ThirdParty / AllMake.stage5
blob5a7c2f147178e5dbb3bcdae68338fce0f9c19c70
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 # swak4Foam - Version 0.4.0
61 # In fact, we are basically tracking the head branch from the Mercurial repository
62 # which is also replicated under the Breeder_2.0 section of the Subversion repository
65 SWAK_RELEASE_VERSION=0.4.0
67 if [ -z "$SWAK4FOAM_SYSTEM" ]
68 then
69 # Do we need to download the source code?
70 # We choose to put the source code under ./rpmBuild/BUILD prior to compiling.
71 # We will not generate a rpm package, but all ThirdParty source code will be
72 # centralized under the same scratch area
73 if [ ! -e ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION ];
74 then
75 echo "Checking for a Mercurial client: hg"
76 command -v hg >/dev/null
77 if [ $? -eq 0 ];
78 then
79 echo "Using Mercurial/hg to download the source code for swak4Foam"
81 cd ./rpmBuild/BUILD;
82 hg clone http://hg.code.sf.net/p/openfoam-extend/swak4Foam swak4Foam-$SWAK_RELEASE_VERSION;
83 cd swak4Foam-$SWAK_RELEASE_VERSION;
84 hg checkout version_${SWAK_RELEASE_VERSION}_v2.x
86 else
87 echo "Warning: Mercurial/hg is not installed. Switching to an alternate Subversion repository"
88 command -v svn >/dev/null
89 if [ $? -eq 0 ];
90 then
91 echo "Using Subversion/svn to download the source code for swak4Foam"
92 (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 else
94 echo "Error: Please install either a Mercurial or Subversion client in order to download the source code for swak4Foam"
95 exit -1
98 # We move the compilation results directly to $FOAM_SITE_APPBIN and $FOAM_SITE_LIBBIN
99 # If you prefer to keep the libraries and tools under $FOAM_USER_LIBBIN and $FOAM_USER_APPBIN, simply
100 # comment out the next two lines
101 (cd ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION; find . -name files | xargs -n 1 sed -i.old "s/FOAM_USER/FOAM_SITE/g")
102 (cd ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION; find . -name options | xargs -n 1 sed -i.old "s/FOAM_USER/FOAM_SITE/g")
104 # We recompile everything
105 (cd ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION; ./Allwclean; ./Allwmake)
106 else
107 echo "The source code for swak4Foam is already present under ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION"
108 echo "Please remove this directory if you want to refresh your installation of swak4Foam"
110 echo ""
111 else
112 echo "Using system installed swak4Foam"
113 echo ""
116 echo "========================================"
117 echo "Done ThirdParty AllMake: Stage5 "
118 echo "========================================"
119 echo
121 # ----------------------------------------------------------------- end-of-file