diff --git a/rpms/awips2.core/Installer.adapt-native/component.spec b/rpms/awips2.core/Installer.adapt-native/component.spec index 44ec6af8f7..0ec7cf914d 100644 --- a/rpms/awips2.core/Installer.adapt-native/component.spec +++ b/rpms/awips2.core/Installer.adapt-native/component.spec @@ -55,16 +55,6 @@ rm -rf ${RPM_BUILD_ROOT}/awips2/awipsShare if [ "${1}" = "2" ]; then exit 0 fi -# Need To Ensure That We Are Lined Up With The Current Edex (Base) Installation. -EDEX_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-edex-base` -if [ ! "${RPM_INSTALL_PREFIX}" = "${EDEX_INSTALL}" ]; then - echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m" - echo -e "\e[1;31m\| ERROR: This Extension MUST Be Installed At The Same Location As EDEX!!!" - echo -e "\e[1;34m\| INFO: Use '--prefix=${EDEX_INSTALL}'.\e[m" - echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m" - - exit 1 -fi echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m" echo -e "\e[1;34m\| Installing the AWIPS II Adapt Native Libraries...\e[m" diff --git a/rpms/awips2.core/Installer.postgresql/component.spec b/rpms/awips2.core/Installer.postgresql/component.spec index a43deb4f67..a9a720966a 100644 --- a/rpms/awips2.core/Installer.postgresql/component.spec +++ b/rpms/awips2.core/Installer.postgresql/component.spec @@ -5,7 +5,7 @@ Name: awips2-postgresql Summary: AWIPS II PostgreSQL Distribution Version: 8.3.4 -Release: 3 +Release: 4 Group: AWIPSII BuildRoot: /tmp Prefix: /awips2 diff --git a/rpms/awips2.core/Installer.postgresql/scripts/init.d/edex_postgres b/rpms/awips2.core/Installer.postgresql/scripts/init.d/edex_postgres index cb45535102..ba446e43f7 100644 --- a/rpms/awips2.core/Installer.postgresql/scripts/init.d/edex_postgres +++ b/rpms/awips2.core/Installer.postgresql/scripts/init.d/edex_postgres @@ -24,28 +24,11 @@ prog="postmaster" # We will no longer be using hard-coded paths that need to be replaced. # Use rpm to find the paths that we need. -JAVA_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-java` -RC="$?" -if [ ! "${RC}" = "0" ]; then - echo "ERROR: awips2-java Must Be Installed." - echo "Unable To Continue ... Terminating." - exit 1 -fi -PYTHON_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-python` -RC="$?" -if [ ! "${RC}" = "0" ]; then - echo "ERROR: awips2-python Must Be Installed." - echo "Unable To Continue ... Terminating." - exit 1 -fi -PSQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-psql` -RC="$?" -if [ ! "${RC}" = "0" ]; then - echo "ERROR: awips2-psql Must Be Installed." - echo "Unable To Continue ... Terminating." - exit -fi -POSTGRESQL_INSTALL_ROOT=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-postgresql` +JAVA_INSTALL="/awips2/java" +PYTHON_INSTALL="/awips2/python" +PSQL_INSTALL="/awips2/psql" + +POSTGRESQL_INSTALL_ROOT="/awips2" POSTGRESQL_INSTALL="${POSTGRESQL_INSTALL_ROOT}/postgresql" PGDATA_DIR="${POSTGRESQL_INSTALL_ROOT}/data" diff --git a/rpms/awips2.core/Installer.postgresql/scripts/start_developer_postgres.sh b/rpms/awips2.core/Installer.postgresql/scripts/start_developer_postgres.sh index 0c68cb7fe3..80d248d05e 100644 --- a/rpms/awips2.core/Installer.postgresql/scripts/start_developer_postgres.sh +++ b/rpms/awips2.core/Installer.postgresql/scripts/start_developer_postgres.sh @@ -3,7 +3,7 @@ ## EDIT FROM HERE # Use rpm to find installation locations / directory paths. -POSTGRESQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-postgresql` +POSTGRESQL_INSTALL="/awips2" # Installation prefix prefix="${POSTGRESQL_INSTALL}/postgresql" @@ -22,9 +22,9 @@ USER=`whoami` ## STOP EDITING HERE # The path that is to be used for the script -PATH=${POSTGRESQL_INSTALL}/postgresql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +PATH=${prefix}/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -export LD_LIBRARY_PATH=${POSTGRESQL_INSTALL}/postgresql/lib +export LD_LIBRARY_PATH=${prefix}/lib # What to use to start up the postmaster (we do NOT use pg_ctl for this, # as it adds no value and can cause the postmaster to misrecognize a stale diff --git a/rpms/awips2.edex/Installer.edex-native/component.spec b/rpms/awips2.edex/Installer.edex-native/component.spec index ecee5bfada..9d633dbfa0 100644 --- a/rpms/awips2.edex/Installer.edex-native/component.spec +++ b/rpms/awips2.edex/Installer.edex-native/component.spec @@ -61,20 +61,6 @@ cp -r ${MHS_LIB_DIR}/* \ ${RPM_BUILD_ROOT}/awips2/edex/lib/native/linux32/awips1 %pre -if [ "${1}" = "1" ]; then - # This Is An Installation - Not An Upgrade. - # Ensure That We Are Being Installed To The Correct Location. - EDEX_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-edex-base` - if [ ! "${RPM_INSTALL_PREFIX}" = "${EDEX_INSTALL}" ]; then - echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m" - echo -e "\e[1;31m\| ERROR: These Libraries MUST Be Installed At The Same Location As EDEX!!!" - echo -e "\e[1;34m\| INFO: Use '--prefix=${EDEX_INSTALL}'.\e[m" - echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m" - - exit 1 - fi -fi - if [ "${1}" = "2" ]; then exit 0 fi diff --git a/rpms/awips2.qpid/SOURCES/developer_qpid b/rpms/awips2.qpid/SOURCES/developer_qpid index f92f8440c0..0afbd4e1ff 100644 --- a/rpms/awips2.qpid/SOURCES/developer_qpid +++ b/rpms/awips2.qpid/SOURCES/developer_qpid @@ -2,5 +2,5 @@ QPID_INST_PATH=/awips2/qpid # this should be done already, but just in case export LD_LIBRARY_PATH=${QPID_INST_PATH}/lib -${QPID_INST_PATH}/sbin/qpidd --config /awips2/qpid/etc/qpidd.conf --no-module-dir +${QPID_INST_PATH}/sbin/qpidd --config ${QPID_INST_PATH}/etc/qpidd.conf --no-module-dir diff --git a/rpms/awips2.qpid/SOURCES/qpidd b/rpms/awips2.qpid/SOURCES/qpidd index 2b2a07cf96..1f9efef66d 100755 --- a/rpms/awips2.qpid/SOURCES/qpidd +++ b/rpms/awips2.qpid/SOURCES/qpidd @@ -74,7 +74,7 @@ start() { touch $pidfile chown awips:fxalpha $pidfile [ -x /sbin/restorecon ] && /sbin/restorecon $pidfile - runuser - -s /bin/sh awips -c "$QPID_HOME/sbin/$prog --check > $pidfile" + runuser - -s /bin/sh awips -c "$QPID_HOME/sbin/$prog --check --config $QPID_HOME/etc/qpidd.conf > $pidfile" echo "Creating durable queues" $queueCreatorScript diff --git a/rpms/awips2.qpid/SOURCES/queueCreator.sh b/rpms/awips2.qpid/SOURCES/queueCreator.sh index f206dae4c1..fdcfe24b7a 100755 --- a/rpms/awips2.qpid/SOURCES/queueCreator.sh +++ b/rpms/awips2.qpid/SOURCES/queueCreator.sh @@ -2,13 +2,14 @@ export PATH=/awips2/python/bin:$PATH export LD_LIBRARY_PATH=/awips2/python/lib:$LD_LIBRARY_PATH +port=5672 #define 96 Meg persistence queues QUEUES=('external.dropbox' 'Ingest.Text') for queue in ${QUEUES[*]}; do echo "Creating queue $queue" - qpid-config add queue $queue --durable --file-count 32 --file-size 48 + qpid-config --broker-addr localhost:$port add queue $queue --durable --file-count 32 --file-size 48 done #define 48 Meg persistence queues @@ -16,7 +17,7 @@ QUEUES=('Ingest.Grib' 'Ingest.Radar' 'watchwarn' 'cpgsrvFiltering' 'Ingest.model for queue in ${QUEUES[*]}; do echo "Creating queue $queue" - qpid-config add queue $queue --durable --file-count 32 --file-size 24 + qpid-config --broker-addr localhost:$port add queue $queue --durable --file-count 32 --file-size 24 done #define 24 Meg Dat queues @@ -24,7 +25,7 @@ QUEUES=('ffmp' 'cwat' 'vil' 'qpf' 'preciprate' 'fssobs' 'fog') for queue in ${QUEUES[*]}; do echo "Creating queue ${queue}Generate" - qpid-config add queue ${queue}Generate --durable --file-count 16 --file-size 24 + qpid-config --broker-addr localhost:$port add queue ${queue}Generate --durable --file-count 16 --file-size 24 done #define 24 Meg persistence queues @@ -32,7 +33,7 @@ QUEUES=('activeTablePending' 'gfeSvcBackupOp' 'gfeIscQueue' 'edex.tpcWatch' 'ede for queue in ${QUEUES[*]}; do echo "Creating queue $queue" - qpid-config add queue $queue --durable --file-count 16 --file-size 24 + qpid-config --broker-addr localhost:$port add queue $queue --durable --file-count 16 --file-size 24 done #define 24 Meg persistence queues for ingest @@ -40,7 +41,7 @@ QUEUES=('vaa' 'textlightning' 'tcs' 'tcg' 'taf' 'svrwx' 'sfcobs' 'redbook' 'recc for queue in ${QUEUES[*]}; do echo "Creating queue Ingest.$queue" - qpid-config add queue Ingest.$queue --durable --file-count 16 --file-size 24 + qpid-config --broker-addr localhost:$port add queue Ingest.$queue --durable --file-count 16 --file-size 24 done diff --git a/rpms/awips2.qpid/SPECS/qpid-cpp-mrg.spec b/rpms/awips2.qpid/SPECS/qpid-cpp-mrg.spec index d29a8bcf12..1a8b411aa4 100644 --- a/rpms/awips2.qpid/SPECS/qpid-cpp-mrg.spec +++ b/rpms/awips2.qpid/SPECS/qpid-cpp-mrg.spec @@ -91,7 +91,7 @@ Name: %{name} Version: %{qpid_release}.%{qpid_svnrev} -Release: 32%{?dist} +Release: 33%{?dist} Summary: Libraries for Qpid C++ client applications Group: AWIPSII License: ASL 2.0 diff --git a/rpms/awips2.wes2bridge/edex/component.spec b/rpms/awips2.wes2bridge/edex/component.spec new file mode 100644 index 0000000000..b605914e8a --- /dev/null +++ b/rpms/awips2.wes2bridge/edex/component.spec @@ -0,0 +1,250 @@ +%define _installation_directory "/awips2" +# +# awips2-wes2bridge-edex +# +Name: awips2-wes2bridge-edex +Summary: awips2-wes2bridge-edex +Version: %{_component_version} +Release: %{_component_release} +Group: AWIPSII +BuildRoot: %{_build_root} +URL: N/A +License: N/A +Distribution: N/A +Vendor: Raytheon +Packager: Bryan Kowal + +AutoReq: no +provides: awips2-wes2bridge-edex +provides: awips2-edex-base +provides: awips2-base-component +provides: awips2-edex-gfe +requires: awips2-postgresql +requires: awips2-qpid-server-store +requires: awips2-qpid-client +requires: awips2-qpid-server +requires: awips2-python +requires: awips2-java +requires: awips2-psql + +conflicts: awips2-edex-satellite +conflicts: awips2-edex-cots +conflicts: awips2-edex-radar +conflicts: awips2-edex-dataplugins +conflicts: awips2-edex-text +conflicts: awips2-edex-bufr +conflicts: awips2-edex-npp +conflicts: awips2-edex-grib +conflicts: awips2-edex-dat +conflicts: awips2-edex-common-core +conflicts: awips2-edex-configuration +conflicts: awips2-edex-hydro +conflicts: awips2-edex-ncep +conflicts: awips2-edex-core + +%description +The wes2bridge version of awips2-edex consists of the edex runtime and +the AWIPS II wes2bridge manager. The wes2bridge manager exists to spawn +and configure additional instances of the wes2bridge triad {postgresql, +qpid, edex}. The wes2bridge version of awips2-edex is not designed to +be run in the same way that the standard awips2-edex is. + +# Disable byte-compiling of python and repacking of jar files. +%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') +%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g') + +%prep +# Verify that a build root has been specified. +if [ "%{build_root}" = "" ]; then + echo "ERROR: A 'BuildRoot' has not been specified." + exit 1 +fi + +rm -rf %{_build_root} +if [ $? -ne 0 ]; then + exit 1 +fi + +# Verify that the required scripts exist. +# build.sh +if [ ! -f %{_baseline_workspace}/build.edex/build.sh ]; then + echo "ERROR: Unable to locate the edex pde build script." + exit 1 +fi + +# deploy-install.sh +if [ ! -f %{_baseline_workspace}/build.edex/deploy-install.xml ]; then + echo "ERROR: Unable to locate the edex deploy-install script." + exit 1 +fi + +# ensure that ant is in the path. +which ant > /dev/null 2>&1 +if [ $? -ne 0 ]; then + which ant + exit 1 +fi + +mkdir -p %{_build_root}%{_installation_directory}/edex +if [ $? -ne 0 ]; then + exit 1 +fi +mkdir -p %{_build_root}%{_installation_directory}/wes2bridge/scripts +if [ $? -ne 0 ]; then + exit 1 +fi +mkdir -p %{_build_root}%{_installation_directory}/wes2bridge/macro/utilities +if [ $? -ne 0 ]; then + exit 1 +fi +mkdir -p %{_build_root}%{_installation_directory}/wes2bridge/macro/functions +if [ $? -ne 0 ]; then + exit 1 +fi +mkdir -p %{_build_root}/etc/profile.d +if [ $? -ne 0 ]; then + exit 1 +fi + +# create the edex environment directory. +mkdir -p %{_build_root}/usr/local/wes2bridge + +%build +pushd . > /dev/null 2>&1 +# Run the pde build. +cd %{_baseline_workspace}/build.edex +/bin/bash build.sh -eclipse=%{_uframe_eclipse} +if [ $? -ne 0 ]; then + echo "ERROR: The pde build of edex has failed." + exit 1 +fi +popd > /dev/null 2>&1 + +%install +# Run the deployment to the specified: +# %{_build_root}%{_installation_directory}/edex + +pushd . > /dev/null 2>&1 +cd %{_baseline_workspace}/build.edex +ant -f deploy-install.xml \ + -Dinstall.dir=%{_build_root}%{_installation_directory}/edex \ + -Dinstaller=true +if [ $? -ne 0 ]; then + echo "ERROR: the deploy-install of edex has failed." + exit 1 +fi +popd > /dev/null 2>&1 + +RPM_PROJECT="%{_baseline_workspace}/Installer.rpm" +POSTGRES_INITD="${RPM_PROJECT}/awips2.core/Installer.postgresql/scripts/init.d/edex_postgres" +QPID_INITD="${RPM_PROJECT}/awips2.qpid/SOURCES/qpidd" +QUEUE_SH="${RPM_PROJECT}/awips2.qpid/SOURCES/queueCreator.sh" +EDEX_INITD="${RPM_PROJECT}/awips2.edex/Installer.edex-base/scripts/init.d/edex_camel" + +# Copy the startup scripts. +cp ${POSTGRES_INITD} \ + %{_build_root}%{_installation_directory}/wes2bridge/scripts +if [ $? -ne 0 ]; then + exit 1 +fi +cp ${QPID_INITD} \ + %{_build_root}%{_installation_directory}/wes2bridge/scripts +if [ $? -ne 0 ]; then + exit 1 +fi +cp ${QUEUE_SH} \ + %{_build_root}%{_installation_directory}/wes2bridge/scripts +if [ $? -ne 0 ]; then + exit 1 +fi +cp ${EDEX_INITD} \ + %{_build_root}%{_installation_directory}/wes2bridge/scripts +if [ $? -ne 0 ]; then + exit 1 +fi + +# Copy the wes2bridge macro, functions, and utilities. +DELIVERABLES="%{_baseline_workspace}/Installer.rpm/awips2.wes2bridge/wes2bridge.files/deliverables" + +# Utilities +cp ${DELIVERABLES}/utility/*.jar \ + %{_build_root}%{_installation_directory}/wes2bridge/macro/utilities +if [ $? -ne 0 ]; then + exit 1 +fi + +# Macro and functions. +cp ${DELIVERABLES}/scripts/wes2bridge \ + %{_build_root}%{_installation_directory}/wes2bridge/macro +if [ $? -ne 0 ]; then + exit 1 +fi +cp ${DELIVERABLES}/scripts/functions/*.sh \ + %{_build_root}%{_installation_directory}/wes2bridge/macro/functions +if [ $? -ne 0 ]; then + exit 1 +fi + +# The profile.d script. +cp ${DELIVERABLES}/profile.d/* \ + %{_build_root}/etc/profile.d +if [ $? -ne 0 ]; then + exit 1 +fi + +# Temporary? Remove the edex management plugin. +JAR_FILE="com.raytheon.uf.edex.management.jar" +if [ -f %{_build_root}%{_installation_directory}/edex/lib/plugins/${JAR_FILE} ]; then + rm -f %{_build_root}%{_installation_directory}/edex/lib/plugins/${JAR_FILE} + if [ $? -ne 0 ]; then + exit 1 + fi +fi + +%pre +%post +%preun +%postun + +%files +%defattr(644,awips,fxalpha,755) +%dir /awips2 +%dir /awips2/edex +%dir /awips2/edex/conf +/awips2/edex/conf/* +%dir /awips2/edex/data +/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 +/awips2/edex/webapps/* +%dir /awips2/edex/bin/linux-x86-32 +/awips2/edex/bin/linux-x86-32/*.so +/awips2/edex/bin/linux-x86-32/*.conf +/awips2/edex/bin/setup.env + +%dir /usr/local/wes2bridge + +%defattr(755,awips,fxalpha,755) +%dir /awips2/edex/bin +/awips2/edex/bin/*.sh +/awips2/edex/bin/linux-x86-32/wrapper +/awips2/edex/bin/wrapper.jar + +%defattr(644,root,root,755) +%dir /awips2/wes2bridge +%dir /awips2/wes2bridge/scripts +/awips2/wes2bridge/scripts/* +%dir /awips2/wes2bridge/macro +%dir /awips2/wes2bridge/macro/utilities +/awips2/wes2bridge/macro/utilities/* +%dir /awips2/wes2bridge/macro/functions +/awips2/wes2bridge/macro/functions/* +/etc/profile.d/awips2-wes2bridge-env.sh +/etc/profile.d/awips2-wes2bridge-env.csh + +%defattr(700,root,root,755) +/awips2/wes2bridge/macro/wes2bridge \ No newline at end of file diff --git a/rpms/awips2.wes2bridge/wes2bridge.files/build/build.sh b/rpms/awips2.wes2bridge/wes2bridge.files/build/build.sh new file mode 100644 index 0000000000..fd02433b23 --- /dev/null +++ b/rpms/awips2.wes2bridge/wes2bridge.files/build/build.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# User variables for local builds: +export U_RPM_DESTINATION="/home/bkowal/rpmbuild" +export U_COMPONENT_VERSION="11.9.0" +export U_COMPONENT_RELEASE="1" +export U_BUILD_ROOT="/tmp/${USER}/awips2-build" +export U_UFRAME_ECLIPSE="/opt/uframe-eclipse" +export U_BASELINE_WORKSPACE="/common/bkowal/workspace" + +# build variables +if [ "${RPM_DESTINATION}" = "" ]; then + export RPM_DESTINATION="${U_RPM_DESTINATION}" +fi +if [ "${COMPONENT_VERSION}" = "" ]; then + export COMPONENT_VERSION="${U_COMPONENT_VERSION}" +fi +if [ "${COMPONENT_RELEASE}" = "" ]; then + export COMPONENT_RELEASE="${U_COMPONENT_RELEASE}" +fi +if [ "${BUILD_ROOT}" = "" ]; then + export BUILD_ROOT="${U_BUILD_ROOT}" +fi +if [ "${UFRAME_ECLIPSE}" = "" ]; then + export UFRAME_ECLIPSE="/opt/uframe-eclipse" +fi +if [ "${BASELINE_WORKSPACE}" = "" ]; then + export BASELINE_WORKSPACE="${U_BASELINE_WORKSPACE}" +fi + +WES2BRIDGE="${BASELINE_WORKSPACE}/Installer.rpm/awips2.wes2bridge" + +/usr/bin/rpmbuild -ba --target=i386 \ + --define '_topdir %(echo ${RPM_DESTINATION})' \ + --define '_component_version %(echo ${COMPONENT_VERSION})' \ + --define '_component_release %(echo ${COMPONENT_RELEASE})' \ + --define '_build_root %(echo ${BUILD_ROOT})' \ + --define '_uframe_eclipse %(echo ${UFRAME_ECLIPSE})' \ + --define '_baseline_workspace %(echo ${BASELINE_WORKSPACE})' \ + --buildroot ${BUILD_ROOT} \ + ${WES2BRIDGE}/edex/component.spec +if [ $? -ne 0 ]; then + exit 1 +fi + +exit 0 diff --git a/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/profile.d/awips2-wes2bridge-env.csh b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/profile.d/awips2-wes2bridge-env.csh new file mode 100644 index 0000000000..b22c01dbc2 --- /dev/null +++ b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/profile.d/awips2-wes2bridge-env.csh @@ -0,0 +1,9 @@ +#!/bin/csh + +set WES2BRIDGE_PATH="/awips2/wes2bridge/macro" + +if $?PATH then + setenv PATH ${WES2BRIDGE_PATH}:$PATH +else + setenv PATH ${WES2BRIDGE_PATH} +endif diff --git a/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/profile.d/awips2-wes2bridge-env.sh b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/profile.d/awips2-wes2bridge-env.sh new file mode 100644 index 0000000000..4caf1aa90f --- /dev/null +++ b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/profile.d/awips2-wes2bridge-env.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +WES2BRIDGE_PATH="/awips2/wes2bridge/macro" + +CHECK_PATH=`echo ${PATH} | grep ${WES2BRIDGE_PATH}` +if [ ! "${CHECK_PATH}" = "" ]; then + return +fi + +export PATH=${WES2BRIDGE_PATH}:${PATH} diff --git a/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/create.sh b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/create.sh new file mode 100644 index 0000000000..70caed0bd3 --- /dev/null +++ b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/create.sh @@ -0,0 +1,128 @@ +#!/bin/bash + +function createEnvironment() +{ + # Arguments: + # ${1} configuration file. + + config_file="${1}" + # Determine the name of the environment. + env_name=`/awips2/java/bin/java -jar ${UTILITIES}/ConfigurationUtility.jar "${config_file}" "-name"` + if [ $? -ne 0 ]; then + return 1 + fi + + # Ensure that an environment does not already exist. + if [ -d ${WES2BRIDGE_DIR}/${env_name} ]; then + echo "ERROR: An edex environment with name = ${env_name} already exists." + return 1 + fi + + # An environment does not exist. Create it. + # 1) Create the root directory. + mkdir -p ${WES2BRIDGE_DIR}/${env_name} + if [ $? -ne 0 ]; then + echo "ERROR: Failed to create the ${env_name} environment root directory." + return 1 + fi + + # 2) Create the environment by copying components in /awips2. + # /awips2/edex + cp -r /awips2/edex ${WES2BRIDGE_DIR}/${env_name} + if [ $? -ne 0 ]; then + echo "ERROR: Unable to place edex in the ${env_name} environment." + return 1 + fi + # /awips2/GFESuite + cp -r /awips2/GFESuite ${WES2BRIDGE_DIR}/${env_name} + if [ $? -ne 0 ]; then + echo "ERROR: Unable to place GFESuite in the ${env_name} environment." + return 1 + fi + # /awips2/database + cp -r /awips2/database ${WES2BRIDGE_DIR}/${env_name} + if [ $? -ne 0 ]; then + echo "ERROR: Unable to place the database in the ${env_name} environment." + return 1 + fi + # /awips2/data + cp -r /awips2/data ${WES2BRIDGE_DIR}/${env_name} + if [ $? -ne 0 ]; then + echo "ERROR: Unable to place the database in the ${env_name} environment." + return 1 + fi + # /awips2/postgresql + cp -r /awips2/postgresql ${WES2BRIDGE_DIR}/${env_name} + if [ $? -ne 0 ]; then + echo "ERROR: Unable to place postgresql in the ${env_name} environment." + return 1 + fi + # /awips2/qpid + cp -r /awips2/qpid ${WES2BRIDGE_DIR}/${env_name} + if [ $? -ne 0 ]; then + echo "ERROR: Unable to place qpid in the ${env_name} environment." + return 1 + fi + + # 3) Update the links in: data/pg_tblspc + pushd . > /dev/null 2>&1 + cd ${WES2BRIDGE_DIR}/${env_name}/data/pg_tblspc + for link in `ls -1`; do + linked_dir=`readlink ${link}` + if [ $? -ne 0 ]; then + return 1 + fi + data_dir=`/awips2/java/bin/java -jar ${UTILITIES}/DataLinkUtility.jar "${linked_dir}"` + if [ $? -ne 0 ]; then + return 1 + fi + + # Remove the existing link. + rm -f ${link} + if [ $? -ne 0 ]; then + return 1 + fi + # Create a new link to the correct location. + ln -sf ${WES2BRIDGE_DIR}/${env_name}/data/${data_dir} ${link} + if [ $? -ne 0 ]; then + return 1 + fi + done + popd > /dev/null 2>&1 + + # 4) Create a directory for the environment-specific start (init.d) scripts. + mkdir -p ${WES2BRIDGE_DIR}/${env_name}/wes2bridge + if [ $? -ne 0 ]; then + exit 1 + fi + + # 5) Re-configure: Edex, QPID, and PostgreSQL + /awips2/java/bin/java -jar ${UTILITIES}/Wes2BridgeManager.jar "${config_file}" + if [ $? -ne 0 ]; then + echo "ERROR: Failed to configure the ${env_name} environment." + return 1 + fi + + # 6) Adjust permissions. + chown -R awips:fxalpha ${WES2BRIDGE_DIR}/${env_name} + if [ $? -ne 0 ]; then + return 1 + fi + chmod -R 775 ${WES2BRIDGE_DIR}/${env_name}/edex/data + if [ $? -ne 0 ]; then + return 1 + fi + + # 7) Lockdown the startup scripts. + chown root:root ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/* + if [ $? -ne 0 ]; then + return 1 + fi + chmod 644 ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/* + if [ $? -ne 0 ]; then + return 1 + fi + + # FINISHED. + return 0 +} diff --git a/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/list.sh b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/list.sh new file mode 100644 index 0000000000..3ae3d92155 --- /dev/null +++ b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/list.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +function listEnvironments() +{ + pushd . > /dev/null 2>&1 + cd ${WES2BRIDGE_DIR} + echo "Existing EDEX Environment(s):" + for env_dir in `ls -1`; do + echo " -${env_dir}" + done + popd > /dev/null 2>&1 +} diff --git a/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/remove.sh b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/remove.sh new file mode 100644 index 0000000000..a398bf79fc --- /dev/null +++ b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/remove.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +function removeEnvironment() +{ + # Arguments: + # ${1} configuration file. + # ${2} name. + + config_file="${1}" + env_name="${2}" + + if [ ! "${config_file}" = "" ]; then + # Get the name from the configuration file. + env_name=`/awips2/java/bin/java -jar ${UTILITIES}/ConfigurationUtility.jar "${config_file}" "-name"` + if [ $? -ne 0 ]; then + return 1 + fi + fi + removeEnvironmentInternal "${env_name}" + if [ $? -ne 0 ]; then + return 1 + fi + + return 0 +} + +# private +function removeEnvironmentInternal() +{ + # Arguments: + # ${1} name. + env_name="${1}" + + # Ensure that the environment exists. + if [ ! -d ${WES2BRIDGE_DIR}/${env_name} ]; then + echo "ERROR: The ${env_name} environment does not exist yet." + return 1 + fi + + # Remove the environment. + rm -rf ${WES2BRIDGE_DIR}/${env_name} + if [ $? -ne 0 ]; then + echo "ERROR: Unable to remove the ${env_name} environment." + return 1 + fi + + return 0 +} diff --git a/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/start.sh b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/start.sh new file mode 100644 index 0000000000..2d4511ebd5 --- /dev/null +++ b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/start.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +function startEnvironment() +{ + # Arguments: + # ${1} configuration file. + # ${2} name. + + config_file="${1}" + env_name="${2}" + + if [ ! "${config_file}" = "" ]; then + # Get the name from the configuration file. + env_name=`/awips2/java/bin/java -jar ${UTILITIES}/ConfigurationUtility.jar "${config_file}" "-name"` + if [ $? -ne 0 ]; then + return 1 + fi + fi + startEnvironmentInternal "${env_name}" + if [ $? -ne 0 ]; then + return 1 + fi + + return 0 +} + +# private +function startEnvironmentInternal() +{ + # Arguments: + # ${1} name. + env_name="${1}" + + # Ensure that the environment exists. + if [ ! -d ${WES2BRIDGE_DIR}/${env_name} ]; then + echo "ERROR: The ${env_name} environment does not exist yet." + return 1 + fi + + # Verify that the environment is not missing any startup scripts. + if [ ! -f ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/edex_camel ]; then + echo "ERROR: The ${env_name} environment is corrupt. Recreate it." + return 1 + fi + if [ ! -f ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/edex_postgres ]; then + echo "ERROR: The ${env_name} environment is corrupt. Recreate it." + return 1 + fi + if [ ! -f ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/qpidd ]; then + echo "ERROR: The ${env_name} environment is corrupt. Recreate it." + return 1 + fi + + # Start the environment. + pushd . > /dev/null 2>&1 + cd ${WES2BRIDGE_DIR}/${env_name}/wes2bridge + # Start PostgreSQL. + /bin/bash edex_postgres start + echo + sleep 10 + # Start QPID. + /bin/bash qpidd start + echo + sleep 10 + # Start EDEX (replace with wes mode when available). + /bin/bash edex_camel start + echo + popd > /dev/null 2>&1 + + return 0 +} diff --git a/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/stop.sh b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/stop.sh new file mode 100644 index 0000000000..a3c4c1e7ba --- /dev/null +++ b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/functions/stop.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +function stopEnvironment() +{ + # Arguments: + # ${1} configuration file. + # ${2} name. + + config_file="${1}" + env_name="${2}" + + if [ ! "${config_file}" = "" ]; then + # Get the name from the configuration file. + env_name=`/awips2/java/bin/java -jar ${UTILITIES}/ConfigurationUtility.jar "${config_file}" "-name"` + if [ $? -ne 0 ]; then + return 1 + fi + fi + stopEnvironmentInternal "${env_name}" + if [ $? -ne 0 ]; then + return 1 + fi + + return 0 +} + +# private +function stopEnvironmentInternal() +{ + # Arguments: + # ${1} name. + env_name="${1}" + + # Ensure that the environment exists. + if [ ! -d ${WES2BRIDGE_DIR}/${env_name} ]; then + echo "ERROR: The ${env_name} environment does not exist yet." + return 1 + fi + + # Verify that the environment is not missing any startup scripts. + if [ ! -f ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/edex_camel ]; then + echo "ERROR: The ${env_name} environment is corrupt. Recreate it." + return 1 + fi + if [ ! -f ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/edex_postgres ]; then + echo "ERROR: The ${env_name} environment is corrupt. Recreate it." + return 1 + fi + if [ ! -f ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/qpidd ]; then + echo "ERROR: The ${env_name} environment is corrupt. Recreate it." + return 1 + fi + + # Stop the environment. + pushd . > /dev/null 2>&1 + cd ${WES2BRIDGE_DIR}/${env_name}/wes2bridge + # Stop EDEX. + /bin/bash edex_camel stop + echo + sleep 10 + # Stop QPID. + /bin/bash qpidd stop + echo + sleep 10 + # Stop PostgreSQL. + /bin/bash edex_postgres stop + echo + popd > /dev/null 2>&1 + + return 0 +} diff --git a/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/wes2bridge b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/wes2bridge new file mode 100755 index 0000000000..f47473288d --- /dev/null +++ b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/scripts/wes2bridge @@ -0,0 +1,174 @@ +#!/bin/bash + +# wes2bridge environment +dir="/awips2/wes2bridge/macro" +export WES2BRIDGE_DIR="/usr/local/wes2bridge" +export UTILITIES="${dir}/utilities" + +# access functions +pushd . > /dev/null 2>&1 +cd ${dir}/functions +for func in `ls -1`; do + source ${dir}/functions/${func} +done +popd > /dev/null 2>&1 + +function usage() +{ + echo "Usage: wes2bridge -create \${CONFIG_FILE} [--start]" + echo " wes2bridge -start { \${CONFIG_FILE} | -name \${NAME} }" + echo " wes2bridge -stop { \${CONFIG_FILE} | -name \${NAME} }" + echo " wes2bridge -remove { \${CONFIG_FILE} | -name \${NAME} }" + echo " wes2bridge --list" +} + +function parseCreate() +{ + # The second argument should be a configuration file. + if [ "${2}" = "" ]; then + usage + exit 0 + fi + config_file="${2}" + createEnvironment "${config_file}" + if [ $? -ne 0 ]; then + exit 1 + fi + + # The third argument may be "--start" + if [ "${3}" = "--start" ]; then + startEnvironment "${config_file}" "" + if [ $? -ne 0 ]; then + exit 1 + fi + fi + + exit 0 +} + +function parseStart() +{ + local config_file="" + local env_name="" + + # The second argument could be "-name"; if not, it is a config file. + # If the second argument is "-name", the third argument is the 'name'. + if [ "${2}" = "-name" ]; then + if [ "${3}" = "" ]; then + usage + exit 0 + fi + env_name="${3}" + else + if [ "${2}" = "" ]; then + usage + exit 0 + fi + config_file="${2}" + fi + + startEnvironment "${config_file}" "${env_name}" + if [ $? -ne 0 ]; then + exit 1 + fi + + exit 0 +} + +function parseStop() +{ + local config_file="" + local env_name="" + + # The second argument could be "-name"; if not, it is a config file. + # If the second argument is "-name", the third argument is the 'name'. + if [ "${2}" = "-name" ]; then + if [ "${3}" = "" ]; then + usage + exit 0 + fi + env_name="${3}" + else + if [ "${2}" = "" ]; then + usage + exit 0 + fi + + config_file="${2}" + fi + + stopEnvironment "${config_file}" "${env_name}" + if [ $? -ne 0 ]; then + exit 1 + fi + + exit 0 + +} + +function parseRemove() +{ + local config_file="" + local env_name="" + + # The second argument could be "-name"; if not, it is a config file. + # If the second argument is "-name", the third argument is the 'name'. + if [ "${2}" = "-name" ]; then + if [ "${3}" = "" ]; then + usage + exit 0 + fi + env_name="${3}" + else + if [ "${2}" = "" ]; then + usage + exit 0 + fi + + config_file="${2}" + fi + + removeEnvironment "${config_file}" "${env_name}" + if [ $? -ne 0 ]; then + exit 1 + fi + + exit 0 +} + +if [ $# -eq 0 ]; then + usage + exit 0 +fi + +# The first argument should be one of: {-create, -start, -stop, -remove, --list} +if [ "${1}" = "-create" ]; then + parseCreate $* +fi +if [ "${1}" = "-start" ]; then + parseStart $* +fi +if [ "${1}" = "-stop" ]; then + parseStop $* +fi +if [ "${1}" = "-remove" ]; then + parseRemove $* +fi +if [ "${1}" = "--list" ]; then + listEnvironments + exit 0 +fi + +# default case: +usage + +exit 0 + + + + + + + + + diff --git a/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/utility/ConfigurationUtility.jar b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/utility/ConfigurationUtility.jar new file mode 100644 index 0000000000..ddc7980440 Binary files /dev/null and b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/utility/ConfigurationUtility.jar differ diff --git a/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/utility/DataLinkUtility.jar b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/utility/DataLinkUtility.jar new file mode 100644 index 0000000000..321e3f1c63 Binary files /dev/null and b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/utility/DataLinkUtility.jar differ diff --git a/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/utility/Wes2BridgeManager.jar b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/utility/Wes2BridgeManager.jar new file mode 100644 index 0000000000..9063b15372 Binary files /dev/null and b/rpms/awips2.wes2bridge/wes2bridge.files/deliverables/utility/Wes2BridgeManager.jar differ diff --git a/rpms/common/yum/arch.x86/comps.xml b/rpms/common/yum/arch.x86/comps.xml index a9e4b78ffa..e1e8519be3 100644 --- a/rpms/common/yum/arch.x86/comps.xml +++ b/rpms/common/yum/arch.x86/comps.xml @@ -31,7 +31,6 @@ awips2-edex-text awips2-edex-shapefiles awips2-edex-configuration - awips2-edex-ncep-nsharp awips2-edex-npp awips2-edex-ncep awips2-gfesuite-server @@ -76,6 +75,65 @@ awips2-localapps-environment + + + awips2-wes2bridge + AWIPS II Wes2Bridge + true + This Will Install All Of The AWIPS II Components That Are Required For The Wes2Bridge Environment. + true + + awips2 + awips2-cli + awips2-database + awips2-maps-database + awips2-database-standalone-configuration + + awips2-wes2bridge-edex + awips2-edex-native + awips2-edex-shapefiles + awips2-gfesuite-server + + awips2-httpd-pypies + awips2-adapt-native + awips2-hydroapps-shared + awips2-java + awips2-notification + awips2-postgresql + awips2-psql + awips2-pypies + awips2-python + awips2-qpid-client + awips2-qpid-server + awips2-qpid-server-store + awips2-rcm + awips2-tools + awips2-data.hdf5-topo + awips2-data.hdf5-gfe.climo + awips2-aviation-shared + + awips2-python-cherrypy + awips2-python-dynamicserialize + awips2-python-h5py + awips2-python-matplotlib + awips2-python-nose + awips2-python-numpy + awips2-python-pil + awips2-python-pmw + awips2-python-pupynere + awips2-python-qpid + awips2-python-scientific + awips2-python-scipy + awips2-python-tables + awips2-python-thrift + awips2-python-tpg + awips2-python-ufpy + awips2-python-werkzeug + awips2-python-pygtk + awips2-python-pycairo + awips2-localapps-environment + + awips2-visualize @@ -181,7 +239,6 @@ awips2-edex-shapefiles awips2-edex-text awips2-edex-ncep - awips2-edex-ncep-nsharp awips2-edex-npp awips2-gfesuite-server