check_health/build/linux/build_linux_rpms.sh
2017-09-02 23:27:01 +02:00

63 lines
2.2 KiB
Bash

#!/usr/bin/env ksh
#******************************************************************************
# @(#) build script for HC RPM packages (uses 'rpmbuild')
#******************************************************************************
# @(#) Copyright (C) 2014 by KUDOS BVBA (info@kudos.be). All rights reserved.
#
# This program is a free software; you can redistribute it and/or modify
# it under the same terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
#******************************************************************************
#******************************************************************************
# Requires following build (dir) structures:
#
# build_linux_rpms.sh
# BUILD/
# BUILDROOT/
# RPMS/
# SOURCES/
# SOURCES/bin/<hc_scripts>
# SOURCES/lib/*/<hc_plugins>
# SPECS/<spec_files>
# SRPMS/
#
# Build order:
# 1) Copy sources/scrips to the correct locations
# 2) Copy template, build and installer script files into correct locations
# 3) Execute build_linux_rpms.sh
# 4) RPM packages may be found in the RPMS directory
#******************************************************************************
BUILD_DIR="$(dirname $0)"
# clean up previous packages
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
# build core plugins
rpmbuild -bb ${BUILD_DIR}/SPECS/hc-notify-eif.spec
rpmbuild -bb ${BUILD_DIR}/SPECS/hc-notify-sms.spec
rpmbuild -bb ${BUILD_DIR}/SPECS/hc-display-init.spec
rpmbuild -bb ${BUILD_DIR}/SPECS/hc-display-csv.spec
rpmbuild -bb ${BUILD_DIR}/SPECS/hc-display-terse.spec
print "List of built packages:"
ls -l ${BUILD_DIR}/RPMS/*/*
exit 0
#******************************************************************************
# END of script
#******************************************************************************