summaryrefslogtreecommitdiff
path: root/packaging/Suite/buildWinSuite.sh
blob: 627cb429414c188d126792814d38142111385d8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/sh -x

# Usage: Run ./buildWinSuite.sh from the Suite directory in packaging.


# Set control variable to build packages if they are not build already
# This will probably be removed later as it was only added for testing
BUILD_IF_UNBUILT=1
PKNG_DIR=`pwd`

# Set up path variables
cd ../..
TOP_LEVEL=`pwd`
DIST_ROOT=$TOP_LEVEL/cad/src/dist
DIST_CONTENTS=$DIST_ROOT

# set up package version information
if [ -x $PKNG_DIR/ver_info.sh ]
then
  . $PKNG_DIR/ver_info.sh
  VERSION_NUM=$NE1_VERSION
  GROMACS_VERSION=$GMX_VERSION
  QUTEMOLX_VERSION=$QMX_VERSION
  PREF_VER=$PREF_VERSION
else
  VERSION_NUM="1.1.1"
  GROMACS_VERSION="3.3.3"
  QUTEMOLX_VERSION="0.5.1"
  PREF_VER="0.0.2"
fi
RC_NUMBER="0"

# Do a basic check for sanity in the build area.
if [ ! -e "$TOP_LEVEL/cad/src" ]
then
  echo "The build directories are not valid"
  exit 1
fi

# Check to see if the smaller packages are built

# Start with Pref_Mod since it's easy to build
cd $TOP_LEVEL
# this check is to see if we've already run Pref_Mod for this tree
if [ ! -e "$TOP_LEVEL/packaging/Pref_Mod/dist" ]
then
  if [ $BUILD_IF_UNBUILT -ne 0 ]
  then
#   All clear to do the build
    cd packaging/Pref_Mod
    ./buildWin.sh $PREF_VER || exit 1
  else
    echo "Build Pref_Mod before continuing"
    exit 1
  fi
fi


# Build section for QuteMolX

if [ ! -e "/c/QMX_Install" ]
then
  if [ $BUILD_IF_UNBUILT -ne 0 ]
  then
    cd $TOP_LEVEL/cad/plugins/QuteMol/packaging
    ./buildWin.sh QUTEMOLX_VERSION
    if [ "$?" != "0" ]
    then
      echo "Error in the QuteMolX build, investigate."
      exit 1
    fi
  fi
fi
# The build will normally handle this, but if the files used are pre-builds,
# the build does not store the readme and license.  (Needed for Suite)
cp $TOP_LEVEL/cad/plugins/QuteMol/packaging/Win32/License.txt /c/QMX_Install || exit 1
cp $TOP_LEVEL/cad/plugins/QuteMol/packaging/ReadMe.html /c/QMX_Install || exit 1

# End of build section for QuteMolX

cd $TOP_LEVEL

# Build section for GROMACS

if [ ! -e "/c/GMX_Install" ]
then
  if [ $BUILD_IF_UNBUILT -ne 0 ]
  then
    cd $TOP_LEVEL/cad/plugins/GROMACS/gromacs-$GROMACS_VERSION/packaging
    ./buildWin.sh $GROMACS_VERSION
    if [ "$?" != "0" ]
    then
      echo "Error in the GROMACS build, investigate."
      exit 1
    fi
  fi
fi
# The build will normally handle this, but if the files used are pre-builds,
# the build does not store the readme and license.  (Needed for Suite)
cp $TOP_LEVEL/cad/plugins/GROMACS/gromacs-$GROMACS_VERSION/packaging/Win32/License.txt /c/GMX_Install
cp $TOP_LEVEL/cad/plugins/GROMACS/gromacs-$GROMACS_VERSION/packaging/ReadMe.html /c/GMX_Install

# End of GROMACS build section

cd $TOP_LEVEL

# Build section for NE1

#Check for an NE1 build
cd $TOP_LEVEL
if [ ! -e "$TOP_LEVEL/cad/src/build" ]
then
  if [ $BUILD_IF_UNBUILT -ne 0 ]
  then
#   Set version information for NE1
    cat packaging/buildWin.sh | sed -e "s:^VERSION_NUM=.*:VERSION_NUM=\\\"$VERSION_NUM\\\":" | sed -e "s:^RC_NUMBER=.*:RC_NUMBER=\\\"$RC_NUMBER\\\":" > packaging/buildWin.sh.tmp
    mv packaging/buildWin.sh.tmp packaging/buildWin.sh || exit 1
    cd packaging
    ./buildWin.sh
    if [ "$?" != "0" ]
    then
      echo "Error in the NE1 Build, investigate"
      exit 1
    fi
  else
    echo "Build NE1 before continuing"
    exit 1
  fi
fi  

cd $TOP_LEVEL

# Made it this far, continue building the suite.  Mod the suite installer files
cat packaging/Suite/Win32/suite_installer.nsi | sed -e "s:^!define PRODUCT_VERSION .*:!define PRODUCT_VERSION \\\"$VERSION_NUM\\\":" > packaging/Suite/Win32/suite_installer.nsi.btmp
mv packaging/Suite/Win32/suite_installer.nsi.btmp packaging/Suite/Win32/suite_installer.nsi || exit 1

# Create the installer
"c:/program files/nsis/makensis.exe" packaging/Suite/Win32/suite_installer.nsi


# Clean up time
rm -f /c/GMX_Install/License.txt /c/GMX_Install/ReadMe.html
rm -f /c/QMX_Install/License.txt /c/QMX_Install/ReadMe.html