Issue #2047 - initial commit of Java 1.7; rpm build can build both Java 6 and Java 7
- Amend: update 32-bit rpm build script Change-Id: I23fae3f39e7fedb00b46fffb3aa1540dd87ed6b6 Former-commit-id:a78c84dcd7
[formerly b68957a08d64f697b373bb017e28ee5fa186ed82] Former-commit-id:203d886739
This commit is contained in:
parent
dd5b0c4caf
commit
f63c05e5cf
23 changed files with 335 additions and 9 deletions
|
@ -1,9 +1,10 @@
|
|||
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g')
|
||||
%define _java_version 1.6.0_43
|
||||
%define _java_major_version 1.6
|
||||
%define _java_version %{_java_major_version}.0_43
|
||||
%define _build_arch %(uname -i)
|
||||
|
||||
#
|
||||
# AWIPS II Java Spec File
|
||||
# AWIPS II Java 1.6 Spec File
|
||||
#
|
||||
Name: awips2-java
|
||||
Summary: AWIPS II Java Distribution
|
||||
|
@ -83,8 +84,11 @@ pydev_cert="pydev_certificate.cer"
|
|||
|
||||
# locate the java src.
|
||||
CORE_PROJECT_DIR="%{_baseline_workspace}/rpms/awips2.core"
|
||||
JAVA_SRC_DIR="${CORE_PROJECT_DIR}/Installer.java/src"
|
||||
JAVA_SCRIPTS_DIR="${CORE_PROJECT_DIR}/Installer.java/scripts"
|
||||
INSTALLER_JAVA="${CORE_PROJECT_DIR}/Installer.java"
|
||||
JAVA_SRC_DIR="${INSTALLER_JAVA}/%{_java_major_version}/src"
|
||||
JAVA_COMMON_DIR="${INSTALLER_JAVA}/common"
|
||||
JAVA_SCRIPTS_DIR="${JAVA_COMMON_DIR}/scripts"
|
||||
JAVA_COMMON_SRC_DIR="${JAVA_COMMON_DIR}/src/${arch_directory}"
|
||||
JAVA_ARCH_SRC_DIR="${JAVA_SRC_DIR}/${arch_directory}"
|
||||
|
||||
pushd . > /dev/null
|
||||
|
@ -93,6 +97,10 @@ cd ${JAVA_ARCH_SRC_DIR}
|
|||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
popd > /dev/null
|
||||
|
||||
pushd . > /dev/null
|
||||
cd ${JAVA_COMMON_SRC_DIR}
|
||||
/usr/bin/patch -i ${jai_bin_patch} \
|
||||
-o %{_build_root}/build-java/${jai_bin}
|
||||
if [ $? -ne 0 ]; then
|
||||
|
@ -103,8 +111,10 @@ fi
|
|||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
popd > /dev/null
|
||||
|
||||
chmod a+x %{_build_root}/build-java/*.bin
|
||||
pushd . > /dev/null
|
||||
cd %{_build_root}/awips2/java
|
||||
# Used to automatically agree to software licenses.
|
||||
touch yes.txt
|
||||
|
@ -150,7 +160,7 @@ if [ $? -ne 0 ]; then
|
|||
fi
|
||||
|
||||
# The pydev certificate.
|
||||
cp -v ${JAVA_SRC_DIR}/${pydev_cert} \
|
||||
cp -v ${JAVA_COMMON_DIR}/src/${pydev_cert} \
|
||||
%{_build_root}/awips2/java/jre/lib/security
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
258
rpms/awips2.core/Installer.java/1.7/component.spec
Normal file
258
rpms/awips2.core/Installer.java/1.7/component.spec
Normal file
|
@ -0,0 +1,258 @@
|
|||
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g')
|
||||
%define _java_major_version 1.7
|
||||
%define _java_version %{_java_major_version}.0_21
|
||||
%define _build_arch %(uname -i)
|
||||
|
||||
#
|
||||
# AWIPS II Java 1.7 Spec File
|
||||
#
|
||||
Name: awips2-java
|
||||
Summary: AWIPS II Java Distribution
|
||||
Version: %{_java_version}
|
||||
Release: 1
|
||||
Group: AWIPSII
|
||||
BuildRoot: %{_build_root}
|
||||
BuildArch: %{_build_arch}
|
||||
URL: N/A
|
||||
License: N/A
|
||||
Distribution: N/A
|
||||
Vendor: Raytheon
|
||||
Packager: Bryan Kowal
|
||||
|
||||
AutoReq: no
|
||||
provides: awips2-java
|
||||
|
||||
%description
|
||||
AWIPS II Java Distribution - Contains Java SE Development Kit (JDK) 1.7.0_21
|
||||
plus additional libraries used by AWIPS II.
|
||||
|
||||
%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}
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
mkdir -p %{_build_root}/build-java
|
||||
if [ $? -ne 0 ]; then
|
||||
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
|
||||
|
||||
%install
|
||||
build_arch=
|
||||
arch_directory=
|
||||
# determine the architecture based on the system architecture.
|
||||
if [ "%{_build_arch}" = "x86_64" ]; then
|
||||
build_arch="amd64"
|
||||
arch_directory="x86_64"
|
||||
jdk_arch="x64"
|
||||
else
|
||||
if [ "%{_build_arch}" = "i386" ]; then
|
||||
build_arch="i586"
|
||||
arch_directory="i386"
|
||||
jdk_arch=${build_arch}
|
||||
else
|
||||
echo "ERROR: Unrecognized architecture '%{_build_arch}."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
JDK_BIN_var_javahome="jdk%{_java_version}"
|
||||
jdk_tar="jdk-7u21-linux-${jdk_arch}.tar.gz"
|
||||
jai_bin="jai-1_1_3-lib-linux-${build_arch}-jdk.bin"
|
||||
jai_imageio_bin="jai_imageio-1_1-lib-linux-${build_arch}-jdk.bin"
|
||||
jai_bin_patch="jai.patch1"
|
||||
jai_imageio_bin_patch="jai_imageio.patch1"
|
||||
pydev_cert="pydev_certificate.cer"
|
||||
|
||||
# locate the java src.
|
||||
CORE_PROJECT_DIR="%{_baseline_workspace}/rpms/awips2.core"
|
||||
INSTALLER_JAVA="${CORE_PROJECT_DIR}/Installer.java"
|
||||
JAVA_SRC_DIR="${INSTALLER_JAVA}/%{_java_major_version}/src"
|
||||
JAVA_COMMON_DIR="${INSTALLER_JAVA}/common"
|
||||
JAVA_SCRIPTS_DIR="${JAVA_COMMON_DIR}/scripts"
|
||||
JAVA_COMMON_SRC_DIR="${JAVA_COMMON_DIR}/src/${arch_directory}"
|
||||
JAVA_ARCH_SRC_DIR="${JAVA_SRC_DIR}/${arch_directory}"
|
||||
|
||||
pushd . > /dev/null
|
||||
cd ${JAVA_ARCH_SRC_DIR}
|
||||
/bin/tar -xvf ${jdk_tar} -C %{_build_root}/build-java
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
popd > /dev/null
|
||||
|
||||
pushd . > /dev/null
|
||||
cd ${JAVA_COMMON_SRC_DIR}
|
||||
/usr/bin/patch -i ${jai_bin_patch} \
|
||||
-o %{_build_root}/build-java/${jai_bin}
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
/usr/bin/patch -i ${jai_imageio_bin_patch} \
|
||||
-o %{_build_root}/build-java/${jai_imageio_bin}
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
popd > /dev/null
|
||||
|
||||
chmod a+x %{_build_root}/build-java/*.bin
|
||||
pushd . > /dev/null
|
||||
cd %{_build_root}/awips2/java
|
||||
# Used to automatically agree to software licenses.
|
||||
touch yes.txt
|
||||
echo "yes" > yes.txt
|
||||
|
||||
/bin/mv %{_build_root}/build-java/${JDK_BIN_var_javahome}/* .
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
%{_build_root}/build-java/${jai_bin} < yes.txt
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
%{_build_root}/build-java/${jai_imageio_bin} < yes.txt
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -fv yes.txt
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
rm -rf %{_build_root}/build-java
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
popd > /dev/null
|
||||
|
||||
# Our profile.d scripts.
|
||||
JAVA_PROFILED_DIR="${JAVA_SCRIPTS_DIR}/profile.d"
|
||||
cp -v ${JAVA_PROFILED_DIR}/* %{_build_root}/etc/profile.d
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The pydev certificate.
|
||||
cp -v ${JAVA_COMMON_DIR}/src/${pydev_cert} \
|
||||
%{_build_root}/awips2/java/jre/lib/security
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
touch changeit.txt
|
||||
echo "changeit" > changeit.txt
|
||||
chmod 666 %{_build_root}/awips2/java/jre/lib/security/cacerts
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
%{_build_root}/awips2/java/bin/keytool -import \
|
||||
-file %{_build_root}/awips2/java/jre/lib/security/pydev_certificate.cer \
|
||||
-keystore %{_build_root}/awips2/java/jre/lib/security/cacerts \
|
||||
-noprompt < changeit.txt
|
||||
rm -fv changeit.txt
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The licenses
|
||||
mkdir -p %{_build_root}/awips2/java/licenses
|
||||
LEGAL_DIR="%{_baseline_workspace}/rpms/legal"
|
||||
cp -v ${LEGAL_DIR}/*.txt ${LEGAL_DIR}/*.pdf \
|
||||
%{_build_root}/awips2/java/licenses
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%pre
|
||||
if [ "${1}" = "2" ]; then
|
||||
# Upgrade. Removing the existing /awips2/java/man
|
||||
# directory to prevent conflicts.
|
||||
if [ -d /awips2/java/man ]; then
|
||||
rm -rf /awips2/java/man
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: The awips2-java upgrade has FAILED."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
%post
|
||||
%preun
|
||||
%postun
|
||||
|
||||
%clean
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
%files
|
||||
%defattr(644,awips,fxalpha,755)
|
||||
%attr(755,root,root) /etc/profile.d/awips2Java.csh
|
||||
%attr(755,root,root) /etc/profile.d/awips2Java.sh
|
||||
%dir /awips2/java
|
||||
%dir /awips2/java/bin
|
||||
|
||||
%doc /awips2/java/COPYRIGHT
|
||||
%doc /awips2/java/COPYRIGHT-jai_imageio.txt
|
||||
%doc /awips2/java/COPYRIGHT-jai.txt
|
||||
%doc /awips2/java/DISTRIBUTIONREADME-jai_imageio.txt
|
||||
%doc /awips2/java/DISTRIBUTIONREADME-jai.txt
|
||||
%doc /awips2/java/ENTITLEMENT-jai_imageio.txt
|
||||
%doc /awips2/java/jre/README
|
||||
%doc /awips2/java/jre/THIRDPARTYLICENSEREADME.txt
|
||||
%doc /awips2/java/jre/Welcome.html
|
||||
%doc /awips2/java/jre/LICENSE
|
||||
%doc /awips2/java/LICENSE
|
||||
%doc /awips2/java/LICENSE-jai_imageio.txt
|
||||
%doc /awips2/java/LICENSE-jai.txt
|
||||
%docdir /awips2/java/licenses
|
||||
%dir /awips2/java/licenses
|
||||
/awips2/java/licenses/*
|
||||
%docdir /awips2/java/man
|
||||
%dir /awips2/java/man
|
||||
/awips2/java/man/*
|
||||
%doc /awips2/java/README.html
|
||||
%doc /awips2/java/THIRDPARTYLICENSEREADME-jai_imageio.txt
|
||||
%doc /awips2/java/THIRDPARTYLICENSEREADME-jai.txt
|
||||
%doc /awips2/java/THIRDPARTYLICENSEREADME.txt
|
||||
%doc /awips2/java/THIRDPARTYLICENSEREADME-JAVAFX.txt
|
||||
%doc /awips2/java/jre/THIRDPARTYLICENSEREADME-JAVAFX.txt
|
||||
%doc /awips2/java/release
|
||||
%doc /awips2/java/UNINSTALL-jai
|
||||
%doc /awips2/java/UNINSTALL-jai_imageio
|
||||
%doc /awips2/java/jre/COPYRIGHT
|
||||
|
||||
%dir /awips2/java/db
|
||||
/awips2/java/db/*
|
||||
%dir /awips2/java/include
|
||||
/awips2/java/include/*
|
||||
%dir /awips2/java/jre
|
||||
#/awips2/java/jre/.systemPrefs/.systemRootModFile
|
||||
%dir /awips2/java/jre/bin
|
||||
|
||||
%dir /awips2/java/jre/lib
|
||||
|
||||
%dir /awips2/java/jre/plugin
|
||||
/awips2/java/jre/plugin/*
|
||||
%dir /awips2/java/lib
|
||||
|
||||
/awips2/java/src.zip
|
||||
|
||||
%defattr(755,awips,fxalpha,755)
|
||||
/awips2/java/bin/*
|
||||
/awips2/java/lib/*
|
||||
/awips2/java/jre/bin/*
|
||||
/awips2/java/jre/lib/*
|
|
@ -0,0 +1 @@
|
|||
477152cd94fb4504db57eb5fbc368d89e0b937b5
|
|
@ -0,0 +1 @@
|
|||
c05e925e3c2e541e5ebf596d165d56a979d511a9
|
43
rpms/awips2.core/Installer.java/build.sh
Normal file
43
rpms/awips2.core/Installer.java/build.sh
Normal file
|
@ -0,0 +1,43 @@
|
|||
# verify that the workspace, rpm top directory, and build root are available in the environment
|
||||
|
||||
if [ -z ${WORKSPACE} ]; then
|
||||
echo "Error: the location of the baseline workspace must be specified using the WORKSPACE environment variable."
|
||||
exit 1
|
||||
fi
|
||||
if [ -z ${AWIPSII_TOP_DIR} ]; then
|
||||
echo "Error: the location of the rpm top directory must be specified using the AWIPSII_TOP_DIR environment variable."
|
||||
exit 1
|
||||
fi
|
||||
if [ -z ${AWIPSII_BUILD_ROOT} ]; then
|
||||
echo "Error: the location of the AWIPS II build root must be specified using the AWIPSII_BUILD_ROOT environment variable."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function buildRPM()
|
||||
{
|
||||
SPECS=${1}
|
||||
|
||||
/usr/bin/rpmbuild -ba \
|
||||
--define "_topdir ${AWIPSII_TOP_DIR}" \
|
||||
--define "_build_root ${AWIPSII_BUILD_ROOT}" \
|
||||
--define "_baseline_workspace ${WORKSPACE}" \
|
||||
--buildroot ${AWIPSII_BUILD_ROOT} \
|
||||
${SPECS}
|
||||
if [ $? -ne 0 ]; then
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# build java 1.6
|
||||
SPECS=1.6/component.spec
|
||||
buildRPM ${SPECS}
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# build java 1.7
|
||||
SPECS=1.7/component.spec
|
||||
buildRPM ${SPECS}
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
|
@ -1,5 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
function buildJava()
|
||||
{
|
||||
pushd . > /dev/null 2>&1
|
||||
|
||||
cd ${WORKSPACE}/rpms/awips2.core/Installer.java
|
||||
/bin/bash build.sh
|
||||
if [ $? -ne 0 ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
popd > /dev/null 2>&1
|
||||
}
|
||||
|
||||
function buildQPID()
|
||||
{
|
||||
# Arguments:
|
||||
|
|
|
@ -254,7 +254,7 @@ if [ "${1}" = "-full" ]; then
|
|||
exit 1
|
||||
fi
|
||||
buildRPM "awips2-httpd-pypies"
|
||||
buildRPM "awips2-java"
|
||||
buildJava
|
||||
buildRPM "awips2-groovy"
|
||||
#buildRPM "awips2-ldm"
|
||||
buildRPM "awips2-postgres"
|
||||
|
@ -270,7 +270,7 @@ fi
|
|||
|
||||
if [ "${1}" = "-ade" ]; then
|
||||
buildRPM "awips2-eclipse"
|
||||
buildRPM "awips2-java"
|
||||
buildJava
|
||||
buildRPM "awips2-ant"
|
||||
buildRPM "awips2-python"
|
||||
buildRPM "awips2-python-cherrypy"
|
||||
|
|
|
@ -114,7 +114,7 @@ if [ "${1}" = "-64bit" ]; then
|
|||
buildRPM "awips2-python-werkzeug"
|
||||
buildRPM "awips2-python-pygtk"
|
||||
buildRPM "awips2-python-pycairo"
|
||||
buildRPM "awips2-java"
|
||||
buildJava
|
||||
buildRPM "awips2"
|
||||
buildRPM "awips2-python-shapely"
|
||||
buildRPM "awips2-notification"
|
||||
|
@ -210,7 +210,7 @@ if [ "${1}" = "-full" ]; then
|
|||
exit 1
|
||||
fi
|
||||
buildRPM "awips2-httpd-pypies"
|
||||
buildRPM "awips2-java"
|
||||
buildJava
|
||||
buildRPM "awips2-groovy"
|
||||
buildLocalizationRPMs
|
||||
if [ $? -ne 0 ]; then
|
||||
|
|
Loading…
Add table
Reference in a new issue