build cleanup

This commit is contained in:
mjames-upc 2017-10-25 11:20:40 -06:00
parent acbd4bb2e3
commit d4369430f8
19 changed files with 83 additions and 1002 deletions

View file

@ -1,33 +0,0 @@
This directory contains scripts to handle the upgrade from PostgreSQL 9.3.x to
9.5.x, for servers running Openfire.
*** IMPORTANT: If you are upgrading a server that does NOT run openfire, do
NOT use these scripts. Use the scripts in the directory "DR5737" instead.
There are two parts to this install: Steps to be done BEFORE installing
the new PostgreSQL RPM packages (awips2-postgresql and awips2-psql), and steps
to be done AFTER installing those packages. All scripts must be run as root.
INSTRUCTIONS - BEFORE INSTALLING ANY RPMS:
1. Stop PostgreSQL if it is not already stopped.
2. Run postgres_pre_upgrade_openfire.sh.
INSTRUCTIONS - AFTER INSTALLING RPMS:
1. BEFORE starting PostgreSQL, run postgres_post_upgrade_openfire.sh. This
script should NOT be run unattended. Check the end of the output for "UPGRADE
COMPLETE" before continuing.
2. When the upgrade is finished, start PostgreSQL.
3. Run rebuild_stats.sh. This must be done while PostgreSQL is running. To
limit downtime, this script can be run even while EDEX or other users of the
database are running. This script can be run unattended.
4. If all previous steps have completed successfully and PostgreSQL is not
producing errors, you can delete the old PostgreSQL install located at
/awips2/postgresql-9.3.10

View file

@ -1,184 +0,0 @@
#!/bin/bash
source "$(dirname $0)/settings_openfire.sh" || exit 1
# directory for temporarily keeping old config files
TEMP_CONFIG_DIR=$(mktemp -d) || exit 1
export LD_LIBRARY_PATH=${POSTGRES_DIR}/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${PSQL_DIR}/lib:$LD_LIBRARY_PATH
# roll back as much as possible in the event of an error
cleanup_exit() {
echo "INFO: Cleaning up"
# remove symlinked psql
if [[ -h "${POSTGRES_DIR}/bin/psql" ]]; then
rm -vf "${POSTGRES_DIR}/bin/psql"
fi
# put back any tablespaces that had been moved
for TS_DIR in "${TABLESPACES[@]}"; do
if [[ -d "${TEMP_NEW_DATA}/${TS_DIR}" && ! -e "${POSTGRES_DATA_DIR}/${TS_DIR}" ]]; then
mv -fv "${TEMP_NEW_DATA}/${TS_DIR}" "${POSTGRES_DATA_DIR}/${TS_DIR}"
fi
done
# restore original pg_hba.conf
if [[ -f "${TEMP_CONFIG_DIR}/pg_hba.conf" ]]; then
cp -fv "${TEMP_CONFIG_DIR}/pg_hba.conf" "${POSTGRES_DATA_DIR}/pg_hba.conf"
fi
# clean up temp directories
rm -rf "${TEMP_CONFIG_DIR}"
rm -rf "${TEMP_OLD_DATA}"
rm -rf "${TEMP_NEW_DATA}"
sync
echo -e "\nERROR: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "ERROR: !! UPGRADE FAILED !!"
echo "ERROR: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo -e "\nERROR: One or more errors occurred. See above output."
echo -en "\nAny changes made by this script have been rolled back. You "
echo -en "may run this script again once any issues have been resolved.\n"
exit 1
}
if [[ ! -d "${POSTGRES_COPY_OF_OLD}" ]]; then
echo -n "ERROR: Did not find the old version of PostgreSQL at "
echo "${POSTGRES_COPY_OF_OLD}. Upgrade might already be complete."
echo "ERROR: Cannot continue."
cleanup_exit
fi
if [[ "${POSTGRES_VERSION}" != "${NEW_VER}" ]]; then
echo -n "ERROR: Currently installed version of PostgreSQL is "
echo "${POSTGRES_VERSION}. Expected ${NEW_VER}. Cannot continue."
cleanup_exit
fi
if [[ "${PSQL_VERSION}" != "${NEW_VER}" ]]; then
echo -n "ERROR: Currently installed version of psql is "
echo "${PSQL_VERSION}. Expected ${NEW_VER}. Cannot continue."
cleanup_exit
fi
${POSTGRES_DIR}/bin/pg_ctl -D "${POSTGRES_DATA_DIR}" status
if [[ "$?" -eq 0 ]]; then
echo "ERROR: It looks like PostgreSQL is running. Cannot continue."
cleanup_exit
fi
# identify any tablespaces that need to be moved after running pg_upgrade
TABLESPACES=()
for TS_LINK in "${PG_TBLSPC}"/* ; do
THIS_TS=$(readlink "${TS_LINK}")
if [[ "${THIS_TS}" == "${POSTGRES_DATA_DIR}"* ]]; then
TABLESPACES+=("$(basename ${THIS_TS})")
fi
done
echo -e "\nINFO: Backing up config files"
for CONF in "${CONFIG_FILES[@]}"; do
cp -v "${POSTGRES_DATA_DIR}/${CONF}" "${TEMP_CONFIG_DIR}/${CONF}" || cleanup_exit
done
echo -e "\nINFO: Initializing new cluster at ${TEMP_NEW_DATA}"
rm -rf "${TEMP_NEW_DATA}"
"${INITDB}" -D "${TEMP_NEW_DATA}" || cleanup_exit
echo -e "\nINFO: Starting new cluster on port ${TEMP_PORT}"
"${POSTGRES_DIR}/bin/postgres" --port="${TEMP_PORT}" -D "${TEMP_NEW_DATA}" 2>&1 &
sleep 10 # wait for server to start
echo -e "\nINFO: Setting up awips db user"
"${PSQL}" --port="${TEMP_PORT}" --db=postgres << EOF
begin;
alter role awips with password 'awips';
commit;
EOF
echo -e "\nINFO: Stopping new cluster"
"${POSTGRES_DIR}/bin/pg_ctl" -D "${TEMP_NEW_DATA}" stop
sleep 3
# prevent pg_upgrade from prompting for a password for the old cluster
echo -e "\nINFO: Updating old pg_hba.conf to trust local connections"
grep -E "local\s+all\s+all\s+trust" "${POSTGRES_DATA_DIR}/pg_hba.conf" >/dev/null
if [[ "$?" -ne 0 ]]; then
echo -e "local\tall\tall\ttrust" >> "${POSTGRES_DATA_DIR}/pg_hba.conf" || cleanup_exit
fi
# Need to symlink psql,
# because pg_upgrade expects $POSTGRES_DIR/bin/psql to exist
echo -e "\nINFO: Creating link to ${PSQL} at ${POSTGRES_DIR}/bin/psql"
if [[ ! -x "${POSTGRES_DIR}/bin/psql" ]]; then
ln -fvs "${PSQL}" "${POSTGRES_DIR}/bin/psql" || exit 1
fi
echo -e "\nINFO: Starting upgrade"
${PG_UPGRADE} --jobs=4 --link \
--old-port="${TEMP_PORT}" \
--new-port="${TEMP_PORT}" \
--old-bindir="${POSTGRES_COPY_OF_OLD}/bin" \
--new-bindir="${POSTGRES_DIR}/bin" \
--old-datadir="${POSTGRES_DATA_DIR}" \
--new-datadir="${TEMP_NEW_DATA}" \
--username=awips \
|| cleanup_exit
# analyze_new_cluster.sh is created by pg_upgrade but is not needed.
# admin should run the included "rebuild_stats.sh" instead.
rm -f analyze_new_cluster.sh
echo -e "\nINFO: Fixing postgresql.conf for 9.5"
TEMP_POSTGRESQL_CONF="${TEMP_CONFIG_DIR}/postgresql.conf"
cp -v "${TEMP_POSTGRESQL_CONF}" "${TEMP_POSTGRESQL_CONF}.old" \
&& $(dirname $0)/_update_postgresql_conf.pl \
"${TEMP_POSTGRESQL_CONF}" \
>"${TEMP_POSTGRESQL_CONF}.new" \
&& mv -v "${TEMP_POSTGRESQL_CONF}.new" "${TEMP_POSTGRESQL_CONF}"
[[ "$?" -eq 0 ]] || cleanup_exit
echo -e "\nINFO: Copying config files to new data directory"
for CONF in "${CONFIG_FILES[@]}"; do
cp -v "${TEMP_CONFIG_DIR}/${CONF}" "${TEMP_NEW_DATA}/${CONF}" || cleanup_exit
done
echo -e "\nINFO: Moving tablespaces"
for TS_DIR in "${TABLESPACES[@]}"; do
mv -v "${POSTGRES_DATA_DIR}/${TS_DIR}" "${TEMP_NEW_DATA}" || cleanup_exit
done
echo -e "\nINFO: Moving new data dir to ${POSTGRES_DATA_DIR}"
rm -rf "${TEMP_OLD_DATA}"
mkdir "${TEMP_OLD_DATA}" || cleanup_exit
mv "${POSTGRES_DATA_DIR}"/* "${TEMP_OLD_DATA}"
mv "${TEMP_NEW_DATA}"/* "${POSTGRES_DATA_DIR}"
echo -e "\nINFO: Deleting temp directories"
rm -rf "${TEMP_OLD_DATA}"
rm -rf "${TEMP_NEW_DATA}"
rm -rf "${TEMP_CONFIG_DIR}"
echo -e "\nINFO: Removing symlinked psql"
if [[ -h "${POSTGRES_DIR}/bin/psql" ]]; then
rm -f "${POSTGRES_DIR}/bin/psql"
fi
echo -e "\nINFO: Syncing disks"
sync
echo -e "\nINFO: ****************************************"
echo "INFO: ** UPGRADE COMPLETE **"
echo "INFO: ****************************************"

View file

@ -1,27 +0,0 @@
#!/bin/bash
source "$(dirname $0)/settings_openfire.sh" || exit 1
if [[ "${POSTGRES_VERSION}" != ${OLD_VER} ]]; then
echo -n "ERROR: Currently installed version of PostgreSQL is "
echo "${POSTGRES_VERSION}. Expected ${OLD_VER}. Cannot continue."
exit 1
fi
echo "INFO: Copying ${POSTGRES_DIR} to ${POSTGRES_COPY_OF_OLD}."
if [[ -e ${POSTGRES_COPY_OF_OLD} ]]; then
rm -rf ${POSTGRES_COPY_OF_OLD}
fi
cp -a ${POSTGRES_DIR} ${POSTGRES_COPY_OF_OLD}
if [[ "$?" -ne 0 ]]; then
echo -en "\nERROR: Failed to copy ${POSTGRES_DIR} to ${POSTGRES_COPY_OF_OLD}"
echo "Cannot continue."
exit 1
fi
sync
echo "INFO: Pre-upgrade preparation is complete. No errors reported."

View file

@ -1,20 +0,0 @@
#!/usr/bin/env perl
# Update postgresql.conf (read from stdin)
# Accompanies upgrade from PostgreSQL 9.3.x to 9.5.x
use strict;
use warnings;
while (<>) {
if (/^checkpoint_segments\s*=\s*/ ||
/^autocommit\s*=\s*/ ||
/^debug_assertions\s*=\s*/ ||
/^ssl_renegotiation_limit\s*=\s*/) {
# comment out options removed in PostgreSQL 9.5
chomp;
print "# " . $_ . " # removed in 9.5\n";
} else {
print;
}
}

View file

@ -1,16 +0,0 @@
#!/bin/bash
if [[ "$(id -u)" -ne 0 ]]; then
echo "$(basename $0): need to be root."
exit 1
fi
ts=$(date +%F_%H%M%S)
logdir=/data/fxa/INSTALL/a2logs/17.1.1/pg_upgrade-${ts}
mkdir -p "${logdir}" || exit 1
chown -R awips:fxalpha "${logdir}"
chmod 2775 "${logdir}"
echo INFO: Postgres upgrade logs will be saved to ${logdir}
scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $logdir
sudo -nu awips bash "${scriptdir}"/_postgres_post_upgrade_openfire.sh | sudo -nu awips tee ./postgres_upgrade_$(date +%F_%H%M%S).log

View file

@ -1,8 +0,0 @@
#!/bin/bash
if [[ "$(id -u)" -ne 0 ]]; then
echo "$(basename $0): need to be root."
exit 1
fi
sudo -nu awips bash $(dirname $0)/_postgres_pre_upgrade_openfire.sh

View file

@ -1,21 +0,0 @@
#!/bin/bash
# After pg_upgrade from 9.3.x to 9.5.x, statistics are lost.
# Once the new 9.5.x cluster is running, run this script to regenerate
# the statistics.
VACUUMDB=/awips2/postgresql/bin/vacuumdb
PSQL=/awips2/psql/bin/psql
DATABASES=$(${PSQL} --db openfire -U awips -Atc "
select datname
from pg_database
where datistemplate = false
and datname not in ('awips', 'postgres');
")
for DBNAME in ${DATABASES}; do
if [[ "$(id -u)" -eq 0 ]]; then
sudo -u awips ${VACUUMDB} --username awips --analyze-in-stages ${DBNAME}
else
${VACUUMDB} --username awips --analyze-in-stages ${DBNAME}
fi
done

View file

@ -1,21 +0,0 @@
#!/bin/bash
# Settings for PostgreSQL major version upgrade scripts.
# Specifically for upgrading an Openfire cluster.
OLD_VER="9.3.10"
NEW_VER="9.5.3"
AWIPS2=/awips2
POSTGRES_DIR=$AWIPS2/postgresql
POSTGRES_VERSION=$($POSTGRES_DIR/bin/postgres --version | cut -d' ' -f3)
POSTGRES_COPY_OF_OLD=$AWIPS2/postgresql-$OLD_VER
POSTGRES_DATA_DIR=$AWIPS2/openfire_data
PSQL_DIR=$AWIPS2/psql
PSQL=$PSQL_DIR/bin/psql
PSQL_VERSION=$($PSQL --version | cut -d' ' -f3)
TEMP_OLD_DATA=$POSTGRES_DATA_DIR/.data-$OLD_VER
TEMP_NEW_DATA=$POSTGRES_DATA_DIR/.data-$NEW_VER
TEMP_PORT=50432
PG_UPGRADE=$POSTGRES_DIR/bin/pg_upgrade
PG_TBLSPC=$POSTGRES_DATA_DIR/pg_tblspc
CONFIG_FILES=(pg_hba.conf pg_ident.conf postgresql.conf)
INITDB=$POSTGRES_DIR/bin/initdb

View file

@ -1,176 +0,0 @@
#!/bin/bash
# We Have Been Created To Automate The Building Of The AWIPS II RPMs.
set -x
# We Need To Setup Our Environment.
source env.sh
echo "The AWIPSII Version is $AWIPSII_VERSION "
echo "The AWIPSII Release is $AWIPSII_RELEASE "
if [ "${RPM_TOP_DIR}" = "" ]; then
echo "ERROR: You Must Set The RPM_TOP_DIR Environment Variable."
echo "Unable To Continue ... Terminating."
exit 1
fi
# !! NOTE !! - We Assume That We Are In A Workspace With The Installer Projects,
# The Edex Projects, The Cave Projects, The Native Projects, And Etc.
export WORKSPACE_DIR=`cd ../../../; pwd;`
# The RPM Build Directory Structure Consists Of:
# ROOT = /usr/src/redhat
# * BUILD -
# * RPMS - Our Output RPMs
# * SOURCES - Not Important In Phase I
# * SPECS
# * SRPMS
# Arguments
# ${1} == The Directory With The Specs File And Possibly Other Custom
# Scripts That May Need To Be Merged Into A Component.
export AWIPSII_VERSION=`cat ${WORKSPACE_DIR}/Installer.rpm/version.txt`
export AWIPSII_RELEASE=`date +"%Y%m%d"`
echo "The AWIPSII Version is $AWIPSII_VERSION outside the buildRPM function"
echo "The AWIPSII Release is $AWIPSII_RELEASE outside the buildRPM function"
function buildRPM()
{
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
if [ "${COMPONENT_DIR}" = "Installer.version" ]; then
# Get the build information.
export AWIPSII_BUILD_DATE=`date +"%m-%d-%Y"`
export AWIPSII_BUILD_TIME=`date +"%T %Z"`
export AWIPSII_BUILD_SYSTEM=`uname -n`
echo "The AWIPSII Version is $AWIPSII_VERSION in the buildRPM function"
echo "The AWIPSII Release is $AWIPSII_RELEASE in the buildRPM function"
rpmbuild -bb --target=i386 \
--define '_topdir %(echo ${RPM_TOP_DIR})' \
--define '_component_version %(echo ${AWIPSII_VERSION})' \
--define '_component_release %(echo ${AWIPSII_RELEASE})' \
--define '_component_build_date %(echo ${AWIPSII_BUILD_DATE})' \
--define '_component_build_time %(echo ${AWIPSII_BUILD_TIME})' \
--define '_component_build_system %(echo ${AWIPSII_BUILD_SYSTEM})' \
--define '_svn_tag %(echo ${AWIPSII_BUILD_TAG})' \
--define '_build_site %(echo ${AWIPSII_BUILD_SITE})' \
--buildroot ${BUILDROOT_DIR} \
${COMPONENT_SPECS}
RC=$?
if [ ${RC} -ne 0 ]; then
echo "Unable To Build The RPM Defined In: ${COMPONENT_DIR}."
echo "Unable To Continue ... Terminating."
exit 1
fi
unset AWIPSII_BUILD_DATE
unset AWIPSII_BUILD_TIME
unset AWIPSII_BUILD_SYSTEM
return
fi
export BUILDROOT_DIR="${BUILDROOT_DIR}"
# Build The RPM.
rpmbuild -bb --target=i386 \
--define '_topdir %(echo ${RPM_TOP_DIR})' \
--define '_build_root %(echo ${BUILDROOT_DIR})' \
--define '_build_site %(echo ${AWIPSII_BUILD_SITE})' \
--define '_component_version %(echo ${AWIPSII_VERSION})' \
--define '_component_release %(echo ${AWIPSII_RELEASE})' \
--define '_baseline_workspace %(echo ${WORKSPACE_DIR})' \
--buildroot ${BUILDROOT_DIR} \
${COMPONENT_SPECS}
# If We Are Unable To Build An RPM, Fail The Build:
RC="$?"
unset BUILDROOT_DIR
if [ ! "${RC}" = "0" ]; then
if [ ! "${COMPONENT_DIR}" = "Installer.ant" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.httpd-pypies" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.irt" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.java" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.ldm" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.postgres" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.psql" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.python" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.server" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.tools" ]; then
echo "ERROR: Unable To Build The RPM Defined In: ${COMPONENT_DIR}."
echo "Unable To Continue ... Terminating."
exit 1
fi
fi
}
function buildLocalizationRPMs()
{
BUILDROOT_DIR=/tmp/awips-component
export LOCALIZATION_DIRECTORY="localization"
export COMPONENT_NAME="awips2-localization"
rm -rf ${BUILDROOT_DIR}
rpmbuild -bb \
--define '_topdir %(echo ${RPM_TOP_DIR})' \
--define '_component_version %(echo ${AWIPSII_VERSION})' \
--define '_component_release %(echo ${AWIPSII_RELEASE})' \
--define '_component_name %(echo ${COMPONENT_NAME})' \
--define '_baseline_workspace %(echo ${WORKSPACE_DIR})' \
--define '_localization_directory %(echo ${LOCALIZATION_DIRECTORY})' \
--define '_build_site %(echo ${AWIPSII_BUILD_SITE})' \
--buildroot ${BUILDROOT_DIR} \
../Installer.localization/component.spec
RC=$?
unset LOCALIZATION_DIRECTORY
unset COMPONENT_NAME
if [ ${RC} -ne 0 ]; then
exit 1
fi
}
# Get A List Of The RPM Directories (Excluding This One)
# Note: Presently, We Are In ../../Installer.rpm/deploy.builder
buildLocalizationRPMs
# Adjust Our Execution Position.
cd ../
# Only Build The RPMs That May Have Changed - AWIPS II-Specific Components.
buildRPM "Installer.version"
buildRPM "Installer.gfesuite"
buildRPM "Installer.adapt-native"
buildRPM "Installer.alertviz"
buildRPM "Installer.aviation"
buildRPM "Installer.cli"
buildRPM "Installer.database"
buildRPM "Installer.maps-database"
buildRPM "Installer.gfe.climo"
buildRPM "Installer.topo"
buildRPM "Installer.gfe"
buildRPM "Installer.notification"
buildRPM "Installer.pypies"
buildRPM "Installer.edex-configuration"
unset AWIPSII_VERSION
unset AWIPSII_RELEASE

View file

@ -1,11 +0,0 @@
#!/bin/bash
# We Contain Environment Variables For The AWIPS II RPM Build Environment.
# Standard Build Information.
export AWIPSCM_SHARE=/share1
# The Directory That All Built RPMs Are Placed In.
export BUILT_RPM_DIR=/usr/src/redhat/RPMS/i386

View file

@ -1,17 +0,0 @@
#!/usr/bin/perl
#File: extractTag.pl
# This is a utility script that will extract the tag name from a
# Subversion URL / Location.
if (($#ARGV + 1) != 1)
{
print "Usage: extractSite.pl 'Localization Directory'\n";
exit;
}
$localizationDirectory = $ARGV[0];
@svn_dir_split = split(/\./, $localizationDirectory);
$numElements = scalar (@svn_dir_split);
$site = @svn_dir_split[$numElements - 1];
print "$site\n";

View file

@ -1,17 +0,0 @@
#!/usr/bin/perl
#File: extractTag.pl
# This is a utility script that will extract the tag name from a
# Subversion URL / Location.
if (($#ARGV + 1) != 1)
{
print "Usage: extractTag.pl 'SVN URL'";
exit;
}
$svn_url = $ARGV[0];
@svn_url_split = split(/\//, $svn_url);
$numElements = scalar (@svn_url_split);
$tag = @svn_url_split[$numElements - 1];
print "$tag\n";

View file

@ -32,10 +32,7 @@ function lookupRPM()
installer_dir="${rpms_dir}/../installers/RPMs" installer_dir="${rpms_dir}/../installers/RPMs"
# lookup the rpm. # lookup the rpm.
if [ "${1}" = "awips2-edex-shapefiles" ]; then
export RPM_SPECIFICATION="${awips2_edex_dir}/Installer.edex-shapefiles"
return 0
fi
# foss rpms -> python rpms. # foss rpms -> python rpms.
if [ "${1}" = "awips2-maven" ]; then if [ "${1}" = "awips2-maven" ]; then
export RPM_SPECIFICATION="${installer_dir}/maven/" export RPM_SPECIFICATION="${installer_dir}/maven/"
@ -45,6 +42,14 @@ function lookupRPM()
export RPM_SPECIFICATION="${installer_dir}/python/" export RPM_SPECIFICATION="${installer_dir}/python/"
return 0 return 0
fi fi
if [ "${1}" = "awips2-python-cherrypy" ]; then
export RPM_SPECIFICATION="${python_site__dir}/Installer.cherrypy"
return 0
fi
#if [ "${1}" = "awips2-python-dynamicserialize" ]; then
# export RPM_SPECIFICATION="${python_site__dir}/Installer.dynamicserialize"
# return 0
#fi
if [ "${1}" = "awips2-python-h5py" ]; then if [ "${1}" = "awips2-python-h5py" ]; then
export RPM_SPECIFICATION="${installer_dir}/h5py/" export RPM_SPECIFICATION="${installer_dir}/h5py/"
return 0 return 0
@ -105,30 +110,22 @@ function lookupRPM()
export RPM_SPECIFICATION="${installer_dir}/scipy/" export RPM_SPECIFICATION="${installer_dir}/scipy/"
return 0 return 0
fi fi
if [ "${1}" = "awips2-python-cython" ]; then
export RPM_SPECIFICATION="${python_site__dir}/Installer.cython"
return 0
fi
if [ "${1}" = "awips2-python-cycler" ]; then
export RPM_SPECIFICATION="${python_site__dir}/Installer.cycler"
return 0
fi
if [ "${1}" = "awips2-python-gfe" ]; then
export RPM_SPECIFICATION="${python_site__dir}/Installer.gfe"
return 0
fi
if [ "${1}" = "awips2-python-tables" ]; then if [ "${1}" = "awips2-python-tables" ]; then
export RPM_SPECIFICATION="${installer_dir}/tables/" export RPM_SPECIFICATION="${installer_dir}/tables/"
return 0 return 0
fi fi
#if [ "${1}" = "awips2-python-thrift" ]; then
# export RPM_SPECIFICATION="${python_site__dir}/Installer.thrift"
# return 0
#fi
if [ "${1}" = "awips2-python-tpg" ]; then if [ "${1}" = "awips2-python-tpg" ]; then
export RPM_SPECIFICATION="${python_site__dir}/Installer.tpg" export RPM_SPECIFICATION="${python_site__dir}/Installer.tpg"
return 0 return 0
fi fi
if [ "${1}" = "awips2-python-awips" ]; then #if [ "${1}" = "awips2-python-ufpy" ]; then
export RPM_SPECIFICATION="${python_site__dir}/Installer.python-awips" # export RPM_SPECIFICATION="${python_site__dir}/Installer.ufpy"
return 0 # return 0
fi #fi
if [ "${1}" = "awips2-python-werkzeug" ]; then if [ "${1}" = "awips2-python-werkzeug" ]; then
export RPM_SPECIFICATION="${python_site__dir}/Installer.werkzeug" export RPM_SPECIFICATION="${python_site__dir}/Installer.werkzeug"
return 0 return 0
@ -143,8 +140,8 @@ function lookupRPM()
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.ncep-database" export RPM_SPECIFICATION="${awips2_core_dir}/Installer.ncep-database"
return 0 return 0
fi fi
if [ "${1}" = "awips2-adapt-native" ]; then if [ "${1}" = "awips2-aviation-shared" ]; then
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.adapt-native" export RPM_SPECIFICATION="${awips2_core_dir}/Installer.aviation"
return 0 return 0
fi fi
if [ "${1}" = "awips2-cli" ]; then if [ "${1}" = "awips2-cli" ]; then
@ -155,26 +152,14 @@ function lookupRPM()
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.database" export RPM_SPECIFICATION="${awips2_core_dir}/Installer.database"
return 0 return 0
fi fi
if [ "${1}" = "awips2-database-server-configuration" ]; then
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.database-server-configuration"
return 0
fi
if [ "${1}" = "awips2-gfesuite" ]; then if [ "${1}" = "awips2-gfesuite" ]; then
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.gfesuite" export RPM_SPECIFICATION="${awips2_core_dir}/Installer.gfesuite"
return 0 return 0
fi fi
if [ "${1}" = "-localization" ]; then
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.localization"
return 0
fi
if [ "${1}" = "awips2-maps-database" ]; then if [ "${1}" = "awips2-maps-database" ]; then
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.maps-database" export RPM_SPECIFICATION="${awips2_core_dir}/Installer.maps-database"
return 0 return 0
fi fi
if [ "${1}" = "awips2-notification" ]; then
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.notification"
return 0
fi
if [ "${1}" = "awips2-pypies" ]; then if [ "${1}" = "awips2-pypies" ]; then
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.pypies" export RPM_SPECIFICATION="${awips2_core_dir}/Installer.pypies"
return 0 return 0
@ -195,6 +180,10 @@ function lookupRPM()
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.common-base" export RPM_SPECIFICATION="${awips2_core_dir}/Installer.common-base"
return 0 return 0
fi fi
if [ "${1}" = "awips2-rehost-support-postgresql" ]; then
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.rehost-support"
return 0
fi
# foss rpms. # foss rpms.
if [ "${1}" = "awips2-qpid-java" ]; then if [ "${1}" = "awips2-qpid-java" ]; then
@ -225,18 +214,14 @@ function lookupRPM()
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.groovy" export RPM_SPECIFICATION="${awips2_core_dir}/Installer.groovy"
return 0 return 0
fi fi
if [ "${1}" = "awips2-ldm" ]; then
export RPM_SPECIFICATION="${awips2_upc_dir}/Installer.ldm"
return 0
fi
if [ "${1}" = "awips2-edex-upc" ]; then
export RPM_SPECIFICATION="${awips2_upc_dir}/Installer.edex-upc"
return 0
fi
if [ "${1}" = "awips2-postgresql" ]; then if [ "${1}" = "awips2-postgresql" ]; then
export RPM_SPECIFICATION="${installer_dir}/postgresql" export RPM_SPECIFICATION="${installer_dir}/postgresql"
return 0 return 0
fi fi
if [ "${1}" = "awips2-pgadmin3" ]; then
export RPM_SPECIFICATION="${installer_dir}/pgadmin3"
return 0
fi
if [ "${1}" = "awips2-tools" ]; then if [ "${1}" = "awips2-tools" ]; then
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.tools" export RPM_SPECIFICATION="${awips2_core_dir}/Installer.tools"
return 0 return 0
@ -267,6 +252,39 @@ function lookupRPM()
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.edex-environment/edex" export RPM_SPECIFICATION="${awips2_core_dir}/Installer.edex-environment/edex"
return 0 return 0
fi fi
if [ "${1}" = "awips2-edex-shapefiles" ]; then
export RPM_SPECIFICATION="${awips2_edex_dir}/Installer.edex-shapefiles"
return 0
fi
# Unidata additions
if [ "${1}" = "awips2-ldm" ]; then
export RPM_SPECIFICATION="${awips2_upc_dir}/Installer.ldm"
return 0
fi
if [ "${1}" = "awips2-edex-upc" ]; then
export RPM_SPECIFICATION="${awips2_upc_dir}/Installer.edex-upc"
return 0
fi
if [ "${1}" = "awips2-localization" ]; then
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.localization"
return 0
fi
if [ "${1}" = "awips2-python-awips" ]; then
export RPM_SPECIFICATION="${python_site__dir}/Installer.python-awips"
return 0
fi
if [ "${1}" = "awips2-python-cython" ]; then
export RPM_SPECIFICATION="${python_site__dir}/Installer.cython"
return 0
fi
if [ "${1}" = "awips2-python-cycler" ]; then
export RPM_SPECIFICATION="${python_site__dir}/Installer.cycler"
return 0
fi
if [ "${1}" = "awips2-python-gfe" ]; then
export RPM_SPECIFICATION="${python_site__dir}/Installer.gfe"
return 0
fi
return 1 return 1
} }

View file

@ -1,231 +0,0 @@
#!/bin/bash
function buildOpenfire()
{
lookupRPM "awips2-openfire"
if [ $? -ne 0 ]; then
echo "ERROR: '${1}' is not a recognized AWIPS II RPM."
exit 1
fi
/usr/bin/rpmbuild -ba --target=i386 \
--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_build_date %(echo ${COMPONENT_BUILD_DATE})' \
--define '_component_build_time %(echo ${COMPONENT_BUILD_TIME})' \
--define '_component_build_system %(echo ${COMPONENT_BUILD_SYSTEM})' \
--buildroot ${AWIPSII_BUILD_ROOT} \
${RPM_SPECIFICATION}/component.spec
if [ $? -ne 0 ]; then
echo "ERROR: Failed to build RPM ${1}."
exit 1
fi
return 0
}
function buildJava()
{
pushd . > /dev/null 2>&1
cd ${WORKSPACE}/rpms/awips2.core/Installer.java
/bin/bash build.sh
if [ $? -ne 0 ]; then
return 1
fi
popd > /dev/null 2>&1
}
function buildQPID()
{
# Arguments:
# ${1} == optionally -ade
pushd . > /dev/null 2>&1
# ensure that the destination rpm directories exist
if [ ! -d ${AWIPSII_TOP_DIR}/RPMS/noarch ]; then
mkdir -p ${AWIPSII_TOP_DIR}/RPMS/noarch
if [ $? -ne 0 ]; then
exit 1
fi
fi
# ensure that the destination rpm directories exist
if [ ! -d ${AWIPSII_TOP_DIR}/RPMS/x86_64 ]; then
mkdir -p ${AWIPSII_TOP_DIR}/RPMS/x86_64
if [ $? -ne 0 ]; then
exit 1
fi
fi
cd ${WORKSPACE}/installers/RPMs/qpid-lib
if [ $? -ne 0 ]; then
echo "ERROR: Failed to build the qpid rpms."
return 1
fi
/bin/bash build.sh
if [ $? -ne 0 ]; then
echo "ERROR: Failed to build the qpid rpms."
return 1
fi
#build
export AWIPS_II_TOP_DIR
cd ${WORKSPACE}/installers/RPMs/qpid-java-broker/
if [ $? -ne 0 ]; then
echo "ERROR: Failed to build Qpid Broker"
echo "could not cd to ${WORKSPACE}/installers/RPMs/qpid-java-broker/"
return 1
fi
/bin/bash build.sh
if [ $? -ne 0 ]; then
echo "ERROR: Failed to build Qpid Broker"
echo "build.sh failed"
return 1
fi
popd > /dev/null 2>&1
return 0
}
function buildEDEX()
{
cd ${WORKSPACE}/rpms/awips2.edex/deploy.builder
if [ $? -ne 0 ]; then
echo "ERROR: Failed to build the edex rpms."
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 rpms."
return 1
fi
return 0
}
function buildCAVE()
{
cd ${WORKSPACE}/rpms/awips2.cave/deploy.builder
if [ $? -ne 0 ]; then
echo "ERROR: Failed to build the cave rpms."
return 1
fi
# Determine the build architecture.
export CAVE_BUILD_ARCH=`uname -i`
if [ "${CAVE_BUILD_ARCH}" = "i386" ]; then
export CAVE_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 cave rpms."
return 1
fi
return 0
}
function buildLocalizationRPMs()
{
awips2_core_directory=${WORKSPACE}/rpms/awips2.core
installer_localization_directory="${awips2_core_directory}/Installer.localization"
localization_SPECIFICATION="${installer_localization_directory}/component.spec"
export LOCALIZATION_DIRECTORY="localization"
export COMPONENT_NAME="awips2-localization"
echo "Building localization rpm"
rpmbuild -ba \
--define '_topdir %(echo ${AWIPSII_TOP_DIR})' \
--define '_component_version %(echo ${AWIPSII_VERSION})' \
--define '_component_release %(echo ${AWIPSII_RELEASE})' \
--define '_component_name %(echo ${COMPONENT_NAME})' \
--define '_baseline_workspace %(echo ${WORKSPACE})' \
--define '_localization_directory %(echo ${LOCALIZATION_DIRECTORY})' \
--buildroot ${AWIPSII_BUILD_ROOT} \
${localization_SPECIFICATION}
RC=$?
unset LOCALIZATION_DIRECTORY
unset COMPONENT_NAME
if [ ${RC} -ne 0 ]; then
return 1
fi
return 0
}
function unpackHttpdPypies()
{
# This function will unpack the httpd-pypies SOURCES
# into the: ${AWIPSII_TOP_DIR}/SOURCES directory.
awips2_core_directory=${WORKSPACE}/rpms/awips2.core
httpd_pypies_directory=${awips2_core_directory}/Installer.httpd-pypies
echo httpd_pypies_directory=${httpd_pypies_directory}
httpd_SOURCES=${httpd_pypies_directory}/src/httpd-2.2.15-SOURCES.tar
#httpd_SOURCES=${httpd_pypies_directory}/src/httpd-2.2.31.tar
echo httpd_SOURCES=${httpd_SOURCES}
/bin/tar -xvf ${httpd_SOURCES} -C ${AWIPSII_TOP_DIR}/SOURCES
if [ $? -ne 0 ]; then
return 1
fi
cp -vf ${httpd_pypies_directory}/SOURCES/* ${AWIPSII_TOP_DIR}/SOURCES
if [ $? -ne 0 ]; then
return 1
fi
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
}

View file

@ -1,25 +0,0 @@
#!/bin/bash
# This script will just display the usage information.
function usage()
{
echo "Usage: $0 OPTION [-nobinlightning]"
echo " -delta perform a build of only the rpms that are likely to change."
echo " -java build Java rpm."
echo " -local build localization rpms."
echo " -full perform a full build of all the rpms."
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 " -python build Python rpms."
echo " -pydev build additional Python rpms."
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."
echo " -dev call functions directly"
echo " -package create a yum repository tar file with the rpms that were just built."
echo " --help display this message and exit."
return 0
}

View file

@ -1,109 +0,0 @@
#!/bin/bash
function buildRPM()
{
# Arguments:
# ${1} == the name of the rpm.
lookupRPM "${1}"
if [ $? -ne 0 ]; then
echo "ERROR: '${1}' is not a recognized AWIPS II RPM."
exit 1
fi
/usr/bin/rpmbuild -bb \
--define '_topdir %(echo ${AWIPSII_TOP_DIR})' \
--define '_baseline_workspace %(echo ${WORKSPACE})' \
--define '_uframe_eclipse %(echo ${UFRAME_ECLIPSE})' \
--define '_static_files %(echo ${AWIPSII_STATIC_FILES})' \
--define '_build_root %(echo ${AWIPSII_BUILD_ROOT})' \
--define '_build_site %(echo ${AWIPSII_BUILD_SITE})' \
--define '_component_version %(echo ${AWIPSII_VERSION})' \
--define '_component_release %(echo ${AWIPSII_RELEASE})' \
--define '_component_build_date %(echo ${COMPONENT_BUILD_DATE})' \
--define '_component_build_time %(echo ${COMPONENT_BUILD_TIME})' \
--define '_component_build_system %(echo ${COMPONENT_BUILD_SYSTEM})' \
--buildroot ${AWIPSII_BUILD_ROOT} \
${RPM_SPECIFICATION}/component.spec
if [ $? -ne 0 ]; then
echo "ERROR: Failed to build RPM ${1}."
exit 1
fi
return 0
}
# This script will build all of the 32-bit rpms.
# Ensure that we are on a machine with the correct architecture.
architecture=`uname -i`
if [ ! "${architecture}" = "i386" ]; then
echo "ERROR: This build can only be performed on a 32-bit Operating System."
exit 1
fi
# Determine which directory we are running from.
path_to_script=`readlink -f $0`
dir=$(dirname $path_to_script)
common_dir=`cd ${dir}/../common; pwd;`
if [ $? -ne 0 ]; then
echo "ERROR: Unable to find the common functions directory."
exit 1
fi
# source the common functions.
source ${common_dir}/lookupRPM.sh
if [ $? -ne 0 ]; then
echo "ERROR: Unable to source the common functions."
exit 1
fi
source ${common_dir}/systemInfo.sh
if [ $? -ne 0 ]; then
echo "ERROR: Unable to retrieve the system information."
exit 1
fi
# prepare the build environment.
source ${dir}/buildEnvironment.sh
if [ $? -ne 0 ]; then
echo "ERROR: Unable to prepare the build environment."
exit 1
fi
if [ "${1}" = "-full" ]; then
buildRPM "awips2-qpid-lib"
buildRPM "awips2-qpid-java"
buildRPM "awips2-qpid-java-broker"
buildRPM "awips2-java"
buildRPM "awips2-notification"
exit 0
fi
if [ "${1}" = "-qpid" ]; then
buildRPM "awips2-qpid-lib"
buildRPM "awips2-qpid-java"
buildRPM "awips2-qpid-java-broker"
exit 0
fi
if [ "${1}" = "-java" ]; then
buildRPM "awips2-java"
exit 0
fi
if [ "${1}" = "-notification" ]; then
buildRPM "awips2-notification"
exit 0
fi
echo "Usage: $0 OPTION"
echo " -full perform a full build of all the rpms."
echo " -qpid build only the QPID rpms."
echo " -java build only the Java rpm."
echo " -notification build only the notification rpm."
echo " --help display this message and exit."
exit 0

View file

@ -1,11 +0,0 @@
#!/bin/bash
# User-configurable environment parameters that are used during the build.
export AWIPSII_VERSION="11.9.0"
export AWIPSII_RELEASE="20120223"
export AWIPSII_TOP_DIR="/tmp/${USER}/rpmbuild"
export WORKSPACE="/tmp/${USER}/baseline"
export UFRAME_ECLIPSE="/awips2/eclipse"
export AWIPSII_BUILD_ROOT="/tmp/${USER}/awips-component"

View file

@ -163,7 +163,7 @@ fi
if [ "${1}" = "-localization" ]; then if [ "${1}" = "-localization" ]; then
buildLocalizationRPMs buildLocalization
fi fi
if [ "${1}" = "-server" ]; then if [ "${1}" = "-server" ]; then
@ -178,7 +178,7 @@ if [ "${1}" = "-server" ]; then
#buildRPM "awips2-notification" #buildRPM "awips2-notification"
buildRPM "awips2-common-base" buildRPM "awips2-common-base"
buildRPM "awips2-httpd-pypies" buildRPM "awips2-httpd-pypies"
buildLocalizationRPMs buildLocalization
buildRPM "awips2-adapt-native" buildRPM "awips2-adapt-native"
buildRPM "awips2-cli" buildRPM "awips2-cli"
buildRPM "awips2-edex-environment" buildRPM "awips2-edex-environment"
@ -211,7 +211,7 @@ if [ "${1}" = "-rh6" ]; then
buildRPM "awips2-qpid-java" buildRPM "awips2-qpid-java"
buildRPM "awips2-qpid-java-broker" buildRPM "awips2-qpid-java-broker"
buildRPM "awips2-postgresql" buildRPM "awips2-postgresql"
buildLocalizationRPMs buildLocalization
buildRPM "awips2-adapt-native" buildRPM "awips2-adapt-native"
buildRPM "awips2-cli" buildRPM "awips2-cli"
buildRPM "awips2-edex-environment" buildRPM "awips2-edex-environment"

View file

@ -2,15 +2,21 @@
function buildRPM() function buildRPM()
{ {
# Arguments: if [[ ${1} == "awips2-localization" ]]; then
# ${1} == the name of the rpm.
lookupRPM "${1}"
if [ $? -ne 0 ]; then
echo "ERROR: '${1}' is not a recognized AWIPS II RPM."
exit 1
fi
buildRPMExec "${RPM_SPECIFICATION}" buildLocalization
else
lookupRPM "${1}"
if [ $? -ne 0 ]; then
echo "ERROR: '${1}' is not a recognized AWIPS II RPM."
exit 1
fi
buildRPMExec "${RPM_SPECIFICATION}"
fi
return 0 return 0
} }
@ -19,8 +25,7 @@ function buildRPM()
# ${1} == The Directory With The Specs File And Possibly Other Custom # ${1} == The Directory With The Specs File And Possibly Other Custom
# Scripts That May Need To Be Merged Into A Component. # Scripts That May Need To Be Merged Into A Component.
# ${2} == The name of the CAVE RPM that will be built. # ${2} == The name of the CAVE RPM that will be built.
function buildRPMExec() function buildRPMExec() {
{
local COMPONENT_DIR=${1} local COMPONENT_DIR=${1}
local COMPONENT_SPECS=${COMPONENT_DIR}/component.spec local COMPONENT_SPECS=${COMPONENT_DIR}/component.spec
export RPM_NAME=${2} export RPM_NAME=${2}
@ -46,75 +51,60 @@ function buildRPMExec()
fi fi
} }
function buildEDEX() function buildEDEX() {
{
cd ${WORKSPACE}/rpms/awips2.edex/deploy.builder cd ${WORKSPACE}/rpms/awips2.edex/deploy.builder
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "ERROR: Failed to build the edex rpms." echo "ERROR: Failed to build the edex rpms."
exit 1 exit 1
fi fi
/bin/bash build.sh /bin/bash build.sh
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "ERROR: Failed to build the edex rpms." echo "ERROR: Failed to build the edex rpms."
exit 1 exit 1
fi fi
return 0 return 0
} }
function buildCAVE() function buildCAVE() {
{
cd ${WORKSPACE}/rpms/awips2.cave/deploy.builder cd ${WORKSPACE}/rpms/awips2.cave/deploy.builder
echo "in ${WORKSPACE}/rpms/awips2.cave/deploy.builder" echo "in ${WORKSPACE}/rpms/awips2.cave/deploy.builder"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "ERROR: Failed to build the cave rpms." echo "ERROR: Failed to build the cave rpms."
exit 1 exit 1
fi fi
/bin/bash build.sh /bin/bash build.sh
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "ERROR: Failed to build the cave rpms." echo "ERROR: Failed to build the cave rpms."
exit 1 exit 1
fi fi
return 0 return 0
} }
function buildLocalizationRPMs() function buildLocalization() {
{
awips2_core_directory=${WORKSPACE}/rpms/awips2.core awips2_core_directory=${WORKSPACE}/rpms/awips2.core
extract_site_pl="${awips2_core_directory}/deploy.builder/extractSite.pl"
installer_localization_directory="${awips2_core_directory}/Installer.localization" installer_localization_directory="${awips2_core_directory}/Installer.localization"
localization_SPECIFICATION="${installer_localization_directory}/component.spec" localization_SPECIFICATION="${installer_localization_directory}/component.spec"
export LOCALIZATION_DIRECTORY="localization"
export COMPONENT_NAME="awips2-localization" export COMPONENT_NAME="awips2-localization"
echo "Building localization rpm" echo "Building localization rpm"
rpmbuild -ba \ rpmbuild -ba \
--define '_topdir %(echo ${AWIPSII_TOP_DIR})' \ --define '_topdir %(echo ${AWIPSII_TOP_DIR})' \
--define '_component_version %(echo ${AWIPSII_VERSION})' \ --define '_component_version %(echo ${AWIPSII_VERSION})' \
--define '_component_release %(echo ${AWIPSII_RELEASE})' \ --define '_component_release %(echo ${AWIPSII_RELEASE})' \
--define '_component_name %(echo ${COMPONENT_NAME})' \ --define '_component_name %(echo ${COMPONENT_NAME})' \
--define '_baseline_workspace %(echo ${WORKSPACE})' \ --define '_baseline_workspace %(echo ${WORKSPACE})' \
--define '_localization_directory %(echo ${LOCALIZATION_DIRECTORY})' \ --define '_localization_directory %(echo localization)' \
--define '_build_site %(echo ${AWIPSII_BUILD_SITE})' \ --define '_build_site %(echo ${AWIPSII_BUILD_SITE})' \
--buildroot ${AWIPSII_BUILD_ROOT} \ --buildroot ${AWIPSII_BUILD_ROOT} \
${localization_SPECIFICATION} ${localization_SPECIFICATION}
RC=$? RC=$?
unset LOCALIZATION_DIRECTORY
unset COMPONENT_NAME unset COMPONENT_NAME
if [ ${RC} -ne 0 ]; then if [ ${RC} -ne 0 ]; then
return 1 return 1
fi fi
return 0 return 0
} }
function buildShapefiles() function buildShapefiles() {
{
cd ${WORKSPACE}/rpms/awips2.shapefiles/deploy.builder cd ${WORKSPACE}/rpms/awips2.shapefiles/deploy.builder
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "ERROR: Failed to build the edex shapefile rpm." echo "ERROR: Failed to build the edex shapefile rpm."