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