diff --git a/rpms/awips2.edex/deploy.builder/build.sh b/rpms/awips2.edex/deploy.builder/build.sh index 35db820e92..95d0e2cd0f 100644 --- a/rpms/awips2.edex/deploy.builder/build.sh +++ b/rpms/awips2.edex/deploy.builder/build.sh @@ -155,7 +155,7 @@ cd ../ buildRPM "Installer.edex" buildRPM "Installer.edex-configuration" -buildRPM "Installer.edex-shapefiles" +#buildRPM "Installer.edex-shapefiles" # build the edex-datadelivery rpm export COMPONENT_NAME="edex-datadelivery" patchDDSpecification diff --git a/rpms/awips2.edex/Installer.edex-shapefiles/component.spec b/rpms/awips2.shapefiles/Installer.edex-shapefiles/component.spec similarity index 100% rename from rpms/awips2.edex/Installer.edex-shapefiles/component.spec rename to rpms/awips2.shapefiles/Installer.edex-shapefiles/component.spec diff --git a/rpms/awips2.shapefiles/deploy.builder/build.sh b/rpms/awips2.shapefiles/deploy.builder/build.sh new file mode 100644 index 0000000000..41b7cd25d8 --- /dev/null +++ b/rpms/awips2.shapefiles/deploy.builder/build.sh @@ -0,0 +1,137 @@ +#!/bin/bash +# This script will build the AWIPS II Edex RPMs. + +# Build Variables: +# ----------------------------------------------------------------------------- +VAR_AWIPSII_TOP_DIR="/home/bkowal/rpmbuild" +VAR_WORKSPACE="/common/bkowal/git/thunder/baseline" +VAR_AWIPSII_BUILD_ROOT="/tmp/awips-component" +VAR_AWIPSII_VERSION="" +VAR_AWIPSII_RELEASE="" +VAR_UFRAME_ECLIPSE="/awips2/eclipse" +VAR_AWIPSCM_SHARE="/awipscm" +# ----------------------------------------------------------------------------- + +if [ "${AWIPSII_TOP_DIR}" = "" ] && + [ "${VAR_AWIPSII_TOP_DIR}" = "" ]; then + echo "ERROR: You Must Set the AWIPSII_TOP_DIR Environment Variable." + echo "Unable to Continue ... Terminating." + exit 1 +fi + +function prepareBuildEnvironment() +{ + if [ "${AWIPSII_TOP_DIR}" = "" ]; then + export AWIPSII_TOP_DIR="${VAR_AWIPSII_TOP_DIR}" + fi + + if [ "${WORKSPACE}" = "" ]; then + export WORKSPACE="${VAR_WORKSPACE}" + fi + + if [ "${AWIPSII_BUILD_ROOT}" = "" ]; then + export AWIPSII_BUILD_ROOT="${VAR_AWIPSII_BUILD_ROOT}" + fi + + if [ "${AWIPSII_VERSION}" = "" ]; then + # Determine if we need to use the default version. + if [ "${VAR_AWIPSII_VERSION}" = "" ]; then + VAR_AWIPSII_VERSION=`cat ${WORKSPACE}/rpms/version.txt` + fi + export AWIPSII_VERSION="${VAR_AWIPSII_VERSION}" + fi + + if [ "${AWIPSII_RELEASE}" = "" ]; then + # Determine if we need to use the default release. + if [ "${VAR_AWIPSII_RELEASE}" = "" ]; then + VAR_AWIPSII_RELEASE=`date +"%Y%m%d"` + fi + export AWIPSII_RELEASE="${VAR_AWIPSII_RELEASE}" + fi + + if [ "${UFRAME_ECLIPSE}" = "" ]; then + export UFRAME_ECLIPSE="${VAR_UFRAME_ECLIPSE}" + fi + + if [ "${AWIPSCM_SHARE}" = "" ]; then + export AWIPSCM_SHARE="${VAR_AWIPSCM_SHARE}" + fi +} + +function setTargetArchitecture() +{ + # Set the target build architecture for the rpms based on the EDEX build + # architecture. + export TARGET_BUILD_ARCH="${EDEX_BUILD_ARCH}" + export EDEX_BUILD_BITS="64" + if [ "${EDEX_BUILD_ARCH}" = "x86" ]; then + export TARGET_BUILD_ARCH="i386" + export EDEX_BUILD_BITS="32" + fi +} + + +export TARGET_BUILD_ARCH= +# If the architecture has not been specified, default to 32-bit. +if [ "${EDEX_BUILD_ARCH}" = "" ]; then + export EDEX_BUILD_ARCH="x86" + echo "The Build Architecture was not specified ... defaulting to x86." +else + echo "Building for architecture ... ${EDEX_BUILD_ARCH}." +fi + +function buildRPM() +{ + # Arguments: + # ${1} == specs file + + if [ ! "${COMPONENT_NAME}" = "edex-binlightning" ] || + [ ${LIGHTNING} = true ]; then + rpmbuild -ba --target=${TARGET_BUILD_ARCH} \ + --define '_topdir %(echo ${AWIPSII_TOP_DIR})' \ + --define '_baseline_workspace %(echo ${WORKSPACE})' \ + --define '_uframe_eclipse %(echo ${UFRAME_ECLIPSE})' \ + --define '_awipscm_share %(echo ${AWIPSCM_SHARE})' \ + --define '_build_root %(echo ${AWIPSII_BUILD_ROOT})' \ + --define '_component_version %(echo ${AWIPSII_VERSION})' \ + --define '_component_release %(echo ${AWIPSII_RELEASE})' \ + --define '_component_name %(echo ${COMPONENT_NAME})' \ + --define '_build_arch %(echo ${EDEX_BUILD_ARCH})' \ + --define '_build_bits %(echo ${EDEX_BUILD_BITS})' \ + --buildroot ${AWIPSII_BUILD_ROOT} \ + ${1}/component.spec + RC=$? + if [ ${RC} -ne 0 ]; then + echo "FATAL: rpmbuild failed." + exit 1 + fi + fi +} + +prepareBuildEnvironment + +pushd . +cd ${WORKSPACE}/build.edex +if [ $? -ne 0 ]; then + exit 1 +fi +if [ ${LIGHTNING} = true ]; then + /awips2/ant/bin/ant -f build.xml -Dlightning=true \ + -Duframe.eclipse=${UFRAME_ECLIPSE} + RC=$? +else + /awips2/ant/bin/ant -f build.xml \ + -Duframe.eclipse=${UFRAME_ECLIPSE} + RC=$? +fi +if [ ${RC} -ne 0 ]; then + exit 1 +fi +popd +setTargetArchitecture + +# Adjust Our Execution Position. +cd ../ + +buildRPM "Installer.edex-shapefiles" + diff --git a/rpms/build/common/rpms.sh b/rpms/build/common/rpms.sh index 58f2dacf8b..958354ada7 100644 --- a/rpms/build/common/rpms.sh +++ b/rpms/build/common/rpms.sh @@ -121,6 +121,32 @@ function buildEDEX() return 0 } +function buildShapefiles() +{ + cd ${WORKSPACE}/rpms/awips2.shapefiles/deploy.builder + if [ $? -ne 0 ]; then + echo "ERROR: Failed to build the edex shapefile rpm." + return 1 + fi + + # Determine the build architecture. + export EDEX_BUILD_ARCH=`uname -i` + if [ "${EDEX_BUILD_ARCH}" = "i386" ]; then + export EDEX_BUILD_ARCH="x86" + fi + + if [ $? -ne 0 ]; then + echo "ERROR: Failed to determine the architecture." + return 1 + fi + /bin/bash build.sh + if [ $? -ne 0 ]; then + echo "ERROR: Failed to build the edex shapefile rpm." + return 1 + fi + + return 0 +} function buildCAVEsingle() { cd ${WORKSPACE}/rpms/awips2.cave/deploy.builder diff --git a/rpms/build/common/usage.sh b/rpms/build/common/usage.sh index 2f72a930df..7c7e716fd0 100644 --- a/rpms/build/common/usage.sh +++ b/rpms/build/common/usage.sh @@ -11,6 +11,7 @@ function usage() echo " -ade build all rpms that are packaged in the ade." echo " -viz only build the Viz rpms (CAVE & AlertViz)." echo " -edex only build the EDEX rpms." + echo " -shp only build the EDEX shapefile rpm." echo " -qpid build only the QPID rpms." echo " -ldm build the awips2-ldm rpm; requires root privileges." echo " -upc build the awips2-edex-upc rpm." diff --git a/rpms/build/x86_64/build.sh b/rpms/build/x86_64/build.sh index daae9eda2d..3a4b8f509d 100644 --- a/rpms/build/x86_64/build.sh +++ b/rpms/build/x86_64/build.sh @@ -458,6 +458,11 @@ if [ "${1}" = "-viz" ]; then exit 0 fi +if [ "${1}" = "-shp" ]; then + buildShapefiles + exit 0 +fi + if [ "${1}" = "-edex" ]; then ##buildRPM "awips2-common-base" buildRPM "awips2"