From d1898937e0e6e99573d0dcf881ccb0d4d9278953 Mon Sep 17 00:00:00 2001 From: Bryan Kowal Date: Thu, 3 Jul 2014 11:26:53 -0500 Subject: [PATCH] Omaha #3339 - created a method to build non-EDEX and non-CAVE RPMs contributed by Work Assignments. Former-commit-id: 98a310f4a77b47c5a1161484d08c24757f3b20ca [formerly 98a310f4a77b47c5a1161484d08c24757f3b20ca [formerly e0bb64fc5112a15d9d991eb8f39de42b541f4e54]] Former-commit-id: 6a197f845dc701555af46d189e5dc8d51df99ef6 Former-commit-id: 0fdfc0fd4aaff78a908e6a34ccbad20c984340f1 --- rpms/build/x86_64/WA_rpm_build.sh | 44 +++++++++++++++++++++++++++++++ rpms/build/x86_64/build.sh | 24 ++++++++++++++--- 2 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 rpms/build/x86_64/WA_rpm_build.sh diff --git a/rpms/build/x86_64/WA_rpm_build.sh b/rpms/build/x86_64/WA_rpm_build.sh new file mode 100644 index 0000000000..65d1f42c5f --- /dev/null +++ b/rpms/build/x86_64/WA_rpm_build.sh @@ -0,0 +1,44 @@ +function WA_rpm_build() +{ + echo "Scanning the Baseline for WA-Contributed RPMs ..." + + files=(${WORKSPACE}/rpms-*) + if [ ! -d "${files[0]}" ]; then + echo "No WA-Contributed RPMs were found!" + return + fi + + wa_contrib_count=`ls -1d ${WORKSPACE}/rpms-* | wc -l` + + echo "Found ${wa_contrib_count} WA-Contributed RPMs." + for rpm_contribution in `ls -1d ${WORKSPACE}/rpms-*`; do + echo "Processing WA-Contributed RPMs ... ${rpm_contribution}" + + _build_dir="${rpm_contribution}/build" + _lookup_script="${_build_dir}/lookupWA_RPM.sh" + _contribution_txt="${_build_dir}/wa-rpms.txt" + + source "${_lookup_script}" + if [ $? -ne 0 ]; then + echo "ERROR: unable to access the expected WA lookup script - ${_lookup_script}" + exit 1 + fi + + if [ ! -f "${_contribution_txt}" ]; then + echo "ERROR: unable to access the expected contribution text - ${_contribution_txt}" + exit 1 + fi + + for contribution in `cat ${_contribution_txt}`; do + lookupWA_RPM "${contribution}" "${rpm_contribution}" + if [ $? -ne 0 ]; then + echo "ERROR: '${contribution}' is not a recognized AWIPS II RPM." + exit 1 + fi + + buildRPMExec "${RPM_SPECIFICATION}" + done + + return 0 + done +} \ No newline at end of file diff --git a/rpms/build/x86_64/build.sh b/rpms/build/x86_64/build.sh index b3552ea1e7..7e8deee57c 100644 --- a/rpms/build/x86_64/build.sh +++ b/rpms/build/x86_64/build.sh @@ -10,6 +10,16 @@ function buildRPM() exit 1 fi + buildRPMExec "${RPM_SPECIFICATION}" + + return 0 +} + +function buildRPMExec() +{ + # Arguments: + # 1) specs file location + /usr/bin/rpmbuild -ba \ --define '_topdir %(echo ${AWIPSII_TOP_DIR})' \ --define '_baseline_workspace %(echo ${WORKSPACE})' \ @@ -22,13 +32,11 @@ function buildRPM() --define '_component_build_time %(echo ${COMPONENT_BUILD_TIME})' \ --define '_component_build_system %(echo ${COMPONENT_BUILD_SYSTEM})' \ --buildroot ${AWIPSII_BUILD_ROOT} \ - ${RPM_SPECIFICATION}/component.spec + ${1}/component.spec if [ $? -ne 0 ]; then echo "ERROR: Failed to build RPM ${1}." exit 1 fi - - return 0 } # This script will build all of the 64-bit rpms. @@ -78,6 +86,11 @@ if [ $? -ne 0 ]; then exit 1 fi +source ${dir}/WA_rpm_build.sh +if [ $? -ne 0 ]; then + echo "WARNING: Unable to find the WA-RPM Build Contributions." +fi + export LIGHTNING=true # Determine if the optional '-nobinlightning' argument has been specified. if [ "${2}" = "-nobinlightning" ]; then @@ -99,6 +112,11 @@ if [ "${1}" = "-buildRPM" -a -n "${2}" ]; then exit 0 fi +if [ "${1}" = "-WA" ]; then + WA_rpm_build + exit 0 +fi + if [ "${1}" = "-64bit" ]; then buildCAVE if [ $? -ne 0 ]; then