Issue #2163 - 64-bit RHEL6 rpm conversion
- converted ant and added ant source to the repository (will no longer need to be retrieved from awipscm) - converted Java - converted the hdf5 tools and lzf is now built from source in addition to the hdf5 tools - fixed python h5py to correctly include the built libsz libraries Former-commit-id: ffc8892888976ee4b9d9edeb315b74edc5bb375f
This commit is contained in:
parent
be011d3b92
commit
e686f9bdda
6 changed files with 163 additions and 188 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
|
||||||
#
|
#
|
||||||
# AWIPS II Ant Spec File
|
# AWIPS II Ant Spec File
|
||||||
#
|
#
|
||||||
|
@ -6,7 +7,7 @@ Summary: AWIPS II Ant Distribution
|
||||||
Version: 1.7.1
|
Version: 1.7.1
|
||||||
Release: 2
|
Release: 2
|
||||||
Group: AWIPSII
|
Group: AWIPSII
|
||||||
BuildRoot: /tmp
|
BuildRoot: %{_build_root}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
Prefix: /awips2/ant
|
Prefix: /awips2/ant
|
||||||
URL: N/A
|
URL: N/A
|
||||||
|
@ -21,23 +22,17 @@ provides: awips2-ant
|
||||||
%description
|
%description
|
||||||
AWIPS II Ant Distribution - Contains Ant V1.7.1
|
AWIPS II Ant Distribution - Contains Ant V1.7.1
|
||||||
|
|
||||||
# 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')
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
# Verify That The User Has Specified A BuildRoot.
|
# Verify That The User Has Specified A BuildRoot.
|
||||||
if [ "${RPM_BUILD_ROOT}" = "/tmp" ]
|
if [ "%{_build_root}" = "" ]
|
||||||
then
|
then
|
||||||
echo "An Actual BuildRoot Must Be Specified. Use The --buildroot Parameter."
|
echo "A Build Root has not been specified."
|
||||||
echo "Unable To Continue ... Terminating"
|
echo "Unable To Continue ... Terminating"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p ${RPM_BUILD_ROOT}/awips2/ant
|
rm -rf %{_build_root}
|
||||||
mkdir -p ${RPM_BUILD_ROOT}/etc/profile.d
|
mkdir -p %{_build_root}
|
||||||
|
|
||||||
PROFILE_D_DIR="rpms/awips2.core/Installer.ant/scripts/profile.d"
|
|
||||||
cp %{_baseline_workspace}/${PROFILE_D_DIR}/* ${RPM_BUILD_ROOT}/etc/profile.d
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
|
@ -50,32 +45,39 @@ function copyLegal()
|
||||||
|
|
||||||
COMPONENT_BUILD_DIR=${1}
|
COMPONENT_BUILD_DIR=${1}
|
||||||
|
|
||||||
mkdir -p ${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
|
mkdir -p %{_build_root}/${COMPONENT_BUILD_DIR}/licenses
|
||||||
|
|
||||||
# Create a Tar file with our FOSS licenses.
|
# Create a Tar file with our FOSS licenses.
|
||||||
tar -cjf %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar \
|
tar -cjf %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar \
|
||||||
%{_baseline_workspace}/rpms/legal/FOSS_licenses/
|
%{_baseline_workspace}/rpms/legal/FOSS_licenses/
|
||||||
|
|
||||||
cp %{_baseline_workspace}/rpms/legal/license.txt \
|
cp %{_baseline_workspace}/rpms/legal/license.txt \
|
||||||
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
|
%{_build_root}/${COMPONENT_BUILD_DIR}/licenses
|
||||||
cp "%{_baseline_workspace}/rpms/legal/Master Rights File.pdf" \
|
cp "%{_baseline_workspace}/rpms/legal/Master Rights File.pdf" \
|
||||||
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
|
%{_build_root}/${COMPONENT_BUILD_DIR}/licenses
|
||||||
cp %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar \
|
cp %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar \
|
||||||
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
|
%{_build_root}/${COMPONENT_BUILD_DIR}/licenses
|
||||||
|
|
||||||
rm -f %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar
|
rm -f %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mkdir -p ${RPM_BUILD_ROOT}/awips2/ant
|
||||||
|
mkdir -p ${RPM_BUILD_ROOT}/etc/profile.d
|
||||||
|
|
||||||
|
_core_rpms="%{_baseline_workspace}/rpms/awips2.core"
|
||||||
|
_installer_ant="${_core_rpms}/Installer.ant"
|
||||||
ANT_TAR_FILE="apache-ant-1.7.1-bin.tar.gz"
|
ANT_TAR_FILE="apache-ant-1.7.1-bin.tar.gz"
|
||||||
ANT_TAR_FILE_SRC_DIR="CMLibrary/Software/OpenSource/Ant/v1.7.1"
|
|
||||||
|
|
||||||
# Will Be Extracted Into apache-ant-1.7.1
|
# Will Be Extracted Into apache-ant-1.7.1
|
||||||
tar -xf %{_awipscm_share}/${ANT_TAR_FILE_SRC_DIR}/${ANT_TAR_FILE} \
|
tar -xf ${_installer_ant}/src/${ANT_TAR_FILE} \
|
||||||
-C ${RPM_BUILD_ROOT}/awips2
|
-C %{_build_root}/awips2
|
||||||
# Move Files From 1.7.1 To The Generic Directory
|
# Move Files From 1.7.1 To The Generic Directory
|
||||||
cp -r ${RPM_BUILD_ROOT}/awips2/apache-ant-1.7.1/* \
|
cp -r %{_build_root}/awips2/apache-ant-1.7.1/* \
|
||||||
${RPM_BUILD_ROOT}/awips2/ant
|
%{_build_root}/awips2/ant
|
||||||
rm -rf ${RPM_BUILD_ROOT}/awips2/apache-ant-1.7.1
|
rm -rf %{_build_root}/awips2/apache-ant-1.7.1
|
||||||
|
|
||||||
|
PROFILE_D_DIR="rpms/awips2.core/Installer.ant/scripts/profile.d"
|
||||||
|
cp %{_baseline_workspace}/${PROFILE_D_DIR}/* %{_build_root}/etc/profile.d
|
||||||
|
|
||||||
copyLegal "awips2/ant"
|
copyLegal "awips2/ant"
|
||||||
|
|
||||||
|
@ -83,40 +85,16 @@ copyLegal "awips2/ant"
|
||||||
if [ "${1}" = "2" ]; then
|
if [ "${1}" = "2" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
|
|
||||||
echo -e "\e[1;34m\| Installing the AWIPS II Ant Distribution...\e[m"
|
|
||||||
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
|
|
||||||
echo -e "\e[1;34m Installation Root = ${RPM_INSTALL_PREFIX}\e[m"
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
function printFailureMessage()
|
|
||||||
{
|
|
||||||
echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m"
|
|
||||||
echo -e "\e[1;31m\| AWIPS II Ant Distribution Installation - FAILED\e[m"
|
|
||||||
echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m"
|
|
||||||
}
|
|
||||||
echo "--------------------------------------------------------------------------------"
|
|
||||||
echo "\| Setting up AWIPS II Ant Runtime and Environment..."
|
|
||||||
echo "--------------------------------------------------------------------------------"
|
|
||||||
|
|
||||||
echo "--------------------------------------------------------------------------------"
|
|
||||||
echo "\| Adding Environment Variables for AWIPS II Ant"
|
|
||||||
echo "--------------------------------------------------------------------------------"
|
|
||||||
|
|
||||||
if [ "${1}" = "2" ]; then
|
if [ "${1}" = "2" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo -e "\e[1;32m--------------------------------------------------------------------------------\e[m"
|
|
||||||
echo -e "\e[1;32m\| AWIPS II Ant Distribution Installation - COMPLETE\e[m"
|
|
||||||
echo -e "\e[1;32m--------------------------------------------------------------------------------\e[m"
|
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
if [ "${1}" = "1" ]; then
|
if [ "${1}" = "1" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
|
|
||||||
echo -e "\e[1;34m\| The AWIPS II Ant Distribution Has Been Successfully Removed\e[m"
|
|
||||||
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
|
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf ${RPM_BUILD_ROOT}
|
rm -rf ${RPM_BUILD_ROOT}
|
||||||
|
|
BIN
rpms/awips2.core/Installer.ant/src/apache-ant-1.7.1-bin.tar.gz
Normal file
BIN
rpms/awips2.core/Installer.ant/src/apache-ant-1.7.1-bin.tar.gz
Normal file
Binary file not shown.
|
@ -2,6 +2,7 @@
|
||||||
%define _java_major_version 1.6
|
%define _java_major_version 1.6
|
||||||
%define _java_version %{_java_major_version}.0_43
|
%define _java_version %{_java_major_version}.0_43
|
||||||
%define _build_arch %(uname -i)
|
%define _build_arch %(uname -i)
|
||||||
|
%define _java_build_loc %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
#
|
#
|
||||||
# AWIPS II Java 1.6 Spec File
|
# AWIPS II Java 1.6 Spec File
|
||||||
|
@ -40,18 +41,10 @@ if [ -d %{_build_root} ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
mkdir -p %{_build_root}/build-java
|
if [ -d %{_java_build_loc} ]; then
|
||||||
if [ $? -ne 0 ]; then
|
rm -rf %{_java_build_loc}
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
mkdir -p %{_build_root}/awips2/java
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
mkdir -p %{_build_root}/etc/profile.d
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
mkdir -p %{_java_build_loc}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
|
@ -93,7 +86,7 @@ JAVA_ARCH_SRC_DIR="${JAVA_SRC_DIR}/${arch_directory}"
|
||||||
|
|
||||||
pushd . > /dev/null
|
pushd . > /dev/null
|
||||||
cd ${JAVA_ARCH_SRC_DIR}
|
cd ${JAVA_ARCH_SRC_DIR}
|
||||||
/bin/cp -v ${jdk_bin} %{_build_root}/build-java
|
/bin/cp -v ${jdk_bin} %{_java_build_loc}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -102,25 +95,34 @@ popd > /dev/null
|
||||||
pushd . > /dev/null
|
pushd . > /dev/null
|
||||||
cd ${JAVA_COMMON_SRC_DIR}
|
cd ${JAVA_COMMON_SRC_DIR}
|
||||||
/usr/bin/patch -i ${jai_bin_patch} \
|
/usr/bin/patch -i ${jai_bin_patch} \
|
||||||
-o %{_build_root}/build-java/${jai_bin}
|
-o %{_java_build_loc}/${jai_bin}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
/usr/bin/patch -i ${jai_imageio_bin_patch} \
|
/usr/bin/patch -i ${jai_imageio_bin_patch} \
|
||||||
-o %{_build_root}/build-java/${jai_imageio_bin}
|
-o %{_java_build_loc}/${jai_imageio_bin}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
chmod a+x %{_build_root}/build-java/*.bin
|
mkdir -p %{_build_root}/awips2/java
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
mkdir -p %{_build_root}/etc/profile.d
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
chmod a+x %{_java_build_loc}/*.bin
|
||||||
pushd . > /dev/null
|
pushd . > /dev/null
|
||||||
cd %{_build_root}/awips2/java
|
cd %{_build_root}/awips2/java
|
||||||
# Used to automatically agree to software licenses.
|
# Used to automatically agree to software licenses.
|
||||||
touch yes.txt
|
touch yes.txt
|
||||||
echo "yes" > yes.txt
|
echo "yes" > yes.txt
|
||||||
|
|
||||||
%{_build_root}/build-java/${jdk_bin} -noregister
|
%{_java_build_loc}/${jdk_bin} -noregister
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -133,11 +135,11 @@ rm -rfv ${JDK_BIN_var_javahome}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
%{_build_root}/build-java/${jai_bin} < yes.txt
|
%{_java_build_loc}/${jai_bin} < yes.txt
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
%{_build_root}/build-java/${jai_imageio_bin} < yes.txt
|
%{_java_build_loc}/${jai_imageio_bin} < yes.txt
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -146,10 +148,6 @@ rm -fv yes.txt
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
rm -rf %{_build_root}/build-java
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
# Our profile.d scripts.
|
# Our profile.d scripts.
|
||||||
|
@ -189,6 +187,25 @@ if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
_files_to_update=( '/awips2/java/jre/lib/servicetag/registration.xml' \
|
||||||
|
'/awips2/java/register_zh_CN.html' \
|
||||||
|
'/awips2/java/register.html' \
|
||||||
|
'/awips2/java/register_ja.html' )
|
||||||
|
|
||||||
|
# update the java paths in a few files
|
||||||
|
for _file in ${_files_to_update[*]};
|
||||||
|
do
|
||||||
|
sed -e "s,%{_build_root}/awips2/java,/awips2/java," \
|
||||||
|
< %{_build_root}/${_file} > %{_build_root}/${_file}.new
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
mv %{_build_root}/${_file}.new %{_build_root}/${_file}
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
if [ "${1}" = "2" ]; then
|
if [ "${1}" = "2" ]; then
|
||||||
# Upgrade. Removing the existing /awips2/java/man
|
# Upgrade. Removing the existing /awips2/java/man
|
||||||
|
@ -208,6 +225,7 @@ fi
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf ${RPM_BUILD_ROOT}
|
rm -rf ${RPM_BUILD_ROOT}
|
||||||
|
rm -rf %{_java_build_loc}
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(644,awips,fxalpha,755)
|
%defattr(644,awips,fxalpha,755)
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
%define _java_major_version 1.7
|
%define _java_major_version 1.7
|
||||||
%define _java_version %{_java_major_version}.0_21
|
%define _java_version %{_java_major_version}.0_21
|
||||||
%define _build_arch %(uname -i)
|
%define _build_arch %(uname -i)
|
||||||
|
%define _java_build_loc %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
#
|
#
|
||||||
# AWIPS II Java 1.7 Spec File
|
# AWIPS II Java 1.7 Spec File
|
||||||
|
@ -40,18 +41,12 @@ if [ -d %{_build_root} ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
mkdir -p %{_build_root}/build-java
|
if [ -d %{_java_build_loc} ]; then
|
||||||
if [ $? -ne 0 ]; then
|
rm -rf %{_java_build_loc}
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
mkdir -p %{_build_root}/awips2/java
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
mkdir -p %{_build_root}/etc/profile.d
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
mkdir -p %{_java_build_loc}
|
||||||
|
|
||||||
|
%build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
build_arch=
|
build_arch=
|
||||||
|
@ -91,7 +86,7 @@ JAVA_ARCH_SRC_DIR="${JAVA_SRC_DIR}/${arch_directory}"
|
||||||
|
|
||||||
pushd . > /dev/null
|
pushd . > /dev/null
|
||||||
cd ${JAVA_ARCH_SRC_DIR}
|
cd ${JAVA_ARCH_SRC_DIR}
|
||||||
/bin/tar -xvf ${jdk_tar} -C %{_build_root}/build-java
|
/bin/tar -xvf ${jdk_tar} -C %{_java_build_loc}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -100,33 +95,42 @@ popd > /dev/null
|
||||||
pushd . > /dev/null
|
pushd . > /dev/null
|
||||||
cd ${JAVA_COMMON_SRC_DIR}
|
cd ${JAVA_COMMON_SRC_DIR}
|
||||||
/usr/bin/patch -i ${jai_bin_patch} \
|
/usr/bin/patch -i ${jai_bin_patch} \
|
||||||
-o %{_build_root}/build-java/${jai_bin}
|
-o %{_java_build_loc}/${jai_bin}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
/usr/bin/patch -i ${jai_imageio_bin_patch} \
|
/usr/bin/patch -i ${jai_imageio_bin_patch} \
|
||||||
-o %{_build_root}/build-java/${jai_imageio_bin}
|
-o %{_java_build_loc}/${jai_imageio_bin}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
chmod a+x %{_build_root}/build-java/*.bin
|
mkdir -p %{_build_root}/awips2/java
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
mkdir -p %{_build_root}/etc/profile.d
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
chmod a+x %{_java_build_loc}/*.bin
|
||||||
pushd . > /dev/null
|
pushd . > /dev/null
|
||||||
cd %{_build_root}/awips2/java
|
cd %{_build_root}/awips2/java
|
||||||
# Used to automatically agree to software licenses.
|
# Used to automatically agree to software licenses.
|
||||||
touch yes.txt
|
touch yes.txt
|
||||||
echo "yes" > yes.txt
|
echo "yes" > yes.txt
|
||||||
|
|
||||||
/bin/mv %{_build_root}/build-java/${JDK_BIN_var_javahome}/* .
|
/bin/mv %{_java_build_loc}/${JDK_BIN_var_javahome}/* .
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
%{_build_root}/build-java/${jai_bin} < yes.txt
|
%{_java_build_loc}/${jai_bin} < yes.txt
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
%{_build_root}/build-java/${jai_imageio_bin} < yes.txt
|
%{_java_build_loc}/${jai_imageio_bin} < yes.txt
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -135,10 +139,6 @@ rm -fv yes.txt
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
rm -rf %{_build_root}/build-java
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
# Our profile.d scripts.
|
# Our profile.d scripts.
|
||||||
|
@ -197,6 +197,7 @@ fi
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf ${RPM_BUILD_ROOT}
|
rm -rf ${RPM_BUILD_ROOT}
|
||||||
|
rm -rf %{_java_build_loc}
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(644,awips,fxalpha,755)
|
%defattr(644,awips,fxalpha,755)
|
||||||
|
|
|
@ -1,15 +1,19 @@
|
||||||
|
%define _build_arch %(uname -i)
|
||||||
|
%define _tools_build_loc %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
#
|
#
|
||||||
# AWIPS II Tools Spec File
|
# AWIPS II Tools Spec File
|
||||||
#
|
#
|
||||||
|
|
||||||
Name: awips2-tools
|
Name: awips2-tools
|
||||||
Summary: AWIPS II Tools Distribution
|
Summary: AWIPS II Tools Distribution
|
||||||
Version: 1.0.0
|
Version: 1.8.4
|
||||||
Release: 3
|
Release: 1.el6
|
||||||
Group: AWIPSII
|
Group: AWIPSII
|
||||||
|
BuildRequires: awips2-python-h5py
|
||||||
BuildRoot: /tmp
|
BuildRoot: /tmp
|
||||||
BuildArch: i386
|
BuildRoot: %{_build_root}
|
||||||
Prefix: /awips2/tools
|
BuildArch: %{_build_arch}
|
||||||
URL: N/A
|
URL: N/A
|
||||||
License: N/A
|
License: N/A
|
||||||
Distribution: N/A
|
Distribution: N/A
|
||||||
|
@ -25,31 +29,30 @@ the AWIPS II Tool-Set consists of various hdf5 utilities.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
# Verify That The User Has Specified A BuildRoot.
|
# Verify That The User Has Specified A BuildRoot.
|
||||||
if [ "${RPM_BUILD_ROOT}" = "/tmp" ]
|
if [ "%{_build_root}" = "" ]
|
||||||
then
|
then
|
||||||
echo "An Actual BuildRoot Must Be Specified. Use The --buildroot Parameter."
|
echo "An Actual BuildRoot Must Be Specified. Use The --buildroot Parameter."
|
||||||
echo "Unable To Continue ... Terminating"
|
echo "Unable To Continue ... Terminating"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p ${RPM_BUILD_ROOT}/awips2/tools
|
rm -rf %{_build_root}
|
||||||
# The temporary build location of hdf5
|
mkdir -p %{_build_root}
|
||||||
mkdir -p /tmp/awips2-hdf5/build
|
# The temporary build location of hdf5 and lzf
|
||||||
mkdir -p ${RPM_BUILD_ROOT}/etc/profile.d
|
if [ -d %{_tools_build_loc} ]; then
|
||||||
|
rm -rf %{_tools_build_loc}
|
||||||
|
fi
|
||||||
|
mkdir -p %{_tools_build_loc}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# Ensure that awips2-python has been installed
|
# Ensure that awips2-python has been installed
|
||||||
COMMAND=`rpm -q awips2-python`
|
COMMAND=`rpm -q awips2-python`
|
||||||
RC="$?"
|
if [ $? -ne 0 ]; then
|
||||||
if [ ! "${RC}" = "0" ]; then
|
|
||||||
echo "ERROR: awips2-python Must Be Installed."
|
echo "ERROR: awips2-python Must Be Installed."
|
||||||
echo "Unable To Continue ... Terminating."
|
echo "Unable To Continue ... Terminating."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PROFILE_D_DIR="rpms/awips2.core/Installer.tools/scripts/profile.d"
|
|
||||||
cp %{_baseline_workspace}/${PROFILE_D_DIR}/* ${RPM_BUILD_ROOT}/etc/profile.d
|
|
||||||
|
|
||||||
# Update LD_LIBRARY_PATH
|
# Update LD_LIBRARY_PATH
|
||||||
export LD_LIBRARY_PATH=/awips2/python/lib:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=/awips2/python/lib:$LD_LIBRARY_PATH
|
||||||
|
|
||||||
|
@ -58,46 +61,69 @@ HDF5_TAR_FILE="hdf5-1.8.4-patch1.tar.gz"
|
||||||
LZF_TAR_FILE="lzf.tar.gz"
|
LZF_TAR_FILE="lzf.tar.gz"
|
||||||
|
|
||||||
# Copy the hdf5 source tar files to our temporary build directory
|
# Copy the hdf5 source tar files to our temporary build directory
|
||||||
cp ${HDF5_SOURCE_DIR}/* /tmp/awips2-hdf5/build
|
cp ${HDF5_SOURCE_DIR}/* %{_tools_build_loc}
|
||||||
|
|
||||||
cd /tmp/awips2-hdf5/build
|
cd %{_tools_build_loc}
|
||||||
|
|
||||||
# Untar both tar files.
|
# Untar both tar files.
|
||||||
tar -xf ${HDF5_TAR_FILE}
|
tar -xf ${HDF5_TAR_FILE}
|
||||||
tar -xf ${LZF_TAR_FILE}
|
tar -xf ${LZF_TAR_FILE}
|
||||||
|
|
||||||
|
pushd . > /dev/null 2>&1
|
||||||
# Apply the patch.
|
# Apply the patch.
|
||||||
cd hdf5-1.8.4-patch1
|
cd hdf5-1.8.4-patch1
|
||||||
patch -p2 -i ../hdf5-1.8.4-patch1.patch0
|
patch -p2 -i ../hdf5-1.8.4-patch1.patch0
|
||||||
RC=$?
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export AM_LDFLAGS="-L/tmp/awips2-hdf5/build/lzf/lib"
|
export AM_CPPFLAGS="-I%{_tools_build_loc}/lzf/include"
|
||||||
export AM_CPPFLAGS="-I/tmp/awips2-hdf5/build/lzf/include"
|
|
||||||
export LIBS="-llzf_filter"
|
|
||||||
export LD_LIBRARY_PATH=/tmp/awips2-hdf5/build/lzf/lib:$LD_LIBRARY_PATH
|
|
||||||
|
|
||||||
./configure --prefix=${RPM_BUILD_ROOT}/awips2/tools
|
# run configure to generate the auto-generated hdf5 headers
|
||||||
RC="$?"
|
./configure --prefix=%{_build_root}/awips2/tools
|
||||||
if [ ! "${RC}" = "0" ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
popd > /dev/null 2>&1
|
||||||
|
|
||||||
|
pushd . > /dev/null 2>&1
|
||||||
|
# build lzf
|
||||||
|
cd lzf
|
||||||
|
gcc -O2 -I%{_tools_build_loc}/hdf5-1.8.4-patch1/src \
|
||||||
|
-fPIC -shared lzf/*.c lzf_filter.c \
|
||||||
|
-L /awips2/python/lib -lhdf5 \
|
||||||
|
-o liblzf_filter.so
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
popd > /dev/null
|
||||||
|
|
||||||
|
cd hdf5-1.8.4-patch1
|
||||||
|
export AM_LDFLAGS="-L%{_tools_build_loc}/lzf"
|
||||||
|
export LIBS="-llzf_filter"
|
||||||
|
export LD_LIBRARY_PATH=%{_tools_build_loc}/lzf:/awips2/python/lib
|
||||||
|
|
||||||
|
# re-configure to include the lzf_filter library that was built previously
|
||||||
|
./configure --prefix=/awips2/tools
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
make
|
make
|
||||||
RC="$?"
|
if [ $? -ne 0 ]; then
|
||||||
if [ ! "${RC}" = "0" ]; then
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%install
|
%install
|
||||||
cd /tmp/awips2-hdf5/build/hdf5-1.8.4-patch1
|
mkdir -p %{_build_root}/awips2/tools
|
||||||
make install
|
mkdir -p %{_build_root}/etc/profile.d
|
||||||
|
|
||||||
|
cd %{_tools_build_loc}/hdf5-1.8.4-patch1
|
||||||
|
make install prefix=%{_build_root}/awips2/tools
|
||||||
|
|
||||||
# Copy the lzf library to tools/lib
|
# Copy the lzf library to tools/lib
|
||||||
cp /tmp/awips2-hdf5/build/lzf/lib/* \
|
cp %{_tools_build_loc}/lzf/*.so \
|
||||||
${RPM_BUILD_ROOT}/awips2/tools/lib
|
%{_build_root}/awips2/tools/lib
|
||||||
|
|
||||||
# Copies the standard Raytheon licenses into a license directory for the
|
# Copies the standard Raytheon licenses into a license directory for the
|
||||||
# current component.
|
# current component.
|
||||||
|
@ -122,73 +148,20 @@ function copyLegal()
|
||||||
|
|
||||||
rm -f %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar
|
rm -f %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar
|
||||||
}
|
}
|
||||||
mkdir -p ${RPM_BUILD_ROOT}/awips2/tools/bin
|
|
||||||
mkdir -p ${RPM_BUILD_ROOT}/awips2/tools/include
|
PROFILE_D_DIR="rpms/awips2.core/Installer.tools/scripts/profile.d"
|
||||||
mkdir -p ${RPM_BUILD_ROOT}/awips2/tools/lib
|
cp %{_baseline_workspace}/${PROFILE_D_DIR}/* %{_build_root}/etc/profile.d
|
||||||
|
|
||||||
copyLegal "awips2/tools"
|
copyLegal "awips2/tools"
|
||||||
rm -rf /tmp/awips2-hdf5
|
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
if [ "${1}" = "2" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
|
|
||||||
echo -e "\e[1;34m\| Installing the AWIPS II Tools Distribution...\e[m"
|
|
||||||
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
|
|
||||||
echo -e "\e[1;34m Installation Root = ${RPM_INSTALL_PREFIX}\e[m"
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
function printFailureMessage()
|
|
||||||
{
|
|
||||||
echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m"
|
|
||||||
echo -e "\e[1;31m\| AWIPS II Tools Distribution Installation - FAILED\e[m"
|
|
||||||
echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m"
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "--------------------------------------------------------------------------------"
|
|
||||||
echo "\| Setting up AWIPS II Tools Runtime and Environment..."
|
|
||||||
echo "--------------------------------------------------------------------------------"
|
|
||||||
|
|
||||||
#echo "--------------------------------------------------------------------------------"
|
|
||||||
#echo "\| Adding Environment Variables for AWIPS II Tools"
|
|
||||||
#echo "--------------------------------------------------------------------------------"
|
|
||||||
|
|
||||||
if [ "${1}" = "2" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "\e[1;32m--------------------------------------------------------------------------------\e[m"
|
|
||||||
echo -e "\e[1;32m\| AWIPS II Tools Distribution Installation - COMPLETE\e[m"
|
|
||||||
echo -e "\e[1;32m--------------------------------------------------------------------------------\e[m"
|
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
if [ "${1}" = "1" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
if [ "${1}" = "1" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
# Remove The profile.d Script If One Was Created.
|
|
||||||
|
|
||||||
AWIPS2_TOOLS_SH="/etc/profile.d/awips2Tools.sh"
|
|
||||||
if [ -f ${AWIPS2_TOOLS_SH} ]; then
|
|
||||||
rm -f ${AWIPS2_TOOLS_SH}
|
|
||||||
fi
|
|
||||||
|
|
||||||
AWIPS2_TOOLS_CSH="/etc/profile.d/awips2Tools.csh"
|
|
||||||
if [ -f ${AWIPS2_TOOLS_CSH} ]; then
|
|
||||||
rm -f ${AWIPS2_TOOLS_CSH}
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
|
|
||||||
echo -e "\e[1;34m\| The AWIPS II Tools Distribution Has Been Successfully Removed\e[m"
|
|
||||||
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
|
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf ${RPM_BUILD_ROOT}
|
rm -rf ${RPM_BUILD_ROOT}
|
||||||
|
rm -rf %{_tools_build_loc}
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(644,awips,fxalpha,755)
|
%defattr(644,awips,fxalpha,755)
|
||||||
|
|
|
@ -132,20 +132,11 @@ make
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
cp -P src/.libs/libsz.so* \
|
|
||||||
%{_build_root}/awips2/python/lib
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
cd ..
|
cd ..
|
||||||
/bin/rm -f ${SZIP_TAR}
|
/bin/rm -f ${SZIP_TAR}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
/bin/rm -rf szip-2.1
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
|
@ -165,6 +156,20 @@ export LD_LIBRARY_PATH=/awips2/python/lib
|
||||||
--prefix=/awips2/python
|
--prefix=/awips2/python
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
|
pushd . > /dev/null
|
||||||
|
cd %{_python_build_loc}/szip-2.1
|
||||||
|
cp -P src/.libs/libsz.so* \
|
||||||
|
%{_build_root}/awips2/python/lib
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
cd ..
|
||||||
|
/bin/rm -rf szip-2.1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
popd > /dev/null
|
||||||
|
|
||||||
rm -rf ${HDF5_PATH}
|
rm -rf ${HDF5_PATH}
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
|
|
Loading…
Add table
Reference in a new issue