awips2/rpms/awips2.qpid/deploy.builder/build.sh
Bryan Kowal 65e1e4ee0b Issue #202 - restoring rpm directory to ss_sync.
Former-commit-id: 56068aa96fa6daf113861476bf4b7aebe2021ca4
2012-01-20 13:38:00 -06:00

60 lines
1.6 KiB
Bash

#!/bin/bash
export CFLAGS="-m32"
export CXXFLAGS="-m32"
export LDFLAGS="-m32"
SPECS_FILE="qpid-cpp-mrg.spec"
# Verify that the correct version of swig is installed.
REQUIRED_SWIG_VERSION="SWIG Version 2.0"
COMMAND=`which swig`
RC=$?
if [ ${RC} -ne 0 ]; then
echo "ERROR: 'swig v2.0.X' Is Required To Successfully Build The QPID RPMs."
echo "Unable To Continue ... Terminating."
exit 1
fi
SWIG_VERSION=`swig -version | grep Version`
RC=$?
if [ ${RC} -ne 0 ]; then
echo "ERROR: Unable To Verify The Installed Version Of 'swig'."
echo "Unable To Continue ... Terminating."
exit 1
fi
VERIFY_SWIG_VERSION=`echo "${SWIG_VERSION}" | grep "${REQUIRED_SWIG_VERSION}"`
if [ "${VERIFY_SWIG_VERSION}" = "" ]; then
echo "ERROR: 'swig v2.0.X' Is Required To Successfully Build The QPID RPMs."
echo " '${SWIG_VERSION}' Was Detected."
echo "Unable To Continue ... Terminating."
exit 1
fi
# We are in the awips2.qpid/deploy.builder directory when we are started.
cd ../
export QPID_WORKSPACE_DIR=`pwd`
# Purge the BUILD directory, if necessary.
if [ -d ${QPID_WORKSPACE_DIR}/BUILD ]; then
rm -rf ${QPID_WORKSPACE_DIR}/BUILD/*
fi
# Purge the RPMS/i386 directory, if necessary.
if [ -d ${QPID_WORKSPACE_DIR}/RPMS/i386 ]; then
rm -rf ${QPID_WORKSPACE_DIR}/RPMS/i386/*
fi
# Conceal The SWIG Requirement In The Specs File.
perl -p -i -e "s/BuildRequires: swig/#BuildRequires: swig/g" \
SPECS/${SPECS_FILE}
rpmbuild -ba --target=i386 --define '_topdir %(echo ${QPID_WORKSPACE_DIR})' \
SPECS/${SPECS_FILE}
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
exit 0