diff --git a/build/hpux/build_hpux_depots.sh b/build/hpux/build_hpux_depots.sh index 88064e7..330759e 100644 --- a/build/hpux/build_hpux_depots.sh +++ b/build/hpux/build_hpux_depots.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env ksh +#!/usr/bin/env ksh #****************************************************************************** # @(#) build script for HC SD packages (uses 'swpackage') #****************************************************************************** @@ -17,10 +17,11 @@ #****************************************************************************** # Requires following build (dir) structures: # -# build/ +# build// # build/build_hpux_depots.sh -# sources/bin/ -# sources/lib/*/ +# opt/hc/bin/ +# opt/hc/lib/*/ +# etc/opt/hc/ # depots/ # # Build order: @@ -36,80 +37,76 @@ BUILD_PRETTY_DATE="$(date +'%Y.%m.%d')" BUILD_DIR="$(dirname $0)" # clean up previous packages -rm -f ${BUILD_DIR}/depots/* >/dev/null +if [[ -d ../../depots ]] +then + rm -f ../../depots/* 2>/dev/null +else + mkdir -p ../../depots 2>/dev/null +fi # see if we have BUILD_DATE placeholder in PSF files -find ${BUILD_DIR} -name "*.psf" | while read FILE +find ${BUILD_DIR} -name "*.psf" | while read FILE do - if (( $(grep -c '%BUILD_DATE%' ${FILE}) == 0 )) - then - print -u2 "ERROR: no %BUILD_DATE% placeholder in ${FILE}!" - exit 1 - fi + if (( $(grep -c '%BUILD_DATE%' ${FILE}) == 0 )) + then + print -u2 "ERROR: no %BUILD_DATE% placeholder in ${FILE}!" + exit 1 + fi done -# replace BUILD_DATE placeholder in PSF files -find ${BUILD_DIR} -name "*.psf" | while read FILE +# replace BUILD_DATE placeholder in PSF files +find ${BUILD_DIR} -name "*.psf" | while read FILE do - perl -pi -e "s/%BUILD_DATE%/${BUILD_PRETTY_DATE}/g" ${FILE} + perl -pi -e "s/%BUILD_DATE%/${BUILD_PRETTY_DATE}/g" ${FILE} done # build hc_hpux package -cd ${BUILD_DIR}/hc_hpux/ -swpackage -s hc_hpux.psf -x media_type=tape -d ../../depots/hc_hpux-${BUILD_DATE}.sd -swpackage -s hc_hpux.psf @ /var/opt/depot/kudos -cd - +cd ${BUILD_DIR}/hc_hpux/ || exit 1 +swpackage -s hc_hpux.psf -x media_type=tape -d ../../../depots/hc_hpux-${BUILD_DATE}.sd +cd - || exit 1 # build hc_hpux_platform package -cd ${BUILD_DIR}/hc_hpux_platform -swpackage -s hc_hpux_platform.psf -x media_type=tape -d ../../depots/hc_hpux_platform-${BUILD_DATE}.sd -swpackage -s hc_hpux_platform.psf @ /var/opt/depot/kudos -cd - +cd ${BUILD_DIR}/hc_hpux_platform || exit 1 +swpackage -s hc_hpux_platform.psf -x media_type=tape -d ../../../depots/hc_hpux_platform-${BUILD_DATE}.sd +cd - || exit 1 # build hc_display_csv package -cd ${BUILD_DIR}/hc_display_csv -swpackage -s hc_display_csv.psf -x media_type=tape -d ../../depots/hc_display_csv-${BUILD_DATE}.sd -swpackage -s hc_display_csv.psf @ /var/opt/depot/kudos -cd - +cd ${BUILD_DIR}/hc_display_csv || exit 1 +swpackage -s hc_display_csv.psf -x media_type=tape -d ../../../depots/hc_display_csv-${BUILD_DATE}.sd +cd - || exit 1 # build hc_display_init package -cd ${BUILD_DIR}/hc_display_init -swpackage -s hc_display_init.psf -x media_type=tape -d ../../depots/hc_display_init-${BUILD_DATE}.sd -swpackage -s hc_display_init.psf @ /var/opt/depot/kudos -cd - +cd ${BUILD_DIR}/hc_display_init || exit 1 +swpackage -s hc_display_init.psf -x media_type=tape -d ../../../depots/hc_display_init-${BUILD_DATE}.sd +cd - || exit 1 # build hc_display_json package -cd ${BUILD_DIR}/hc_display_json -swpackage -s hc_display_json.psf -x media_type=tape -d ../../depots/hc_display_json-${BUILD_DATE}.sd -swpackage -s hc_display_json.psf @ /var/opt/depot/kudos -cd - +cd ${BUILD_DIR}/hc_display_json || exit 1 +swpackage -s hc_display_json.psf -x media_type=tape -d ../../../depots/hc_display_json-${BUILD_DATE}.sd +cd - || exit 1 # build hc_display_terse package -cd ${BUILD_DIR}/hc_display_terse -swpackage -s hc_display_terse.psf -x media_type=tape -d ../../depots/hc_display_terse-${BUILD_DATE}.sd -swpackage -s hc_display_terse.psf @ /var/opt/depot/kudos -cd - +cd ${BUILD_DIR}/hc_display_terse || exit 1 +swpackage -s hc_display_terse.psf -x media_type=tape -d ../../../depots/hc_display_terse-${BUILD_DATE}.sd +cd - || exit 1 # build hc_display_zenoss package -cd ${BUILD_DIR}/hc_display_zenoss -swpackage -s hc_display_zenoss.psf -x media_type=tape -d ../../depots/hc_display_zenoss-${BUILD_DATE}.sd -swpackage -s hc_display_zenoss.psf @ /var/opt/depot/kudos -cd - +cd ${BUILD_DIR}/hc_display_zenoss || exit 1 +swpackage -s hc_display_zenoss.psf -x media_type=tape -d ../../../depots/hc_display_zenoss-${BUILD_DATE}.sd +cd - || exit 1 # build hc_notify_sms package -cd ${BUILD_DIR}/hc_notify_sms -swpackage -s hc_notify_sms.psf -x media_type=tape -d ../../depots/hc_notify_sms-${BUILD_DATE}.sd -swpackage -s hc_notify_sms.psf @ /var/opt/depot/kudos -cd - +cd ${BUILD_DIR}/hc_notify_sms || exit 1 +swpackage -s hc_notify_sms.psf -x media_type=tape -d ../../../depots/hc_notify_sms-${BUILD_DATE}.sd +cd - || exit 1 # build hc_notify_eif package -cd ${BUILD_DIR}/hc_notify_eif -swpackage -s hc_notify_eif.psf -x media_type=tape -d ../../depots/hc_notify_eif-${BUILD_DATE}.sd -swpackage -s hc_notify_eif.psf @ /var/opt/depot/kudos -cd - +cd ${BUILD_DIR}/hc_notify_eif || exit 1 +swpackage -s hc_notify_eif.psf -x media_type=tape -d ../../../depots/hc_notify_eif-${BUILD_DATE}.sd +cd - || exit 1 print "List of built packages:" -ls -l ${BUILD_DIR}/../depots/* +ls -l ../../depots/* # when installed on an ignite server: possible addition of depot registration here diff --git a/build/hpux/hc_display_csv/hc_display_csv.psf b/build/hpux/hc_display_csv/hc_display_csv.psf index 36ac0a3..3e30cf7 100644 --- a/build/hpux/hc_display_csv/hc_display_csv.psf +++ b/build/hpux/hc_display_csv/hc_display_csv.psf @@ -58,7 +58,7 @@ This is the core CSV display plugin package" file_permissions -u 0222 -o root -g sys - directory ../../opt/hc/lib/core=/opt/hc/lib/core + directory ../../../opt/hc/lib/core=/opt/hc/lib/core file -m 755 display_csv.sh end end diff --git a/build/hpux/hc_display_init/hc_display_init.psf b/build/hpux/hc_display_init/hc_display_init.psf index 5964a88..e310059 100644 --- a/build/hpux/hc_display_init/hc_display_init.psf +++ b/build/hpux/hc_display_init/hc_display_init.psf @@ -58,7 +58,7 @@ This is the core INIT display plugin package" file_permissions -u 0222 -o root -g sys - directory ../../opt/hc/lib/core=/opt/hc/lib/core + directory ../../../opt/hc/lib/core=/opt/hc/lib/core file -m 755 display_init.sh end end diff --git a/build/hpux/hc_display_json/hc_display_json.psf b/build/hpux/hc_display_json/hc_display_json.psf index 29f873b..5867d35 100644 --- a/build/hpux/hc_display_json/hc_display_json.psf +++ b/build/hpux/hc_display_json/hc_display_json.psf @@ -58,7 +58,7 @@ This is the core JSON display plugin package" file_permissions -u 0222 -o root -g sys - directory ../../opt/hc/lib/core=/opt/hc/lib/core + directory ../../../opt/hc/lib/core=/opt/hc/lib/core file -m 755 display_json.sh end end diff --git a/build/hpux/hc_display_terse/hc_display_terse.psf b/build/hpux/hc_display_terse/hc_display_terse.psf index cefda54..44289fd 100644 --- a/build/hpux/hc_display_terse/hc_display_terse.psf +++ b/build/hpux/hc_display_terse/hc_display_terse.psf @@ -58,7 +58,7 @@ This is the core TERSE display plugin package" file_permissions -u 0222 -o root -g sys - directory ../../opt/hc/lib/core=/opt/hc/lib/core + directory ../../../opt/hc/lib/core=/opt/hc/lib/core file -m 755 display_terse.sh end end diff --git a/build/hpux/hc_display_zenoss/hc_display_zenoss.psf b/build/hpux/hc_display_zenoss/hc_display_zenoss.psf index 6374399..df026ef 100644 --- a/build/hpux/hc_display_zenoss/hc_display_zenoss.psf +++ b/build/hpux/hc_display_zenoss/hc_display_zenoss.psf @@ -58,7 +58,7 @@ This is the core ZENOSS display plugin package" file_permissions -u 0222 -o root -g sys - directory ../../opt/hc/lib/core=/opt/hc/lib/core + directory ../../../opt/hc/lib/core=/opt/hc/lib/core file -m 755 display_zenoss.sh end end diff --git a/build/hpux/hc_hpux/hc_hpux.psf b/build/hpux/hc_hpux/hc_hpux.psf index f219099..74aeabb 100644 --- a/build/hpux/hc_hpux/hc_hpux.psf +++ b/build/hpux/hc_hpux/hc_hpux.psf @@ -56,9 +56,9 @@ system mounts, process checks, file consistency etc." file_permissions -u 0222 -o root -g sys - directory ../../opt/hc/bin=/opt/hc/bin + directory ../../../opt/hc/bin=/opt/hc/bin file -m 755 check_health.sh - directory ../../opt/hc/lib/core=/opt/hc/lib/core + directory ../../../opt/hc/lib/core=/opt/hc/lib/core file -m 755 include_core.sh file -m 755 include_data.sh file -m 755 include_os.sh @@ -75,7 +75,7 @@ system mounts, process checks, file consistency etc." file_permissions -u 0222 -o root -g sys - directory ../../opt/hc/lib/core=/opt/hc/lib/core + directory ../../../opt/hc/lib/core=/opt/hc/lib/core file -m 755 notify_mail.sh file -m 755 report_std.sh end @@ -92,9 +92,9 @@ system mounts, process checks, file consistency etc." file_permissions -u 0222 -o root -g sys - directory ../../etc/opt/hc/core=/etc/opt/hc/core + directory ../../../etc/opt/hc/core=/etc/opt/hc/core file -m 644 check_health.conf.dist - directory ../../etc/opt/hc=/etc/opt/hc + directory ../../../etc/opt/hc=/etc/opt/hc file -m 644 check_host.conf.dist end @@ -110,7 +110,7 @@ system mounts, process checks, file consistency etc." file_permissions -u 0222 -o root -g sys - directory ../../etc/opt/hc/core/templates=/etc/opt/hc/core/templates + directory ../../../etc/opt/hc/core/templates=/etc/opt/hc/core/templates file -m 644 mail_info.tpl file -m 644 mail_header.tpl file -m 644 mail_body.tpl diff --git a/build/hpux/hc_hpux_platform/hc_hpux_platform.psf b/build/hpux/hc_hpux_platform/hc_hpux_platform.psf index 5759cb2..70c67e0 100644 --- a/build/hpux/hc_hpux_platform/hc_hpux_platform.psf +++ b/build/hpux/hc_hpux_platform/hc_hpux_platform.psf @@ -58,7 +58,7 @@ This is the OS/platform plugin package" file_permissions -u 0222 -o root -g sys - directory ../../opt/hc/lib/platform/hp-ux=/opt/hc/lib/platform/hp-ux + directory ../../../opt/hc/lib/platform/hp-ux=/opt/hc/lib/platform/hp-ux file -m 755 check_hpux_autopath.sh file -m 755 check_hpux_cdsf_cluster.sh file -m 755 check_hpux_cron_status.sh @@ -106,7 +106,7 @@ This is the OS/platform plugin package" file_permissions -u 0222 -o root -g sys - directory ../../etc/opt/hc/=/etc/opt/hc + directory ../../../etc/opt/hc/=/etc/opt/hc file -m 644 check_hpux_drd_status.conf.dist file -m 644 check_hpux_file_age.conf.dist file -m 644 check_hpux_file_change.conf.dist @@ -141,7 +141,7 @@ This is the OS/platform plugin package" file_permissions -u 0222 -o root -g sys - directory ../../etc/opt/hc/core/templates=/etc/opt/hc/core/templates + directory ../../../etc/opt/hc/core/templates=/etc/opt/hc/core/templates file -m 644 mail_body.tpl-check_hpux_fs_mounts_options file -m 644 mail_body.tpl-check_hpux_ioscan file -m 644 mail_body.tpl-check_hpux_ovpa_status diff --git a/build/hpux/hc_notify_eif/hc_notify_eif.psf b/build/hpux/hc_notify_eif/hc_notify_eif.psf index d517271..1610ecf 100644 --- a/build/hpux/hc_notify_eif/hc_notify_eif.psf +++ b/build/hpux/hc_notify_eif/hc_notify_eif.psf @@ -58,7 +58,7 @@ This is the core EIF plugin package" file_permissions -u 0222 -o root -g sys - directory ../../opt/hc/lib/core=/opt/hc/lib/core + directory ../../../opt/hc/lib/core=/opt/hc/lib/core file -m 755 notify_eif.sh end @@ -74,7 +74,7 @@ This is the core EIF plugin package" file_permissions -u 0222 -o root -g sys - directory ../../etc/opt/hc/core/providers=/etc/opt/hc/core/providers + directory ../../../etc/opt/hc/core/providers=/etc/opt/hc/core/providers file -m 644 notify_eif.conf.dist end end diff --git a/build/hpux/hc_notify_sms/hc_notify_sms.psf b/build/hpux/hc_notify_sms/hc_notify_sms.psf index 2704f44..817f884 100644 --- a/build/hpux/hc_notify_sms/hc_notify_sms.psf +++ b/build/hpux/hc_notify_sms/hc_notify_sms.psf @@ -58,7 +58,7 @@ This is the core SMS plugin package" file_permissions -u 0222 -o root -g sys - directory ../../opt/hc/lib/core=/opt/hc/lib/core + directory ../../../opt/hc/lib/core=/opt/hc/lib/core file -m 755 notify_sms.sh end @@ -74,7 +74,7 @@ This is the core SMS plugin package" file_permissions -u 0222 -o root -g sys - directory ../../etc/opt/hc/core/providers=/etc/opt/hc/core/providers + directory ../../../etc/opt/hc/core/providers=/etc/opt/hc/core/providers file -m 644 notify_sms.conf.dist end end diff --git a/build/linux/hc_build_linux_rpms.sh b/build/linux/hc_build_linux_rpms.sh index 48fb9d0..067a900 100644 --- a/build/linux/hc_build_linux_rpms.sh +++ b/build/linux/hc_build_linux_rpms.sh @@ -16,14 +16,15 @@ #****************************************************************************** # Requires following build (dir) structures: -# +# # hc_build_linux_rpms.sh # BUILD/ # BUILDROOT/ # RPMS/ -# SOURCES/ -# SOURCES/bin/ -# SOURCES/lib/*/ +# opt/ +# opt/hc/bin/ +# opt/hc/lib/*/ +# etc/opt/hc/ # SPECS/ # SRPMS/ # @@ -40,8 +41,8 @@ BUILD_DIR="$(dirname $0)" rm -f ${BUILD_DIR}/RPMS/*/* >/dev/null # build main packages -rpmbuild -bb ${BUILD_DIR}/SPECS/hc-linux.spec -rpmbuild -bb ${BUILD_DIR}/SPECS/hc-linux-platform.spec +rpmbuild -bb ${BUILD_DIR}/SPECS/hc-linux.spec +rpmbuild -bb ${BUILD_DIR}/SPECS/hc-linux-platform.spec # build core plugins rpmbuild -bb ${BUILD_DIR}/SPECS/hc-notify-eif.spec @@ -60,5 +61,3 @@ exit 0 #****************************************************************************** # END of script #****************************************************************************** - -