Omaha #4826 - remove unnecessary copy statements from the rpm installations. relocate non-rcp managed resources

to their own rpm.

Conflicts:

	cave/com.raytheon.viz.product.awips/awips.product

Change-Id: Ibec1877dbc0c8eb359f00c36be1b71e599694aa4

Former-commit-id: acba70201fc2b1daa7c79729c9015baa82d30d4d
This commit is contained in:
Bryan Kowal 2015-10-06 11:09:01 -05:00
parent 75d645b150
commit 67968e8d8b
15 changed files with 772 additions and 470 deletions

View file

@ -14,7 +14,7 @@ skipFetch=true
skipMaps=true
baseos=linux
basews=gtk
basearch=x86
basearch=x86_64
logExtension=.log
javacDebugInfo=false

View file

@ -6,7 +6,7 @@
<property name="build.ws"
value="gtk" />
<property name="build.arch"
value="x86" />
value="x86_64" />
<property name="build.product"
value="awips.product" />
<!-- Copy the zip file that is produced to this location. -->

View file

@ -49,9 +49,8 @@ collectingFolder=${archivePrefix}
# configs=win32,win32,x86 & linux,motif,x86
# By default the value is *,*,*
#configs = *, *, *
configs=linux, gtk, x86 & \
linux, gtk, x86_64 & \
win32, win32, x86
configs=linux,gtk,x86_64 & \
win32,win32,x86_64
# win32, win32, x86 & \
# linux, gtk, x86_64 & \
# linux, motif, x86 & \

View file

@ -172,40 +172,30 @@
<!-- Steps to do after running assemble. -->
<!-- ===================================================================== -->
<target name="postAssemble">
<!-- Update the 32-bit linux CAVE zip with static files -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86.zip"
update="true">
<fileset dir="${buildDirectory}/../../static/linux"
excludes="alertviz/**" />
<fileset dir="${buildDirectory}/../../static/linux.x86" />
<taskdef resource="net/sf/antcontrib/antlib.xml"
classpath="${builder}/../lib/ant/ant-contrib-1.0b3.jar" />
</zip>
<!-- Update the 64-bit linux CAVE zip with static files -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86_64.zip"
update="true">
<!-- TODO: Is this still necessary? -->
<if>
<available file="${buildDirectory}/${buildLabel}/${buildId}-win32.win32.x86_64.zip" />
<then>
<!-- Temp zip file including all the license files -->
<zip destfile="/tmp/cave/FOSS_licenses.zip">
<fileset dir="${buildDirectory}/../../../rpms/legal/FOSS_licenses"/>
</zip>
<fileset dir="${buildDirectory}/../../static/linux"
excludes="alertviz/**" />
<fileset dir="${buildDirectory}/../../static/linux.x86_64" />
</zip>
<!-- Temp zip file including all the license files -->
<zip destfile="/tmp/cave/FOSS_licenses.zip">
<fileset dir="${buildDirectory}/../../../rpms/legal/FOSS_licenses"/>
</zip>
<!-- Update the 64-bit (amd64) win32 CAVE zip with static and license files -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-win32.win32.x86_64.zip"
update="true">
<!-- Update the 64-bit (amd64) win32 CAVE zip with static and license files -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-win32.win32.x86_64.zip"
update="true">
<fileset dir="${buildDirectory}/../../static/win32.amd64"
excludes="alertviz/**" />
<zipfileset dir="${buildDirectory}/../../../rpms/legal"
includes="Master_Rights_File.pdf" prefix="cave"/>
<zipfileset dir="/tmp/cave" includes="FOSS_licenses.zip" prefix="cave"/>
</zip>
<fileset dir="${buildDirectory}/../../static/win32.amd64"
excludes="alertviz/**" />
<zipfileset dir="${buildDirectory}/../../../rpms/legal"
includes="Master_Rights_File.pdf" prefix="cave"/>
<zipfileset dir="/tmp/cave" includes="FOSS_licenses.zip" prefix="cave"/>
</zip>
</then>
</if>
</target>
@ -224,10 +214,11 @@
<!-- ===================================================================== -->
<!-- Steps to do after the build is done. -->
<!-- ===================================================================== -->
<target name="postBuild">
<target name="postBuild">
<taskdef resource="net/sf/antcontrib/antlib.xml"
classpath="${builder}/../lib/ant/ant-contrib-1.0b3.jar" />
classpath="${builder}/../lib/ant/ant-contrib-1.0b3.jar" />
<!-- TODO: cleanup unused tasks + libs; next changeset -->
<taskdef name="xmltask"
classname="com.oopsconsultancy.xmltask.ant.XmlTask">
<classpath>
@ -235,32 +226,6 @@
<pathelement path="${builder}/../lib/ant/xalan-2.7.2.jar"/>
</classpath>
</taskdef>
<!-- Generate the 32-bit CAVE ini files -->
<var name="cave.arch" value="arch.x86" />
<extractCAVEini
zip.file="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86.zip" />
<!-- add the Xss jvm parameter to the 32-bit CAVE -->
<echo file="/tmp/cave/cave.ini" append="true" message="-Xss512k" />
<antcall target="generateDynamicCAVE" />
<!-- Update the 32-bit CAVE zip file -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86.zip"
basedir="/tmp"
includes="cave/*.ini, cave/*.sh"
update="true" />
<!-- Generate the 64-bit CAVE ini files -->
<var name="cave.arch" value="arch.x86_64" />
<extractCAVEini
zip.file="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86_64.zip" />
<antcall target="generateDynamicCAVE" />
<!-- Update the 64-bit cave.ini file -->
<antcall target="update64BitINI" />
<!-- Update the 64-bit CAVE zip file -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86_64.zip"
basedir="/tmp"
includes="cave/*.ini, cave/*.sh"
update="true" />
</target>
<macrodef name="extractCAVEini">
@ -451,27 +416,6 @@
append="true" />
</target>
<!-- Used to update cave.ini for the x86_64 cave. -->
<target name="update64BitINI">
<xmlproperty file="${builder}/memorySettings.xml"
collapseAttributes="true"/>
<property name="caveXmx" value="2560M" />
<property name="caveMaxPermSize" value="256m" />
<update.ini
ini.file="cave.ini"
jvm.arg="${cave-memory-settings.default-memory-setting.default-max-memory.jvm-arg}"
current.value="${cave-memory-settings.default-memory-setting.default-max-memory.value}"
new.value="${caveXmx}" />
<update.ini
ini.file="cave.ini"
jvm.arg="${cave-memory-settings.default-memory-setting.default-max-perm.jvm-arg}"
current.value="${cave-memory-settings.default-memory-setting.default-max-perm.value}"
new.value="${caveMaxPermSize}" />
</target>
<macrodef name="update.ini">
<attribute name="ini.file" />
<attribute name="jvm.arg" />

View file

@ -20,7 +20,7 @@
-Dosgi.instance.area.readOnly=true
-Dorg.eclipse.update.reconcile=false
-Dorg.eclipse.swt.internal.gtk.cairoGraphics=false
-XX:MaxPermSize=128m
-XX:MaxPermSize=256m
-Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme
-Dqpid.dest_syntax=BURL
-Dlogback.configurationFile=logback-viz-core.xml
@ -35,7 +35,7 @@
-XX:G1MixedGCLiveThresholdPercent=25
-XX:G1OldCSetRegionThresholdPercent=25
-XX:G1HeapWastePercent=5</vmArgs>
<vmArgsLin>-Xmx2048M -XX:MaxDirectMemorySize=2G
<vmArgsLin>-Xmx2560M -XX:MaxDirectMemorySize=2G
-XX:OnOutOfMemoryError=&quot;capture -t no -p $pid &amp;&quot;</vmArgsLin>
<vmArgsWin>-Dfile.encoding=UTF-8 -Xmx2560M</vmArgsWin>
</launcherArgs>
@ -73,11 +73,11 @@
<feature id="com.raytheon.viz.feature.awips" version="1.9.0.qualifier"/>
</features>
<configurations>
<configurations>
<plugin id="com.raytheon.uf.viz.spring.dm" autoStart="true" startLevel="4" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
<plugin id="com.raytheon.uf.viz.spring.dm" autoStart="true" startLevel="4" />
</configurations>
</product>

View file

@ -70,26 +70,7 @@ if [ ! -f /awips2/cave/cave ]; then
exit 1
fi
CAVE_BACKUP="/awips2/cave.bak"
# Remove any existing backups.
if [ -d ${CAVE_BACKUP} ]; then
rm -rf ${CAVE_BACKUP}
fi
# Create a backup of CAVE as it is.
LOG_TIMESTAMP=`date`
echo "backup STARTED: ${LOG_TIMESTAMP}"
cp -r /awips2/cave ${CAVE_BACKUP}
LOG_TIMESTAMP=`date`
echo "backup COMPLETE: ${LOG_TIMESTAMP}"
RC=$?
if [ ${RC} -ne 0 ]; then
exit 1
fi
%post
CAVE_BACKUP="/awips2/cave.bak"
function cleanupUnzip()
{
if [ -f /awips2/cave/.repository/artifacts.xml ]; then
@ -109,18 +90,6 @@ function cleanupUnzip()
fi
}
function restoreCAVEAndFail()
{
rm -rf /awips2/cave
LOG_TIMESTAMP=`date`
echo "restoring backup STARTED: ${LOG_TIMESTAMP}"
mv -f ${CAVE_BACKUP} /awips2/cave
LOG_TIMESTAMP=`date`
echo "restoring backup COMPLETE: ${LOG_TIMESTAMP}"
cleanupUnzip
exit 1
}
# Set all paths required by CAVE before installing.
export LD_LIBRARY_PATH=/awips2/java/lib:/awips2/python/lib:$LD_LIBRARY_PATH
export LD_PRELOAD=libpython.so
@ -171,16 +140,15 @@ unzip %{_component_zip_file_name} > /dev/null 2>&1
RC=$?
if [ ${RC} -ne 0 ]; then
echo "ERROR: Unzip of repository FAILED."
restoreCAVEAndFail
exit 1
fi
# Install the component.
LOG_TIMESTAMP=`date`
echo "installation STARTED: ${LOG_TIMESTAMP}"
${INSTALL_CMD}
RC=$?
if [ ${RC} -ne 0 ]; then
restoreCAVEAndFail
if [ $? -ne 0 ]; then
exit 1
fi
LOG_TIMESTAMP=`date`
echo "installation COMPLETE: ${LOG_TIMESTAMP}"
@ -188,9 +156,6 @@ echo "installation COMPLETE: ${LOG_TIMESTAMP}"
# Cleanup the unzip
cleanupUnzip
# Remove the backup.
rm -rf /awips2/cave.bak
# move localization files in unpacked plugins to the
# cave etc directory.
if [ ! -d /awips2/cave/etc ]; then

View file

@ -0,0 +1,175 @@
# RPM Metadata
%define _component_name awips2-cave-wrapper
%define _component_project_dir awips2.cave/Installer.cave-wrapper
%define _component_zip_file_name CAVE-linux.gtk.%{_build_arch}.zip
#
# awips2-cave-wrapper Spec File
#
%define __prelink_undo_cmd %{nil}
# Disable the brp-python-bytecompile script
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
# Disable the rpm jar repack script
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g')
Name: %{_component_name}
Summary: awips2-cave-wrapper Installation
Version: %{_component_version}
Release: %{_component_release}
Group: AWIPSII
BuildRoot: /tmp
URL: N/A
License: N/A
Distribution: N/A
Vendor: Raytheon
AutoReq: no
Provides: %{_component_name}
Requires: awips2-cave
BuildRequires: awips2-java
%description
Provides scripts and other Viz configuration that make starting CAVE easier.
%prep
# Verify That The User Has Specified A BuildRoot.
if [ "${RPM_BUILD_ROOT}" = "/tmp" ]
then
echo "An Actual BuildRoot Must Be Specified. Use The --buildroot Parameter."
echo "Unable To Continue ... Terminating"
exit 1
fi
if [ -d ${RPM_BUILD_ROOT} ]; then
rm -rf ${RPM_BUILD_ROOT}
fi
CAVE_DIST_DIR="%{_baseline_workspace}/rpms/awips2.cave/setup/dist"
if [ ! -f ${CAVE_DIST_DIR}/%{_component_zip_file_name} ]; then
echo "ERROR: Unable to find - ${CAVE_DIST_DIR}/%{_component_zip_file_name}."
exit 1
fi
%build
pushd . > /dev/null 2>&1
cd %{_baseline_workspace}/rpms/awips2.cave/Installer.cave-wrapper/scripts/memory/iniFileGenerator/src
/awips2/java/bin/javac main/*
if [ $? -ne 0 ]; then
exit 1
fi
popd > /dev/null 2>&1
%install
mkdir -p ${RPM_BUILD_ROOT}/awips2/cave
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p ${RPM_BUILD_ROOT}/etc/xdg/autostart
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p ${RPM_BUILD_ROOT}/etc/profile.d
if [ $? -ne 0 ]; then
exit 1
fi
# The profile.d scripts
PROFILE_D_DIR="%{_baseline_workspace}/rpms/common/environment/awips2-cave/profile.d"
cp ${PROFILE_D_DIR}/* ${RPM_BUILD_ROOT}/etc/profile.d
if [ $? -ne 0 ]; then
exit 1
fi
# The AWIPS II version script.
VERSIONS_SCRIPT="%{_baseline_workspace}/rpms/utility/scripts/versions.sh"
cp ${VERSIONS_SCRIPT} ${RPM_BUILD_ROOT}/awips2/cave
if [ $? -ne 0 ]; then
exit 1
fi
# testWS script
TEXTWS_SCRIPT="%{_baseline_workspace}/rpms/utility/scripts/textWS.sh"
cp ${TEXTWS_SCRIPT} ${RPM_BUILD_ROOT}/awips2/cave
if [ $? -ne 0 ]; then
exit 1
fi
# text-workstation autostart script.
CAVE_SCRIPTS_DIR="%{_baseline_workspace}/rpms/%{_component_project_dir}/scripts"
TEXTWS_AUTO_SCRIPT="${CAVE_SCRIPTS_DIR}/autostart/awips2-textws.desktop"
cp ${TEXTWS_AUTO_SCRIPT} ${RPM_BUILD_ROOT}/etc/xdg/autostart
if [ $? -ne 0 ]; then
exit 1
fi
# CAVE scripts and other required distributables.
_build_cave_static="%{_baseline_workspace}/build/static"
# we want the common directory, the common linux directory, and the architecture-specific Linux directory.
_common_dir="${_build_cave_static}/common/cave"
_linux_dir="${_build_cave_static}/linux/cave"
_linux_arch_dir="${_build_cave_static}/linux.x86_64/cave"
cp -rv ${_common_dir}/* ${RPM_BUILD_ROOT}/awips2/cave
if [ $? -ne 0 ]; then
exit 1
fi
cp -rv ${_linux_dir}/* ${RPM_BUILD_ROOT}/awips2/cave
if [ $? -ne 0 ]; then
exit 1
fi
cp -rv ${_linux_arch_dir}/* ${RPM_BUILD_ROOT}/awips2/cave
if [ $? -ne 0 ]; then
exit 1
fi
CAVE_DIST_DIR="%{_baseline_workspace}/rpms/awips2.cave/setup/dist"
_cave_zip=${CAVE_DIST_DIR}/%{_component_zip_file_name}
_mem_settings_xml=%{_baseline_workspace}/rpms/awips2.cave/Installer.cave-wrapper/scripts/memory/memorySettings.xml
_ini_destination=${RPM_BUILD_ROOT}/awips2/cave
pushd . > /dev/null 2>&1
cd %{_baseline_workspace}/rpms/awips2.cave/Installer.cave-wrapper/scripts/memory/iniFileGenerator/src
/awips2/java/bin/java main/IniFileGenerator "${_cave_zip}" "${_mem_settings_xml}" "${_ini_destination}"
if [ $? -ne 0 ]; then
exit 1
fi
rm -fv main/*.class
if [ $? -ne 0 ]; then
exit 1
fi
popd > /dev/null 2>&1
%pre
%post
# Remove the text-workstation autostart script if we have not been installed
# on an xt workstation
if [ ! "`hostname | cut -b 1-2`" = "xt" ]; then
rm -f /etc/xdg/autostart/awips2-textws.desktop
fi
%preun
%postun
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(644,root,root,-)
/etc/profile.d/awips2Cave.csh
/etc/profile.d/awips2Cave.sh
%defattr(644,awips,fxalpha,755)
%dir /awips2
%dir /awips2/cave
/awips2/cave/*.ini
%dir /awips2/cave/etc
/awips2/cave/etc/*
%defattr(755,awips,fxalpha,755)
%dir /awips2/cave/caveEnvironment
/awips2/cave/caveEnvironment/*
/awips2/cave/*.sh
# not a noarch RPM due to the presence of the architecture-specific libraries.
%dir /awips2/cave/lib%{_build_bits}
/awips2/cave/lib%{_build_bits}/*
%attr(644,root,root) /etc/xdg/autostart/awips2-textws.desktop

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>iniFileGenerator</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,517 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package main;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
/**
* Generates component-specific and wfo-specific ini files for CAVE based on the
* ini file generated by the Eclipse PDE build and the contents of
* memorySettings.xml. Compiled and used by the awips2-cave-wrapper RPM build.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 22, 2015 4826 bkowal Initial creation
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
public class IniFileGenerator {
private final JAXBContext jaxbContext;
private static final String INI_EXT = ".ini";
private final String CAVE_INI_ENTRY = "cave/cave" + INI_EXT;
private final Path zipPath;
private final Path memorySettingsPath;
private final Path iniPath;
protected IniFileGenerator(final String zipPath,
final String memorySettings, final String iniDestination)
throws Exception {
this.zipPath = Paths.get(zipPath);
this.memorySettingsPath = Paths.get(memorySettings);
this.iniPath = Paths.get(iniDestination);
this.jaxbContext = JAXBContext.newInstance(CAVEMemorySettings.class);
}
protected void generate() throws Exception {
CAVEMemorySettings caveMemorySettings = null;
try (InputStream is = Files.newInputStream(memorySettingsPath)) {
caveMemorySettings = (CAVEMemorySettings) this.jaxbContext
.createUnmarshaller().unmarshal(is);
}
String iniContents = null;
try (ZipFile zipFile = new ZipFile(zipPath.toFile(), ZipFile.OPEN_READ);) {
ZipEntry caveIniEntry = zipFile.getEntry(CAVE_INI_ENTRY);
try (InputStream is = zipFile.getInputStream(caveIniEntry);
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);) {
String line;
while ((line = br.readLine()) != null) {
if (iniContents == null) {
iniContents = line;
} else {
iniContents += "\n" + line;
}
}
}
}
final String defaultMaxMemory = caveMemorySettings
.getDefaultMemorySetting().getDefaultMaxMemory().getJvmArg()
+ caveMemorySettings.getDefaultMemorySetting()
.getDefaultMaxMemory().getValue();
final String defaultMaxPerm = caveMemorySettings
.getDefaultMemorySetting().getDefaultMaxPerm().getJvmArg()
+ caveMemorySettings.getDefaultMemorySetting()
.getDefaultMaxPerm().getValue();
try (BufferedWriter bw = Files.newBufferedWriter(
this.iniPath.resolve("iniLookup.sh"), Charset.defaultCharset())) {
this.startIniLookup(bw);
for (MemorySetting memorySetting : caveMemorySettings
.getMemorySettings()) {
String maxMemory = caveMemorySettings.getDefaultMemorySetting()
.getDefaultMaxMemory().getJvmArg()
+ memorySetting.getIniSubsitution().getMaxMemory()
.getValue();
if ("DEFAULT".equals(memorySetting.getIniSubsitution()
.getMaxMemory().getValue())) {
maxMemory = defaultMaxMemory;
}
String maxPerm = caveMemorySettings.getDefaultMemorySetting()
.getDefaultMaxPerm().getJvmArg()
+ memorySetting.getIniSubsitution().getMaxPerm()
.getValue();
if ("DEFAULT".equals(memorySetting.getIniSubsitution()
.getMaxPerm().getValue())) {
maxPerm = defaultMaxPerm;
}
this.writeIniLookupEntry(bw, memorySetting.getCommandLineArgs()
.getFirstArg(), memorySetting.getCommandLineArgs()
.getSecondArg());
final Path iniPath = this.iniPath.resolve(memorySetting
.getCommandLineArgs().getSecondArg() + INI_EXT);
try (BufferedWriter iniBw = Files.newBufferedWriter(iniPath,
Charset.defaultCharset())) {
iniBw.write(iniContents
.replace(defaultMaxMemory, maxMemory).replace(
defaultMaxPerm, maxPerm));
}
}
this.finishIniLookup(bw);
}
for (SiteTypeOverride siteTypeOverride : caveMemorySettings
.getSiteTypeOverrides()) {
String maxMemory = caveMemorySettings.getDefaultMemorySetting()
.getDefaultMaxMemory().getJvmArg()
+ siteTypeOverride.getIniSubsitution().getMaxMemory()
.getValue();
if ("DEFAULT".equals(siteTypeOverride.getIniSubsitution()
.getMaxMemory().getValue())) {
maxMemory = defaultMaxMemory;
}
String maxPerm = caveMemorySettings.getDefaultMemorySetting()
.getDefaultMaxPerm().getJvmArg()
+ siteTypeOverride.getIniSubsitution().getMaxPerm()
.getValue();
if ("DEFAULT".equals(siteTypeOverride.getIniSubsitution()
.getMaxPerm().getValue())) {
maxPerm = defaultMaxPerm;
}
final Path iniPath = this.iniPath.resolve(siteTypeOverride
.getSiteType() + INI_EXT);
try (BufferedWriter iniBw = Files.newBufferedWriter(iniPath,
Charset.defaultCharset())) {
iniBw.write(iniContents.replace(defaultMaxMemory, maxMemory)
.replace(defaultMaxPerm, maxPerm));
}
}
}
private void startIniLookup(BufferedWriter bw) throws Exception {
this.writeIniLookupLine(bw, "#!/bin/bash");
this.writeIniLookupLine(bw, "");
this.writeIniLookupLine(bw,
"# This auto-generated script will be sourced by caveUtil.sh.");
this.writeIniLookupLine(bw, "export ASSOCIATED_INI=");
this.writeIniLookupLine(bw, "");
this.writeIniLookupLine(bw, "function retrieveAssociatedINI()");
this.writeIniLookupLine(bw, "{");
this.writeIniLookupLine(bw, "# Arguments", 1);
this.writeIniLookupLine(bw, "# Arguments", 1);
this.writeIniLookupLine(bw,
"# ${1} == one in the set: {-component, -perspective}", 1);
this.writeIniLookupLine(
bw,
"# ${2} == the argument that corresponds to the first argument",
1);
this.writeIniLookupLine(bw, "");
this.writeIniLookupLine(bw, "# AUTOGENERATED IF STATEMENTS.", 1);
}
private void writeIniLookupEntry(BufferedWriter bw, final String arg1,
final String arg2) throws Exception {
StringBuilder sb = new StringBuilder("if [ \"${1}\" = \"");
sb.append(arg1);
sb.append("\" ] && [ \"${2}\" = \"");
sb.append(arg2);
sb.append("\" ]; then");
this.writeIniLookupLine(bw, sb.toString(), 1);
sb = new StringBuilder("export ASSOCIATED_INI=\"");
sb.append(arg2).append(INI_EXT).append("\"");
this.writeIniLookupLine(bw, sb.toString(), 2);
this.writeIniLookupLine(bw, "return 0", 2);
this.writeIniLookupLine(bw, "fi", 1);
this.writeIniLookupLine(bw, "");
}
private void finishIniLookup(BufferedWriter bw) throws Exception {
this.writeIniLookupLine(bw, "return 1", 1);
this.writeIniLookupLine(bw, "}");
}
private void writeIniLookupLine(BufferedWriter bw, final String text)
throws Exception {
this.writeIniLookupLine(bw, text, 0);
}
private void writeIniLookupLine(BufferedWriter bw, final String text,
final int leadingTabs) throws Exception {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < leadingTabs; i++) {
sb.append(" ");
}
sb.append(text);
sb.append("\n");
bw.write(sb.toString());
}
public static void main(String[] args) {
if (args.length != 3) {
System.out.println("Error: Invalid Arguments Specified.");
System.exit(1);
}
try {
new IniFileGenerator(args[0], args[1], args[2]).generate();
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
System.exit(0);
}
/*
* Memory Settings JAXB POJO.
*/
@SuppressWarnings("unused")
@XmlRootElement(name = "cave-memory-settings")
@XmlAccessorType(XmlAccessType.NONE)
private static class CAVEMemorySettings {
@XmlElement(name = "file-version")
private String fileVersion;
@XmlElement(name = "default-memory-setting")
private DefaultMemorySetting defaultMemorySetting;
@XmlElement(name = "memory-setting")
private List<MemorySetting> memorySettings;
@XmlElement(name = "site-type-override")
private List<SiteTypeOverride> siteTypeOverrides;
private CAVEMemorySettings() {
}
public String getFileVersion() {
return fileVersion;
}
public void setFileVersion(String fileVersion) {
this.fileVersion = fileVersion;
}
public DefaultMemorySetting getDefaultMemorySetting() {
return defaultMemorySetting;
}
public void setDefaultMemorySetting(
DefaultMemorySetting defaultMemorySetting) {
this.defaultMemorySetting = defaultMemorySetting;
}
public List<MemorySetting> getMemorySettings() {
return memorySettings;
}
public void setMemorySettings(List<MemorySetting> memorySettings) {
this.memorySettings = memorySettings;
}
public List<SiteTypeOverride> getSiteTypeOverrides() {
return siteTypeOverrides;
}
public void setSiteTypeOverrides(
List<SiteTypeOverride> siteTypeOverrides) {
this.siteTypeOverrides = siteTypeOverrides;
}
}
@SuppressWarnings("unused")
@XmlAccessorType(XmlAccessType.NONE)
private static class DefaultMemorySetting {
@XmlElement(name = "default-max-memory")
private DefaultJvmArgValuePair defaultMaxMemory;
@XmlElement(name = "default-max-perm")
private DefaultJvmArgValuePair defaultMaxPerm;
private DefaultMemorySetting() {
}
public DefaultJvmArgValuePair getDefaultMaxMemory() {
return defaultMaxMemory;
}
public void setDefaultMaxMemory(DefaultJvmArgValuePair defaultMaxMemory) {
this.defaultMaxMemory = defaultMaxMemory;
}
public DefaultJvmArgValuePair getDefaultMaxPerm() {
return defaultMaxPerm;
}
public void setDefaultMaxPerm(DefaultJvmArgValuePair defaultMaxPerm) {
this.defaultMaxPerm = defaultMaxPerm;
}
}
@SuppressWarnings("unused")
@XmlAccessorType(XmlAccessType.NONE)
private static class DefaultJvmArgValuePair {
@XmlElement(name = "jvm-arg")
private String jvmArg;
@XmlElement
private String value;
private DefaultJvmArgValuePair() {
}
public String getJvmArg() {
return jvmArg;
}
public void setJvmArg(String jvmArg) {
this.jvmArg = jvmArg;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
@SuppressWarnings("unused")
@XmlAccessorType(XmlAccessType.NONE)
private static class MemorySetting {
@XmlElement(name = "command-line-args")
private CommandLineArgs commandLineArgs;
@XmlElement(name = "ini-substitutions")
private IniSubsitution iniSubsitution;
private MemorySetting() {
}
public CommandLineArgs getCommandLineArgs() {
return commandLineArgs;
}
public void setCommandLineArgs(CommandLineArgs commandLineArgs) {
this.commandLineArgs = commandLineArgs;
}
public IniSubsitution getIniSubsitution() {
return iniSubsitution;
}
public void setIniSubsitution(IniSubsitution iniSubsitution) {
this.iniSubsitution = iniSubsitution;
}
}
@SuppressWarnings("unused")
@XmlAccessorType(XmlAccessType.NONE)
private static class SiteTypeOverride {
@XmlElement(name = "site-type")
private String siteType;
@XmlElement(name = "ini-substitutions")
private IniSubsitution iniSubsitution;
private SiteTypeOverride() {
}
public String getSiteType() {
return siteType;
}
public void setSiteType(String siteType) {
this.siteType = siteType;
}
public IniSubsitution getIniSubsitution() {
return iniSubsitution;
}
public void setIniSubsitution(IniSubsitution iniSubsitution) {
this.iniSubsitution = iniSubsitution;
}
}
@SuppressWarnings("unused")
@XmlAccessorType(XmlAccessType.NONE)
private static class CommandLineArgs {
@XmlElement(name = "first-arg")
private String firstArg;
@XmlElement(name = "second-arg")
private String secondArg;
private CommandLineArgs() {
}
public String getFirstArg() {
return firstArg;
}
public void setFirstArg(String firstArg) {
this.firstArg = firstArg;
}
public String getSecondArg() {
return secondArg;
}
public void setSecondArg(String secondArg) {
this.secondArg = secondArg;
}
}
@SuppressWarnings("unused")
@XmlAccessorType(XmlAccessType.NONE)
private static class IniSubsitution {
@XmlElement(name = "max-memory")
private SubstitutionValue maxMemory;
@XmlElement(name = "max-perm")
private SubstitutionValue maxPerm;
private IniSubsitution() {
}
public SubstitutionValue getMaxMemory() {
return maxMemory;
}
public void setMaxMemory(SubstitutionValue maxMemory) {
this.maxMemory = maxMemory;
}
public SubstitutionValue getMaxPerm() {
return maxPerm;
}
public void setMaxPerm(SubstitutionValue maxPerm) {
this.maxPerm = maxPerm;
}
}
@SuppressWarnings("unused")
@XmlAccessorType(XmlAccessType.NONE)
private static class SubstitutionValue {
@XmlElement
private String value;
private SubstitutionValue() {
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
}

View file

@ -2,7 +2,7 @@
<cave-memory-settings>
<!-- The version should be incremented whenever
the file layout changes. -->
<file-version>4.0</file-version>
<file-version>5.0</file-version>
<!-- Example Entry ... See Below. -->
<!--
@ -29,122 +29,16 @@
<default-memory-setting>
<default-max-memory>
<jvm-arg>Xmx</jvm-arg>
<value>2048M</value>
<jvm-arg>-Xmx</jvm-arg>
<value>2560M</value>
</default-max-memory>
<default-max-perm>
<jvm-arg>XX:MaxPermSize=</jvm-arg>
<value>128m</value>
<jvm-arg>-XX:MaxPermSize=</jvm-arg>
<value>256m</value>
</default-max-perm>
</default-memory-setting>
<arch.x86>
<memory-setting>
<command-line-args>
<first-arg>-perspective</first-arg>
<second-arg>GFE</second-arg>
</command-line-args>
<ini-substitutions>
<max-memory>
<value>1536M</value>
</max-memory>
<max-perm>
<value>DEFAULT</value>
</max-perm>
</ini-substitutions>
</memory-setting>
<memory-setting>
<command-line-args>
<first-arg>-component</first-arg>
<second-arg>textws</second-arg>
</command-line-args>
<ini-substitutions>
<max-memory>
<value>128M</value>
</max-memory>
<max-perm>
<value>64m</value>
</max-perm>
</ini-substitutions>
</memory-setting>
<memory-setting>
<command-line-args>
<first-arg>-component</first-arg>
<second-arg>avnmenu</second-arg>
</command-line-args>
<ini-substitutions>
<max-memory>
<value>128M</value>
</max-memory>
<max-perm>
<value>64m</value>
</max-perm>
</ini-substitutions>
</memory-setting>
<memory-setting>
<command-line-args>
<first-arg>-component</first-arg>
<second-arg>gfeclient</second-arg>
</command-line-args>
<ini-substitutions>
<max-memory>
<value>1536M</value>
</max-memory>
<max-perm>
<value>DEFAULT</value>
</max-perm>
</ini-substitutions>
</memory-setting>
<memory-setting>
<command-line-args>
<first-arg>-component</first-arg>
<second-arg>servicebackup</second-arg>
</command-line-args>
<ini-substitutions>
<max-memory>
<value>256M</value>
</max-memory>
<max-perm>
<value>128m</value>
</max-perm>
</ini-substitutions>
</memory-setting>
<memory-setting>
<command-line-args>
<first-arg>-perspective</first-arg>
<second-arg>NCP</second-arg>
</command-line-args>
<ini-substitutions>
<max-memory>
<value>1536M</value>
</max-memory>
<max-perm>
<value>DEFAULT</value>
</max-perm>
</ini-substitutions>
</memory-setting>
</arch.x86>
<arch.x86_64>
<!--
Since this may be increased for GFE in the future,
the following memory setting will remain even though
@ -458,7 +352,5 @@
</max-perm>
</ini-substitutions>
</site-type-override>
</arch.x86_64>
</cave-memory-settings>

View file

@ -10,6 +10,11 @@
#
# awips2-cave Spec File
#
# Note: an upgrade prevention check has been added to the %pre section to ensure that
# this RPM cannot be upgraded. Upgrading this RPM will completely corrupt all of the CAVE
# rcp configuration information. So, a completely re-installation of this RPM and subsequently
# all of CAVE is required whenever an updated version of this RPM is released.
#
%define __prelink_undo_cmd %{nil}
# Turn off the brp-python-bytecompile script
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
@ -25,7 +30,6 @@ URL: N/A
License: N/A
Distribution: N/A
Vendor: Raytheon
Packager: Bryan Kowal
AutoReq: no
provides: %{_component_name}
@ -34,9 +38,9 @@ provides: awips2-base
requires: awips2-java
requires: awips2-python
requires: openmotif
requires: libMrm.so.4
requires: libXp.so.6
requires: libg2c.so.0
requires: libMrm.so.4()(64bit)
requires: libXp.so.6()(64bit)
requires: libg2c.so.0()(64bit)
%description
%{_component_desc}
@ -67,14 +71,6 @@ mkdir -p ${RPM_BUILD_ROOT}/awips2
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p ${RPM_BUILD_ROOT}/etc/xdg/autostart
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p ${RPM_BUILD_ROOT}/etc/profile.d
if [ $? -ne 0 ]; then
exit 1
fi
CAVE_DIST_DIR="%{_baseline_workspace}/rpms/awips2.cave/setup/dist"
@ -85,115 +81,22 @@ cd ${RPM_BUILD_ROOT}/awips2
unzip %{_component_zip_file_name}
rm -f %{_component_zip_file_name}
# Our profile.d scripts
PROFILE_D_DIR="%{_baseline_workspace}/rpms/common/environment/awips2-cave/profile.d"
cp ${PROFILE_D_DIR}/* ${RPM_BUILD_ROOT}/etc/profile.d
if [ $? -ne 0 ]; then
exit 1
fi
# The AWIPS II version script.
VERSIONS_SCRIPT="rpms/utility/scripts/versions.sh"
cp %{_baseline_workspace}/${VERSIONS_SCRIPT} ${RPM_BUILD_ROOT}/awips2/cave
if [ $? -ne 0 ]; then
exit 1
fi
# testWS script
TEXTWS_SCRIPT="rpms/utility/scripts/textWS.sh"
cp %{_baseline_workspace}/${TEXTWS_SCRIPT} ${RPM_BUILD_ROOT}/awips2/cave
if [ $? -ne 0 ]; then
exit 1
fi
# text-workstation autostart script.
CAVE_SCRIPTS_DIR="%{_baseline_workspace}/rpms/awips2.cave/Installer.cave/scripts"
TEXTWS_AUTO_SCRIPT="${CAVE_SCRIPTS_DIR}/autostart/awips2-textws.desktop"
cp -v ${TEXTWS_AUTO_SCRIPT} ${RPM_BUILD_ROOT}/etc/xdg/autostart
if [ $? -ne 0 ]; then
exit 1
fi
%pre
if [ "${1}" = "2" ]; then
# During an upgrade, we need to copy CAVE components that should not
# change without a complete re-install to a temporary location so that
# they are not overwritten. If we do not do this, CAVE will not recognize
# any of the features / plugins that have been installed after the upgrade.
# Create the CAVE backup directory
mkdir -p /awips2/cave.bak
# Ensure that the file directories that need to be backed up exist
if [ ! -f /awips2/cave/artifacts.xml ]; then
echo "ERROR: The cave artifacts.xml file does not exist."
echo " Your CAVE install is corrupted. Please re-install."
exit 1
fi
if [ ! -f /awips2/cave/cave ]; then
echo "ERROR: The cave executable does not exist."
echo " Your CAVE install is corrupted. Please re-install."
exit 1
fi
if [ ! -d /awips2/cave/configuration ]; then
echo "ERROR: The cave configuration directory does not exist."
echo " Your CAVE install is corrupted. Please re-install."
exit 1
fi
if [ ! -d /awips2/cave/features ]; then
echo "ERROR: The cave features directory does not exist."
echo " Your CAVE install is corrupted. Please re-install."
exit 1
fi
if [ ! -d /awips2/cave/p2 ]; then
echo "ERROR: The cave p2 directory does not exist."
echo " Your CAVE install is corrupted. Please re-install."
exit 1
fi
if [ ! -d /awips2/cave/plugins ]; then
echo "ERROR: The cave plugins directory does not exist."
echo " Your CAVE install is corrupted. Please re-install."
exit 1
fi
# Create the backups
mv /awips2/cave/artifacts.xml /awips2/cave.bak/
mv /awips2/cave/cave /awips2/cave.bak/
mv /awips2/cave/configuration /awips2/cave.bak/
mv /awips2/cave/features /awips2/cave.bak/
mv /awips2/cave/p2 /awips2/cave.bak/
mv /awips2/cave/plugins /awips2/cave.bak/
exit 0
echo "The %{_component_name} rpm cannot be upgraded. Re-install CAVE to update to a newer version of this RPM."
exit 1
fi
# /awips2/cave must not exist.
if [ -d /awips2/cave ]; then
# TODO: need to make CAVE RPMs do a better job of cleaning up files that they are
# responsible for.
echo -e "\e[1;31mERROR: the /awips2/cave directory already exists. /awips2/cave\e[m"
echo -e "\e[1;31m must be REMOVED before the installation will proceed.\e[m"
exit 1
fi
%post
# Remove the text-workstation autostart script if we have not been installed
# on an xt workstation
if [ ! "`hostname | cut -b 1-2`" = "xt" ]; then
rm -f /etc/xdg/autostart/awips2-textws.desktop
fi
MACHINE_BIT=`uname -i`
if [ "${MACHINE_BIT}" = "i386" ]
then
if [ -d /awips2/cave/lib/lib64 ]; then
rm -rf /awips2/cave/lib/lib64
fi
fi
# We need to create a link to the python shared library if it does not exist.
pushd . > /dev/null 2>&1
if [ -d /awips2/python/lib ]; then
@ -211,18 +114,7 @@ popd > /dev/null 2>&1
pushd . > /dev/null 2>&1
cd /awips2/cave/plugins
# Forcefully unzip: org.eclipse.swt.gtk.linux.x86_*.jar
# : if i386
if [ -f org.eclipse.swt.gtk.linux.x86_%{_swt_version}.jar ]; then
mkdir org.eclipse.swt.gtk.linux.x86_%{_swt_version}
unzip -qq org.eclipse.swt.gtk.linux.x86_%{_swt_version}.jar \
-d org.eclipse.swt.gtk.linux.x86_%{_swt_version}
rm -f org.eclipse.swt.gtk.linux.x86_%{_swt_version}.jar
mv org.eclipse.swt.gtk.linux.x86_%{_swt_version} \
org.eclipse.swt.gtk.linux.x86_%{_swt_version}.jar
fi
# Forcefully unzip: org.eclipse.swt.gtk.linux.x86_64_*.jar
# : if x86_64
if [ -f org.eclipse.swt.gtk.linux.x86_64_%{_swt_version}.jar ]; then
mkdir org.eclipse.swt.gtk.linux.x86_64_%{_swt_version}
unzip -qq org.eclipse.swt.gtk.linux.x86_64_%{_swt_version}.jar \
@ -233,7 +125,6 @@ if [ -f org.eclipse.swt.gtk.linux.x86_64_%{_swt_version}.jar ]; then
fi
# Forcefully unzip: org.eclipse.ui_*.jar
# : for i386 & x86_64
if [ -f org.eclipse.ui_%{_ui_version}.jar ]; then
mkdir org.eclipse.ui_%{_ui_version}
unzip -qq org.eclipse.ui_%{_ui_version}.jar \
@ -255,21 +146,6 @@ fi
popd > /dev/null 2>&1
if [ "${1}" = "2" ]; then
# Restore the backup.
# Remove the files that were just placed on the filesystem by the install.
rm -f /awips2/cave/artifacts.xml
rm -f /awips2/cave/cave
rm -rf /awips2/cave/configuration
rm -rf /awips2/cave/features
rm -rf /awips2/cave/p2
rm -rf /awips2/cave/plugins
mv /awips2/cave.bak/* /awips2/cave
rm -rf /awips2/cave.bak
fi
# determine if an installation of awips2-common-base is already present
# (edex has been installed before CAVE on an ADAM machine)
if [ -f /awips2/.cave/installCAVECommon.sh ]; then
@ -286,56 +162,12 @@ if [ -f /awips2/.cave/installCAVECommon.sh ]; then
fi
%preun
# Backup the core CAVE jar files so that they are
# not removed during the uninstallation of a previous
# version of CAVE during an upgrade.
if [ "${1}" = "1" ]; then
# This is an upgrade.
if [ -d /awips2/cave.bak ]; then
rm -rf /awips2/cave.bak
fi
mkdir -p /awips2/cave.bak/plugins
CAVE_APPLICATION_PLUGIN="com.raytheon.uf.viz.application_*.jar"
CAVE_PRODUCT_PLUGIN="com.raytheon.viz.product.awips_*.jar"
cp /awips2/cave/plugins/${CAVE_APPLICATION_PLUGIN} \
/awips2/cave.bak/plugins
cp /awips2/cave/plugins/${CAVE_PRODUCT_PLUGIN} \
/awips2/cave.bak/plugins
fi
%postun
# Restore the CAVE jar files that were backed-up if this
# is an upgrade.
if [ "${1}" = "1" ]; then
# This is an upgrade.
CAVE_APPLICATION_PLUGIN="com.raytheon.uf.viz.application_*.jar"
CAVE_PRODUCT_PLUGIN="com.raytheon.viz.product.awips_*.jar"
if [ ! -d /awips2/cave.bak/plugins ]; then
exit 0
fi
if [ -d /awips2/cave/plugins ]; then
mv /awips2/cave.bak/plugins/${CAVE_APPLICATION_PLUGIN} \
/awips2/cave/plugins
mv /awips2/cave.bak/plugins/${CAVE_PRODUCT_PLUGIN} \
/awips2/cave/plugins
fi
rm -rf /awips2/cave.bak
fi
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(644,root,root,-)
/etc/profile.d/awips2Cave.csh
/etc/profile.d/awips2Cave.sh
%defattr(644,awips,fxalpha,755)
%dir /awips2
%dir /awips2/cave
@ -344,7 +176,7 @@ rm -rf ${RPM_BUILD_ROOT}
/awips2/cave/about_files/*
%doc /awips2/cave/about.html
/awips2/cave/artifacts.xml
/awips2/cave/*.ini
/awips2/cave/cave.ini
%dir /awips2/cave/configuration
/awips2/cave/configuration/*
%doc /awips2/cave/epl-v10.html
@ -361,12 +193,5 @@ rm -rf ${RPM_BUILD_ROOT}
/awips2/cave/.eclipseproduct
%defattr(755,awips,fxalpha,755)
%dir /awips2/cave/caveEnvironment
/awips2/cave/caveEnvironment/*
/awips2/cave/cave
/awips2/cave/*.sh
/awips2/cave/*.so
%dir /awips2/cave/lib%{_build_bits}
/awips2/cave/lib%{_build_bits}/*
%attr(644,root,root) /etc/xdg/autostart/awips2-textws.desktop

View file

@ -113,34 +113,7 @@ fi
function buildRPM()
{
local COMPONENT_DIR=${1}
# if we are building a 64-bit version of CAVE, create a temporary
# component.spec.64 file for the build.
if [ ! "${TARGET_BUILD_ARCH}" = "x86_64" ]; then
local COMPONENT_SPECS=${COMPONENT_DIR}/component.spec
else
# Create an alternate component.spec file.
cp -v ${COMPONENT_DIR}/component.spec ${COMPONENT_DIR}/component.spec.64
if [ $? -ne 0 ]; then
exit 1
fi
# libraries to substitute: { libMrm.so.4, libXp.so.6, libg2c.so.0 }
perl -p -i -e "s/requires: libMrm.so.4/requires: libMrm.so.4()(64bit)/g" \
${COMPONENT_DIR}/component.spec.64
if [ $? -ne 0 ]; then
exit 1
fi
perl -p -i -e "s/requires: libXp.so.6/requires: libXp.so.6()(64bit)/g" \
${COMPONENT_DIR}/component.spec.64
if [ $? -ne 0 ]; then
exit 1
fi
perl -p -i -e "s/requires: libg2c.so.0/requires: libg2c.so.0()(64bit)/g" \
${COMPONENT_DIR}/component.spec.64
if [ $? -ne 0 ]; then
exit 1
fi
local COMPONENT_SPECS=${COMPONENT_DIR}/component.spec.64
fi
local COMPONENT_SPECS=${COMPONENT_DIR}/component.spec
if [ -d ${BUILDROOT_DIR} ]; then
rm -rf ${BUILDROOT_DIR}
@ -156,12 +129,7 @@ function buildRPM()
--define '_build_bits %(echo ${CAVE_BUILD_BITS})' \
--buildroot ${AWIPSII_BUILD_ROOT} ${COMPONENT_SPECS}
# If We Are Unable To Build An RPM, Fail The Build:
RC="$?"
if [ -f ${COMPONENT_DIR}/component.spec.64 ]; then
rm -fv ${COMPONENT_DIR}/component.spec.64
fi
if [ ! "${RC}" = "0" ]; then
if [ $? -ne 0 ]; then
exit 1
fi
}
@ -269,4 +237,5 @@ cd ../
# Only Build The RPMs That May Have Changed - AWIPS II-Specific Components.
buildRPM "Installer.cave"
buildRPM "Installer.cave-wrapper"
buildFeatureRPMs

View file

@ -46,15 +46,8 @@ if [ ${RC} -ne 0 ]; then
fi
# Copy the CAVE zip file to the awips2.cave dist directory.
CAVE_ZIP_NAME_32="CAVE-linux.gtk.x86.zip"
CAVE_ZIP_NAME_64="CAVE-linux.gtk.x86_64.zip"
CAVE_ZIP_LOC="cave/tmp/I.CAVE"
CAVE_ZIP="${CAVE_ZIP_LOC}/${CAVE_ZIP_NAME_32}"
if [ ! -f ${CAVE_ZIP} ]; then
echo "ERROR: ${CAVE_ZIP} does not exist."
exit 1
fi
cp -v ${CAVE_ZIP} ${CAVE_RPM_DIST_DIR}
CAVE_ZIP="${CAVE_ZIP_LOC}/${CAVE_ZIP_NAME_64}"
if [ ! -f ${CAVE_ZIP} ]; then
echo "ERROR: ${CAVE_ZIP} does not exist."