diff --git a/rpms/awips2-rpm.db b/rpms/awips2-rpm.db index c096f8c10e..65ebe55f50 100644 Binary files a/rpms/awips2-rpm.db and b/rpms/awips2-rpm.db differ diff --git a/rpms/awips2.core/Installer.xmpp/component.spec b/rpms/awips2.core/Installer.xmpp/component.spec new file mode 100644 index 0000000000..8d6d54a250 --- /dev/null +++ b/rpms/awips2.core/Installer.xmpp/component.spec @@ -0,0 +1,136 @@ +# +# Generic AWIPS II XMPP Specs File +# + +# Variables +# ----------------------------------------------------------------------------- +%define _xmpp_server openfire +%define _xmpp_software_version 3.7.1 +%define _xmpp_software_url http://www.igniterealtime.org/projects/openfire +%define _xmpp_software_license Apache License Version 2.0 +# ----------------------------------------------------------------------------- + +Name: awips2-%{_xmpp_server} +Summary: AWIPS II XMPP Server +Version: %{_xmpp_software_version} +Release: 1 +Group: AWIPSII +BuildRoot: /tmp +BuildArch: noarch +URL: %{_xmpp_software_url} +License: %{_xmpp_software_license} +Distribution: N/A +Vendor: Raytheon +Packager: Bryan Kowal + +AutoReq: no +provides: awips2-%{_xmpp_server} + +%description +The AWIPS II XMPP Server - %{_xmpp_server} + +%prep +# Ensure that a valid build root has been supplied. +if [ "${RPM_BUILD_ROOT}" = "/tmp" ] || + [ "${RPM_BUILD_ROOT}" = "" ]; then + echo "An Actual BuildRoot Must Be Specified. Use The --buildroot Parameter." + echo "Unable To Continue ... Terminating" + exit 1 +fi + +# Ensure that the required "generic" scripts are available. +xmpp_project="%{_baseline_workspace}/Installer.rpm/awips2.core/Installer.xmpp" +dist_scripts="${xmpp_project}/dist/scripts" + +# the "packaging" script. +package_script="${dist_scripts}/package.sh" +if [ ! -f ${package_script} ]; then + echo "ERROR: The package script does not exist - ${package_script}." + exit 1 +fi + +# the configuration script. +configuration_script="${dist_scripts}/configure.sh" +if [ ! -f ${configuration_script} ]; then + echo "ERROR: The configuration script does not exist - ${configuration_script}." + exit 1 +fi + +%install +xmpp_project="%{_baseline_workspace}/Installer.rpm/awips2.core/Installer.xmpp" +dist_directory="${xmpp_project}/dist" +dist_scripts="${dist_directory}/scripts" +package_script="${dist_scripts}/package.sh" +configuration_script="${dist_scripts}/configure.sh" +filelist_txt="${dist_directory}/%{_xmpp_server}-files.txt" + +# run the packaging script. +/bin/bash ${package_script} "%{_baseline_workspace}" "${RPM_BUILD_ROOT}" +if [ $? -ne 0 ]; then + exit 1 +fi + +# copy the file list. +cp -v ${filelist_txt} %{_topdir}/BUILD +if [ $? -ne 0 ]; then + exit 1 +fi + +# copy the configuration script. +mkdir -p ${RPM_BUILD_ROOT}/awips2/%{_xmpp_server}/tmp +if [ $? -ne 0 ]; then + exit 1 +fi +cp ${configuration_script} \ + ${RPM_BUILD_ROOT}/awips2/%{_xmpp_server}/tmp +if [ $? -ne 0 ]; then + exit 1 +fi + +%pre + +%post +configuration_script=/awips2/%{_xmpp_server}/tmp/configure.sh + +# run the configuration script. +/bin/bash ${configuration_script} +if [ $? -ne 0 ]; then + exit 1 +fi + +# remove the configuration script. +rm -rf /awips2/%{_xmpp_server}/tmp + +%preun +if [ "${1}" = "2" ]; then + exit 0 +fi + +# Remove the openfire.sh link. +pushd . > /dev/null 2>&1 +cd /awips2/openfire/bin +if [ -L openfire.sh ]; then + rm -f openfire.sh +fi +popd > /dev/null 2>&1 + +# Remove and unregister the openfired service. +if [ -f /etc/init.d/openfired ]; then + /sbin/chkconfig openfired off + /sbin/chkconfig --del openfired + + rm -f /etc/init.d/openfired +fi + +%postun + +%clean +rm -f %{_topdir}/BUILD/%{_xmpp_server}-files.txt +rm -rf ${RPM_BUILD_ROOT} + +%files -f %{_xmpp_server}-files.txt +%defattr(644,awips,fxalpha,755) +%dir /awips2 + +%defattr(755,root,root,755) +/awips2/%{_xmpp_server}/tmp/configure.sh \ No newline at end of file diff --git a/rpms/awips2.core/Installer.xmpp/dist/openfire-files.txt b/rpms/awips2.core/Installer.xmpp/dist/openfire-files.txt new file mode 100644 index 0000000000..bc6b19f472 --- /dev/null +++ b/rpms/awips2.core/Installer.xmpp/dist/openfire-files.txt @@ -0,0 +1,53 @@ +%defattr(644,awips,fxalpha,755) +%dir /awips2/openfire +%dir /awips2/openfire/bin +%dir /awips2/openfire/conf +%docdir /awips2/openfire/documentation +%dir /awips2/openfire/documentation +%dir /awips2/openfire/lib +%dir /awips2/openfire/logs +%dir /awips2/openfire/plugins +%dir /awips2/openfire/resources +%dir /awips2/openfire/.install4j + +# the bin directory +%dir /awips2/openfire/bin/extra +%dir /awips2/openfire/bin/extra/redhat +/awips2/openfire/bin/openfirectl +/awips2/openfire/bin/extra/embedded-db.rc +/awips2/openfire/bin/extra/redhat/* + +# the conf directory +/awips2/openfire/conf/* + +# the documentation directory +/awips2/openfire/documentation/* + +# the lib directory +/awips2/openfire/lib/* + +# the logs directory +/awips2/openfire/logs/* + +# the plugins directory +/awips2/openfire/plugins/* + +# the resources directory +/awips2/openfire/resources/* + +# the .install4j directory +/awips2/openfire/.install4j/* + +# loose files +%doc /awips2/openfire/changelog.html +%doc /awips2/openfire/LICENSE.html +%doc /awips2/openfire/README.html + + +# executable files +%defattr(755,awips,fxalpha,755) +/awips2/openfire/bin/openfire +/awips2/openfire/bin/extra/embedded-db-viewer.sh +/awips2/openfire/bin/extra/openfired +/awips2/openfire/bin/extra/openfire-launchd-wrapper.sh +/awips2/openfire/bin/extra/redhat-postinstall.sh \ No newline at end of file diff --git a/rpms/awips2.core/Installer.xmpp/dist/openfire.patch0 b/rpms/awips2.core/Installer.xmpp/dist/openfire.patch0 new file mode 100644 index 0000000000..f147927f97 --- /dev/null +++ b/rpms/awips2.core/Installer.xmpp/dist/openfire.patch0 @@ -0,0 +1,57 @@ +diff -crB openfire-a/bin/extra/openfired openfire-b/bin/extra/openfired +*** openfire-a/bin/extra/openfired 2011-10-01 16:51:23.000000000 -0500 +--- openfire-b/bin/extra/openfired 2012-04-16 12:15:57.000000000 -0500 +*************** +*** 25,35 **** + + # Set this to tell this script where openfire lives + # If this is not set the script will look for /opt/openfire, then /usr/local/openfire +! #export OPENFIRE_HOME= + + # If there is a different user you would like to run this script as, + # change the following line +! export OPENFIRE_USER=jive + + # ----------------------------------------------------------------- + +--- 25,38 ---- + + # Set this to tell this script where openfire lives + # If this is not set the script will look for /opt/openfire, then /usr/local/openfire +! export OPENFIRE_HOME=/awips2/openfire + + # If there is a different user you would like to run this script as, + # change the following line +! export OPENFIRE_USER=awips +! +! # The location of the awips2-java jdk / jre. +! export app_java_home=/awips2/java + + # ----------------------------------------------------------------- + +diff -crB openfire-a/bin/extra/redhat-postinstall.sh openfire-b/bin/extra/redhat-postinstall.sh +*** openfire-a/bin/extra/redhat-postinstall.sh 2011-10-01 16:51:23.000000000 -0500 +--- openfire-b/bin/extra/redhat-postinstall.sh 2012-04-16 12:11:52.000000000 -0500 +*************** +*** 10,19 **** + + # If you used an non standard directory name of location + # Please specify it here +! # OPENFIRE_HOME= + +! OPENFIRE_USER="jive" +! OPENFIRE_GROUP="jive" + + if [ ! $OPENFIRE_HOME ]; then + if [ -d "/opt/openfire" ]; then +--- 10,19 ---- + + # If you used an non standard directory name of location + # Please specify it here +! OPENFIRE_HOME=/awips2/openfire + +! OPENFIRE_USER="awips" +! OPENFIRE_GROUP="fxalpha" + + if [ ! $OPENFIRE_HOME ]; then + if [ -d "/opt/openfire" ]; then diff --git a/rpms/awips2.core/Installer.xmpp/dist/openfire_3_7_1.tar.gz b/rpms/awips2.core/Installer.xmpp/dist/openfire_3_7_1.tar.gz new file mode 100644 index 0000000000..f5fb76f5bd Binary files /dev/null and b/rpms/awips2.core/Installer.xmpp/dist/openfire_3_7_1.tar.gz differ diff --git a/rpms/awips2.core/Installer.xmpp/dist/scripts/configure.sh b/rpms/awips2.core/Installer.xmpp/dist/scripts/configure.sh new file mode 100644 index 0000000000..2b1807db55 --- /dev/null +++ b/rpms/awips2.core/Installer.xmpp/dist/scripts/configure.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# configure.sh - this script will configure the openfire instance that has +# been installed. + +# Expected Arguments: +# NONE + +pushd . > /dev/null 2>&1 + +# run the redhat-postinstall.sh script. +cd /awips2/openfire/bin/extra +/bin/bash redhat-postinstall.sh > /dev/null 2>&1 +if [ $? -ne 0 ]; then + exit 1 +fi + +# create a link to the openfire script. +cd /awips2/openfire/bin +if [ -L openfire.sh ]; then + rm -f openfire.sh + if [ $? -ne 0 ]; then + exit 1 + fi +fi +ln -s openfire openfire.sh +if [ $? -ne 0 ]; then + exit 1 +fi +exit 0 + +popd > /dev/null 2>&1 diff --git a/rpms/awips2.core/Installer.xmpp/dist/scripts/package.sh b/rpms/awips2.core/Installer.xmpp/dist/scripts/package.sh new file mode 100644 index 0000000000..ace467d168 --- /dev/null +++ b/rpms/awips2.core/Installer.xmpp/dist/scripts/package.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# package.sh - this script will unpack (untar) the openfire binaries, +# apply any required patches to the configuration, and +# prepare openfire for packaging in the rpm. + +# Expected Arguments: +# ${1} == the baseline workspace +# ${2} == the 'RPM_BUILD_ROOT' + +baseline_workspace="${1}" +RPM_BUILD_ROOT="${2}" + +srcdir="${baseline_workspace}/Installer.rpm/awips2.core/Installer.xmpp/dist" +source_tar="${srcdir}/openfire_3_7_1.tar.gz" +patch_file0="${srcdir}/openfire.patch0" + +# Prepare the installation directory. +if [ -d ${RPM_BUILD_ROOT} ]; then + rm -rf ${RPM_BUILD_ROOT} + if [ $? -ne 0 ]; then + exit 1 + fi +fi +mkdir -p ${RPM_BUILD_ROOT}/awips2 +if [ $? -ne 0 ]; then + exit 1 +fi + +# Unpack the source. +tar -xf ${source_tar} \ + -C ${RPM_BUILD_ROOT}/awips2 +if [ $? -ne 0 ]; then + exit 1 +fi + +# Apply the patch. +pushd . +cd ${RPM_BUILD_ROOT}/awips2/openfire +patch -p1 -i ${patch_file0} +if [ $? -ne 0 ]; then + exit 1 +fi +popd + +exit 0 diff --git a/rpms/awips2.core/deploy.builder/build.sh b/rpms/awips2.core/deploy.builder/build.sh index 92ad39bf8d..f6a1d91e06 100755 --- a/rpms/awips2.core/deploy.builder/build.sh +++ b/rpms/awips2.core/deploy.builder/build.sh @@ -190,6 +190,7 @@ buildRPM "Installer.notification" buildRPM "Installer.pypies" buildRPM "Installer.rcm" buildRPM "Installer.localapps-environment" +buildRPM "Installer.xmpp" unset AWIPSII_VERSION unset AWIPSII_RELEASE