awips2/rpms/python.site-packages/deploy.builder/build.sh
Steve Harris 98059f9ef1 12.9.1-5 baseline
Former-commit-id: 77cbd6c1e5 [formerly a1d931fd44] [formerly 61f269f54c] [formerly 77cbd6c1e5 [formerly a1d931fd44] [formerly 61f269f54c] [formerly f2fac39428 [formerly 61f269f54c [formerly d85b989f77196d20eb2d2a21cf4daa13d50474ae]]]]
Former-commit-id: f2fac39428
Former-commit-id: d9faed979f [formerly 7fb0b17bd5] [formerly 54140b7733222bbc423315196e9781453b12f896 [formerly 72824561cb]]
Former-commit-id: 84e9e52a92ae5e740b0daf680a98316f7435f7f7 [formerly 9b5c2094ed]
Former-commit-id: 2d928d328e
2012-08-21 15:27:03 -05:00

108 lines
3.5 KiB
Bash

#!/bin/bash
# We Have Been Created To Automate The Building Of The AWIPS II Python Site-Package RPMs.
# !! NOTE !! - We Assume That We Are In A Workspace With The Installer Projects
# And The pythonPackages Project.
export WORKSPACE_DIR=`cd ../../../; pwd;`
export RPM_SITE_PACKAGE_LOG_FILE="rpm-build.log"
export UFRAME_ECLIPSE="/opt/uframe-eclipse"
export AWIPSCM_SHARE="/awipscm"
source ${WORKSPACE_DIR}/Installer.rpm/awips2.core/deploy.builder/env.sh
if [ "${RPM_TOP_DIR}" = "" ]; then
echo "ERROR: You Must Set The RPM_TOP_DIR Environment Variable."
echo "Unable To Continue ... Terminating."
exit 1
fi
export AWIPSII_VERSION=`cat ${WORKSPACE_DIR}/Installer.rpm/version.txt`
export AWIPSII_RELEASE=`date +"%Y%m%d"`
export CPPFLAGS="-m32"
export PYTHON_EXE="/awips2/python/bin/python"
export LD_LIBRARY_PATH="/awips2/python/lib"
# Just In Case python-devel 2.7 is not installed. scipy ignored
# C++ environment flags.
if [ ! -f /usr/local/lib/libpython2.7.so ]; then
# We use to create this; but, we cannot create it as tomcat.
# Without this, we will not be able to build every python site-package.
echo "ERROR: There Is No lpython2.7 In /usr/local/lib."
echo "Unable To Continue ... Terminating."
exit 1
fi
# Arguments
# ${1} == The Directory With The Specs File And Possibly Other Custom
# Scripts That May Need To Be Merged Into A Component.
function buildRPM()
{
export BUILDROOT_DIR=/tmp/awips-component
COMPONENT_DIR=${1}
COMPONENT_SPECS=${COMPONENT_DIR}/component.spec
# We Need To Delete The 'BuildRoot' Directory After Each RPM Is
# Built Whether The Build Is Successful Or Not.
rm -rf ${BUILDROOT_DIR}
# We Build The List Of Files That Need To Be Installed On-Demand Now.
# If One Exists From A Previous Build, Delete It.
if [ -f ${RPM_TOP_DIR}/BUILD/component-files.txt ]; then
rm -f ${RPM_TOP_DIR}/BUILD/component-files.txt
fi
# Build The RPM.
rpmbuild -ba --target=i386 \
--define '_topdir %(echo ${RPM_TOP_DIR})' \
--define '_baseline_workspace %(echo ${WORKSPACE_DIR})' \
--define '_uframe_eclipse %(echo ${UFRAME_ECLIPSE})' \
--define '_awipscm_share %(echo ${AWIPSCM_SHARE})' \
--define '_build_root %(echo ${BUILDROOT_DIR})' \
--define '_component_version %(echo ${AWIPSII_VERSION})' \
--define '_component_release %(echo ${AWIPSII_RELEASE})' \
--buildroot ${BUILDROOT_DIR} ${COMPONENT_SPECS}
RC="$?"
if [ ! "${RC}" = "0" ]; then
if [ "${COMPONENT_DIR}" = "Installer.dynamciserialize" ] ||
[ "${COMPONENT_DIR}" = "Installer.ufpy" ]; then
echo ""
echo "ERROR: Unable To Build The RPM Defined In: ${COMPONENT_DIR}."
echo "Unable To Continue ... Terminating."
exit 1
fi
fi
}
function logSuccessOrFailure()
{
RC="${1}"
RPM_COMPONENT="${2}"
if [ "${RC}" = "0" ]; then
echo "SUCCESS: ${RPM_COMPONENT}" >> ${RPM_SITE_PACKAGE_LOG_FILE}
else
echo "FAILURE: ${RPM_COMPONENT}" >> ${RPM_SITE_PACKAGE_LOG_FILE}
fi
}
# Note: Presently, We Are In ../../../python.site-packages/deploy.builder
# Adjust Our Execution Position.
cd ../
if [ -f ${RPM_SITE_PACKAGE_LOG_FILE} ]; then
rm -f ${RPM_SITE_PACKAGE_LOG_FILE}
fi
touch ${RPM_SITE_PACKAGE_LOG_FILE}
# For Now, We Will Only Build The Important RPMs. Will Add An Env Flag That Can Be
# Set To Force A Build Of Everything.
buildRPM "Installer.ufpy"
buildRPM "Installer.dynamicserialize"
buildRPM "Installer.cherrpy"
buildRPM "Installer.h5py"