diff --git a/rpms/awips2.core/Installer.yajsw/component.spec b/rpms/awips2.core/Installer.yajsw/component.spec new file mode 100644 index 0000000000..88daea2c59 --- /dev/null +++ b/rpms/awips2.core/Installer.yajsw/component.spec @@ -0,0 +1,84 @@ +%define _yajsw_version 11.11 + +# +# AWIPS II YAJSW Spec File +# + +Name: awips2-yajsw +Summary: AWIPS II yajsw Distribution +Version: %{_yajsw_version} +Release: 1 +Group: AWIPSII +BuildRoot: %{_build_root} +BuildArch: noarch +URL: N/A +License: N/A +Distribution: N/A +Vendor: Raytheon +Packager: Bryan Kowal + +AutoReq: no + +provides: awips2-yajsw +requires: awips2-java + +%description +AWIPS II yajsw Distribution - A custom compilation of yajsw ${_yajsw_version} used +by several AWIPS II components. + +# disable jar repacking +%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g') + +%prep +# Ensure that a "buildroot" has been specified. +if [ "%{_build_root}" = "" ]; then + echo "ERROR: A BuildRoot has not been specified." + echo "FATAL: Unable to Continue ... Terminating." + exit 1 +fi + +if [ -d %{_build_root} ]; then + rm -rf %{_build_root} +fi +/bin/mkdir -p %{_build_root} +if [ $? -ne 0 ]; then + exit 1 +fi + +%install +DIST_DIR="%{_baseline_workspace}/foss/yajsw-%{_yajsw_version}/packaged" +YAJSW_SCRIPTS_DIR="%{_baseline_workspace}/rpms/awips2.core/Installer.yajsw/scripts" + +YAJSW_ZIP="yajsw-dist.zip" + +unzip ${DIST_DIR}/${YAJSW_ZIP} -d %{_build_root} +if [ $? -ne 0 ]; then + exit 1 +fi + +mkdir -p %{_build_root}/etc +if [ $? -ne 0 ]; then + exit 1 +fi +cp -rv ${YAJSW_SCRIPTS_DIR}/* %{_build_root}/etc +if [ $? -ne 0 ]; then + exit 1 +fi + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%files +%defattr(644,awips,fxalpha,755) +%dir /awips2 +%dir /awips2/yajsw +/awips2/yajsw/*.jar +/awips2/yajsw/*.txt +%dir /awips2/yajsw/lib +/awips2/yajsw/lib/* + +%defattr(755,awips,fxalpha,755) +%dir /awips2/yajsw/scripts +/awips2/yajsw/scripts/*.sh + +%attr(744,root,root) /etc/profile.d/* \ No newline at end of file diff --git a/rpms/awips2.core/Installer.yajsw/scripts/profile.d/awips2Yajsw.sh b/rpms/awips2.core/Installer.yajsw/scripts/profile.d/awips2Yajsw.sh new file mode 100644 index 0000000000..b9d938a2d7 --- /dev/null +++ b/rpms/awips2.core/Installer.yajsw/scripts/profile.d/awips2Yajsw.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Is Yajsw installed? +rpm -q awips2-yajsw > /dev/null 2>&1 +if [ $? -ne 0 ]; then + return +fi + +YAJSW_INSTALL="/awips2/yajsw" +# Update The Environment +export YAJSW_HOME=${YAJSW_INSTALL} \ No newline at end of file diff --git a/rpms/build/common/lookupRPM.sh b/rpms/build/common/lookupRPM.sh index 038f9bc53f..a35955a19f 100644 --- a/rpms/build/common/lookupRPM.sh +++ b/rpms/build/common/lookupRPM.sh @@ -251,6 +251,10 @@ function lookupRPM() export RPM_SPECIFICATION="${awips2_core_dir}/Installer.collab-dataserver" return 0 fi + if [ "${1}" = "awips2-yajsw" ]; then + export RPM_SPECIFICATION="${awips2_core_dir}/Installer.yajsw" + return 0 + fi # awips2 rpms -> viz rpms. if [ "${1}" = "awips2-alertviz" ]; then