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/>.
26 # foamPackBin <arch> [outputDir]
29 # Packs and compresses binary version of foam for release
31 #------------------------------------------------------------------------------
35 echo "Error: architecture type expected, exiting"
37 echo "Usage : ${0##*/} <arch> [outputDir]"
43 # base arch (w/o precision, optimization, etc)
44 baseArch
=$
(echo "$arch" |
sed -e 's@[DS]P.*$@@')
46 timeStamp
=$
(date +%Y-
%m-
%d
)
47 packDir
=$WM_PROJECT-$WM_PROJECT_VERSION
48 packFile
=${packDir}.${arch}_${timeStamp}.gtgz
50 # add optional output directory
53 packFile
="$2/$packFile"
58 echo "Error: $packFile already exists"
62 # check for essential directories
63 for dir
in $packDir $packDir/lib
/$arch $packDir/applications
/bin
/$arch
67 echo "Error: directory $dir does not exist"
72 # get list of directories
76 $packDir/applications
/bin
/$arch \
77 $packDir/wmake
/rules \
78 $packDir/wmake
/bin
/$baseArch \
81 [ -d $dir ] && echo $dir
86 echo "Packing $arch ($baseArch) port of $packDir into $packFile"
89 tar czpf
$packFile $dirList
93 echo "Finished packing and compressing file $packFile"
95 echo "Error: failure packing $packFile"
96 rm -f $packFile 2>/dev
/null
99 #------------------------------------------------------------------------------