merge Installer.edex-configuration into Installer.edex
This commit is contained in:
parent
e7c7897404
commit
98ccaf3926
2 changed files with 38 additions and 234 deletions
|
@ -1,175 +0,0 @@
|
|||
#
|
||||
# AWIPS II edex-configuration Spec File
|
||||
#
|
||||
Name: awips2-edex-configuration
|
||||
Summary: AWIPS II Edex
|
||||
Version: %{_component_version}
|
||||
Release: %{_component_release}%{?dist}
|
||||
Group: AWIPSII
|
||||
BuildRoot: %{_build_root}
|
||||
#BuildArch: noarch
|
||||
URL: N/A
|
||||
License: N/A
|
||||
Distribution: N/A
|
||||
Vendor: %{_build_vendor}
|
||||
Packager: %{_build_site}
|
||||
|
||||
AutoReq: no
|
||||
provides: awips2-edex-configuration
|
||||
requires: awips2
|
||||
requires: awips2-edex-base
|
||||
|
||||
%description
|
||||
AWIPS II Edex Configuration - the edex setup.env file.
|
||||
|
||||
%prep
|
||||
# Verify That The User Has Specified A BuildRoot.
|
||||
if [ "%{_build_root}" = "" ]
|
||||
then
|
||||
echo "ERROR: The RPM Build Root has not been specified."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d %{_build_root} ]; then
|
||||
rm -rf %{_build_root}
|
||||
fi
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
mkdir -p %{_build_root}/awips2/edex
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
mkdir -p %{_build_root}/awips2/edex/logs
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
mkdir -p %{_build_root}/awips2/edex/webapps
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DEPLOY_SCRIPT="deploy.edex.awips2/deploy/deploy-esb-configuration.xml"
|
||||
|
||||
# use deploy-install to deploy edex-configuration.
|
||||
pushd . > /dev/null
|
||||
cd %{_baseline_workspace}
|
||||
/awips2/ant/bin/ant -f ${DEPLOY_SCRIPT} \
|
||||
-Desb.overwrite=true \
|
||||
-Desb.directory=%{_baseline_workspace}/deploy.edex.awips2/esb \
|
||||
-Dedex.root.directory=${RPM_BUILD_ROOT}/awips2/edex
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
popd > /dev/null
|
||||
|
||||
DEPLOY_SCRIPT="deploy.edex.awips2/deploy/deploy-esb.xml"
|
||||
|
||||
# use deploy-install to deploy edex.
|
||||
pushd . > /dev/null
|
||||
cd %{_baseline_workspace}
|
||||
/awips2/ant/bin/ant -f ${DEPLOY_SCRIPT} \
|
||||
-Ddeploy.data=true -Ddeploy.web=true \
|
||||
-Desb.overwrite=true \
|
||||
-Desb.directory=%{_baseline_workspace}/deploy.edex.awips2/esb \
|
||||
-Dedex.root.directory=${RPM_BUILD_ROOT}/awips2/edex \
|
||||
-Dbasedir=%{_baseline_workspace}/deploy.edex.awips2
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
popd > /dev/null
|
||||
|
||||
# remove any .gitignore files
|
||||
# currently, the ebxml webapp includes a .gitignore file
|
||||
/usr/bin/find ${RPM_BUILD_ROOT}/awips2/edex -name .gitignore -exec rm -f {} \;
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# remove the test logback configuration used for development
|
||||
rm -f ${RPM_BUILD_ROOT}/awips2/edex/conf/logback-test.xml
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%pre
|
||||
|
||||
%post
|
||||
|
||||
SETUP_ENV="/awips2/edex/bin/setup.env"
|
||||
SETUP_ENV_NEW="/awips2/edex/bin/setup.env.rpmnew"
|
||||
|
||||
function updateSetupEnv()
|
||||
{
|
||||
# Arguments:
|
||||
# 1) value of the variable to change.
|
||||
# 2) name of the variable to change.
|
||||
# 3) default value of the variable.
|
||||
|
||||
local VALUE="${1}"
|
||||
local VARIABLE="${2}"
|
||||
local DEFAULT="${3}"
|
||||
|
||||
echo "${VALUE}" | sed 's/\//\\\//g' > .awips2_escape.tmp
|
||||
VALUE=`cat .awips2_escape.tmp`
|
||||
rm -f .awips2_escape.tmp
|
||||
|
||||
echo "${DEFAULT}" | sed 's/\//\\\//g' > .awips2_escape.tmp
|
||||
DEFAULT=`cat .awips2_escape.tmp`
|
||||
rm -f .awips2_escape.tmp
|
||||
|
||||
perl -p -i -e "s/export ${VARIABLE}=${DEFAULT}/export ${VARIABLE}=${VALUE}/g" \
|
||||
${SETUP_ENV_NEW}
|
||||
}
|
||||
|
||||
if [ -f "${SETUP_ENV_NEW}" ]; then
|
||||
# rewrite the new setup.env with the existing
|
||||
# configuration - provided as a convenience.
|
||||
source ${SETUP_ENV}
|
||||
|
||||
# update when a variable is added to or removed from setup.env.
|
||||
updateSetupEnv "${AW_SITE_IDENTIFIER}" "AW_SITE_IDENTIFIER" "OAX"
|
||||
updateSetupEnv "${DC_DB_NAME}" "DC_DB_NAME" "dc_ob7oax"
|
||||
updateSetupEnv "${FXA_DB_NAME}" "FXA_DB_NAME" "fxatext"
|
||||
updateSetupEnv "${HM_DB_NAME}" "HM_DB_NAME" "hmdb"
|
||||
updateSetupEnv "${IH_DB_NAME}" "IH_DB_NAME" "hd_ob92oax"
|
||||
updateSetupEnv "${DATA_ARCHIVE_ROOT}" "DATA_ARCHIVE_ROOT" "/tmp/sbn"
|
||||
updateSetupEnv "${DB_ADDR}" "DB_ADDR" "localhost"
|
||||
updateSetupEnv "${DB_PORT}" "DB_PORT" "5432"
|
||||
updateSetupEnv "${BROKER_ADDR}" "BROKER_ADDR" "localhost"
|
||||
updateSetupEnv "${PYPIES_SERVER}" "PYPIES_SERVER" "http://localhost:9582"
|
||||
updateSetupEnv "${HTTP_SERVER}" "HTTP_SERVER" \
|
||||
"http://localhost:9581/services"
|
||||
updateSetupEnv "${JMS_SERVER}" "JMS_SERVER" "tcp://localhost:5672"
|
||||
updateSetupEnv "${SHARE_DIR}" "SHARE_DIR" "/awips2/edex/data/share"
|
||||
updateSetupEnv "${LDAD_EXTERNAL_HOME}" "LDAD_EXTERNAL_HOME" \
|
||||
"/ldad"
|
||||
updateSetupEnv "${LDAD_EXTERNAL_PUBLIC}" "LDAD_EXTERNAL_PUBLIC" \
|
||||
"/data/ldad/public"
|
||||
|
||||
# Remove the existing setup.env.
|
||||
rm -f ${SETUP_ENV}
|
||||
|
||||
# Rename setup.env.rpmnew to setup.env.
|
||||
mv ${SETUP_ENV_NEW} ${SETUP_ENV}
|
||||
fi
|
||||
|
||||
%clean
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
%files
|
||||
%defattr(644,awips,fxalpha,755)
|
||||
%dir /awips2/edex/bin
|
||||
%dir /awips2/edex/conf
|
||||
/awips2/edex/conf/*
|
||||
/awips2/edex/data/*
|
||||
%dir /awips2/edex/etc
|
||||
/awips2/edex/etc/*
|
||||
%dir /awips2/edex/lib
|
||||
/awips2/edex/lib/*
|
||||
%dir /awips2/edex/logs
|
||||
%dir /awips2/edex/webapps
|
||||
%config(noreplace) /awips2/edex/bin/setup.env
|
||||
%defattr(755,awips,fxalpha,755)
|
||||
/awips2/edex/bin/*.sh
|
|
@ -1,13 +1,10 @@
|
|||
#!/bin/bash
|
||||
# This script will build the AWIPS II Edex RPMs.
|
||||
# This script will build the AWIPS Edex RPMs.
|
||||
|
||||
# Build Variables:
|
||||
# -----------------------------------------------------------------------------
|
||||
VAR_AWIPSII_BUILD_ROOT="/tmp/awips-component"
|
||||
VAR_AWIPSII_VERSION=""
|
||||
VAR_AWIPSII_RELEASE=""
|
||||
VAR_UFRAME_ECLIPSE="/awips2/eclipse"
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
if [ "${AWIPSII_TOP_DIR}" = "" ]; then
|
||||
echo "ERROR: You Must Set the AWIPSII_TOP_DIR Environment Variable."
|
||||
|
@ -21,12 +18,10 @@ if [ "${WORKSPACE}" = "" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
function prepareBuildEnvironment()
|
||||
{
|
||||
function prepareBuildEnvironment() {
|
||||
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
|
||||
|
@ -34,7 +29,6 @@ function prepareBuildEnvironment()
|
|||
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
|
||||
|
@ -42,7 +36,6 @@ function prepareBuildEnvironment()
|
|||
fi
|
||||
export AWIPSII_RELEASE="${VAR_AWIPSII_RELEASE}"
|
||||
fi
|
||||
|
||||
if [ "${UFRAME_ECLIPSE}" = "" ]; then
|
||||
export UFRAME_ECLIPSE="${VAR_UFRAME_ECLIPSE}"
|
||||
fi
|
||||
|
@ -56,13 +49,8 @@ if [ ! "${architecture}" = "x86_64" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
function buildRPM()
|
||||
{
|
||||
# Arguments:
|
||||
# ${1} == specs file
|
||||
|
||||
if [ ! "${COMPONENT_NAME}" = "edex-binlightning" ] ||
|
||||
[ ${LIGHTNING} = true ]; then
|
||||
function buildRPM() {
|
||||
# Argument ${1} == specs file
|
||||
/usr/bin/rpmbuild -bb \
|
||||
--define '_topdir %(echo ${AWIPSII_TOP_DIR})' \
|
||||
--define '_baseline_workspace %(echo ${WORKSPACE})' \
|
||||
|
@ -79,42 +67,33 @@ function buildRPM()
|
|||
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
|
||||
#pushd ${WORKSPACE}/build.edex
|
||||
#if [ $? -ne 0 ]; then
|
||||
# exit 1
|
||||
#fi
|
||||
#/awips2/ant/bin/ant -f build.xml -Dlightning=true \
|
||||
# -Duframe.eclipse=${UFRAME_ECLIPSE}
|
||||
#RC=$?
|
||||
#if [ ${RC} -ne 0 ]; then
|
||||
# exit 1
|
||||
#fi
|
||||
#popd
|
||||
|
||||
# Adjust Our Execution Position.
|
||||
cd ../
|
||||
|
||||
buildRPM "Installer.edex"
|
||||
buildRPM "Installer.edex-configuration"
|
||||
|
||||
DIST="${WORKSPACE}/build.edex/edex/dist"
|
||||
for edex_zip in `cd ${DIST}; ls -1;`;
|
||||
do
|
||||
edex_component=`python -c "zipFile='${edex_zip}'; componentName=zipFile.replace('.zip',''); print componentName;"`
|
||||
export COMPONENT_NAME="${edex_component}"
|
||||
buildRPM "Installer.edex-component"
|
||||
unset COMPONENT_NAME
|
||||
done
|
||||
#DIST="${WORKSPACE}/build.edex/edex/dist"
|
||||
#for edex_zip in `cd ${DIST}; ls -1;`;
|
||||
#do
|
||||
# edex_component=`python -c "zipFile='${edex_zip}'; componentName=zipFile.replace('.zip',''); print componentName;"`
|
||||
# export COMPONENT_NAME="${edex_component}"
|
||||
# buildRPM "Installer.edex-component"
|
||||
# unset COMPONENT_NAME
|
||||
#done
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue