Update build scripts & files
This commit is contained in:
parent
5de5f4404f
commit
8afe2e3383
@ -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_files>
|
||||
# build/<platform>/<build_files>
|
||||
# build/build_hpux_depots.sh
|
||||
# sources/bin/<hc_scripts>
|
||||
# sources/lib/*/<hc_plugins>
|
||||
# opt/hc/bin/<hc_scripts>
|
||||
# opt/hc/lib/*/<hc_plugins>
|
||||
# etc/opt/hc/<hc_configs>
|
||||
# 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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -16,14 +16,15 @@
|
||||
|
||||
#******************************************************************************
|
||||
# Requires following build (dir) structures:
|
||||
#
|
||||
#
|
||||
# hc_build_linux_rpms.sh
|
||||
# BUILD/
|
||||
# BUILDROOT/
|
||||
# RPMS/
|
||||
# SOURCES/
|
||||
# SOURCES/bin/<hc_scripts>
|
||||
# SOURCES/lib/*/<hc_plugins>
|
||||
# opt/
|
||||
# opt/hc/bin/<hc_scripts>
|
||||
# opt/hc/lib/*/<hc_plugins>
|
||||
# etc/opt/hc/<hc_configs>
|
||||
# SPECS/<spec_files>
|
||||
# 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
|
||||
#******************************************************************************
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user