Removed unnecessary return statement
[foam-extend-3.2.git] / bin / createWindowsBinaryPackage
blob0ea2fd269f6f8c47f3b1730432d162ce42ecb775
1 #!/bin/sh
2 #----------------------------------*-sh-*--------------------------------------
3 # ========= |
4 # \\ / F ield | foam-extend: Open Source CFD
5 # \\ / O peration | Version: 3.2
6 # \\ / A nd | Web: http://www.foam-extend.org
7 # \\/ M anipulation | For copyright notice see file Copyright
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 # createReleasePackage.mingw
28 # Description
29 # Creates stand-alone .zip packages for MinGW-based builds on Windows.
31 # Author:
32 # Cesare Guardino, Alstom Power Ltd., (2015)
34 #------------------------------------------------------------------------------
36 cd ${0%/*} || exit 1 # run from this directory
38 create_package() {
39 RELEASE_DIR=$1
40 TYPE=$2
42 PACKAGE_FILE=$RELEASE_DIR.$TYPE
43 echo ""
44 echo "Creating $PACKAGE_FILE ..."
45 7z -t$TYPE a $PACKAGE_FILE $RELEASE_DIR
47 if [ -f $PACKAGE_FILE ] ; then
48 echo "Successfully created $PACKAGE_FILE"
49 else
50 echo "Failed to create $PACKAGE_FILE"
54 echo
55 echo "=========== FOAM-EXTEND WINDOWS STAND-ALONE PACKAGE CREATION SCRIPT ==========="
57 if [ "$PWD" != "$WM_PROJECT_DIR/bin" ]
58 then
59 echo "Error: Current directory is not \$WM_PROJECT_DIR/bin"
60 echo " The environment variable are not consistent with the installation."
61 echo " Check the OpenFOAM entries in your dot-files and source them."
62 exit 1
65 RELEASE_DIR=$WM_PROJECT-$WM_FORK-$WM_PROJECT_VERSION-win-x64
66 MPI_VERSION=`basename $FOAM_MPI_LIBBIN`
67 if [ -d $RELEASE_DIR ] ; then
68 echo "Removing previous $RELEASE_DIR"
69 rm -rf $RELEASE_DIR
71 mkdir $RELEASE_DIR
73 echo "Copying bin directory ..."
74 cp -rp $FOAM_APPBIN $RELEASE_DIR/bin
76 echo "Copying DLLs from lib directory ..."
77 mkdir $RELEASE_DIR/lib
78 cp -p $FOAM_LIBBIN/*.dll $RELEASE_DIR/lib
79 mkdir $RELEASE_DIR/lib/$MPI_VERSION
80 cp -p $FOAM_MPI_LIBBIN/*.dll $RELEASE_DIR/lib/$MPI_VERSION
82 echo "Copying extra files from etc directory ..."
83 mkdir $RELEASE_DIR/etc
84 cp -p $WM_PROJECT_DIR/bin/setWindowsEnvironment.bat $RELEASE_DIR/
85 cp -p $WM_PROJECT_DIR/bin/foamWindowsShell.bat $RELEASE_DIR/
86 cp -p $WM_PROJECT_DIR/etc/controlDict-EXAMPLE $RELEASE_DIR/etc
87 cp -p $WM_PROJECT_DIR/etc/cellModels $RELEASE_DIR/etc
88 cp -rp $WM_PROJECT_DIR/etc/thermoData $RELEASE_DIR/etc
89 cp -p $WM_PROJECT_DIR/doc/buildInstructions/Windows/READMEBinaryPackage.txt $RELEASE_DIR/
90 cp -p $WM_PROJECT_DIR/bin/paraFoam.bat $RELEASE_DIR/bin
91 cp -p $WM_PROJECT_DIR/COPYING $RELEASE_DIR/LICENSE.txt
92 unix2dos $RELEASE_DIR/LICENSE.txt
94 create_package $RELEASE_DIR zip
95 #create_package $RELEASE_DIR 7z
97 rm -rf $RELEASE_DIR