awips2/rpms/awips2.cave/setup/scripts/prepare_dist.sh
root e2ecdcfe33 Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: a02aeb236c [formerly 9f19e3f712] [formerly a02aeb236c [formerly 9f19e3f712] [formerly 06a8b51d6d [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]]
Former-commit-id: 06a8b51d6d
Former-commit-id: 8e80217e59 [formerly 3360eb6c5f]
Former-commit-id: 377dcd10b9
2012-01-06 08:55:05 -06:00

87 lines
2.3 KiB
Bash

#!/bin/bash
# This script will build the CAVE zip, the p2 repository zips, and copy them to the CAVE rpm dist
# directory.
# This script is started by the awips2.cave rpm build.sh script; so, it is able to get the workspace
# directory from the environment as well as the build architecture.
CAVE_RPM_DIST_DIR="${WORKSPACE_DIR}/Installer.rpm/awips2.cave/setup/dist"
if [ ! -d ${CAVE_RPM_DIST_DIR} ]; then
echo "ERROR: ${CAVE_RPM_DIST_DIR} does not exist."
exit 1
fi
rm -f ${CAVE_RPM_DIST_DIR}/*
RC=$?
if [ ${RC} -ne 0 ]; then
echo "ERROR: Unable to remove the contents of ${CAVE_RPM_DIST_DIR}."
exit 1
fi
if [ ! -d ${WORKSPACE_DIR}/build ]; then
echo "ERROR: The CAVE build directory was not found in the workspace - ${WORKSPACE_DIR}/build."
echo " When it was checked out of SVN was it accidentally named build.cave instead?"
exit 1
fi
cd ${WORKSPACE_DIR}/build
# Build the CAVE zip file.
if [ ! -f build.sh ]; then
echo "ERROR: Unable to find the CAVE build script."
exit 1
fi
# Execute the CAVE PDE Build.
# The Sun JDK Build.
time ./build.sh -eclipse=/opt/uframe-eclipse
RC=$?
if [ ${RC} -ne 0 ]; then
echo "ERROR: Unable to build the CAVE zip file."
exit 1
fi
# Copy the CAVE zip file to the awips2.cave dist directory.
CAVE_ZIP_NAME_32="CAVE-linux.gtk.x86.zip"
CAVE_ZIP_NAME_64="CAVE-linux.gtk.x86_64.zip"
CAVE_ZIP_LOC="cave/tmp/I.CAVE"
CAVE_ZIP="${CAVE_ZIP_LOC}/${CAVE_ZIP_NAME_32}"
if [ ! -f ${CAVE_ZIP} ]; then
echo "ERROR: ${CAVE_ZIP} does not exist."
exit 1
fi
cp -v ${CAVE_ZIP} ${CAVE_RPM_DIST_DIR}
CAVE_ZIP="${CAVE_ZIP_LOC}/${CAVE_ZIP_NAME_64}"
if [ ! -f ${CAVE_ZIP} ]; then
echo "ERROR: ${CAVE_ZIP} does not exist."
exit 1
fi
cp -v ${CAVE_ZIP} ${CAVE_RPM_DIST_DIR}
# Build the p2 repo zip files.
if [ ! -f p2-build.xml ]; then
echo "ERROR: Unable to find the p2 repo ant script."
exit 1
fi
# Execute the P2 Repo PDE Build.
# The Sun JDK Build.
time ant -f p2-build.xml -Dbuild.version=${BUILD_VERSION} \
-Dbuild.arch=${CAVE_BUILD_ARCH}
RC=$?
if [ ${RC} -ne 0 ]; then
echo "ERROR: Unable to build the CAVE p2 repo zip files."
exit 1
fi
# Copy the p2 repo zip files to the awips2.cave dist directory.
P2_REPO_ZIP_LOC="cave/p2/dist"
if [ ! -d ${P2_REPO_ZIP_LOC} ]; then
echo "ERROR: Unable to find the CAVE p2 repo zip files."
exit 1
fi
cp -v ${P2_REPO_ZIP_LOC}/* ${CAVE_RPM_DIST_DIR}
# Finished
exit 0