diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/build-packages.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh index 216099f3c..35741495f 100644 --- a/scripts/build-packages.sh +++ b/scripts/build-packages.sh @@ -178,6 +178,29 @@ setup() { c++ --version } + +install_collectd_headers() { + if [ -f /etc/os-release ]; then + . /etc/os-release + else + echo "ERROR: System configuration not recognized. Build failed" + exit -1 + fi + + if [ "${DISTRIB_ID}" == "ubuntu" ]; then + sudo apt-get install collectd-dev -y --allow-unauthenticated + + if [ "${VERSION_CODENAME}" == "xenial" ]; then + awk '/config.h/ { print; print "#include \"collectd/liboconfig/oconfig.h\""; next }1' /usr/include/collectd/core/daemon/configfile.h | sudo tee /usr/include/collectd/core/daemon/configfile.h + fi + elif [ "${DISTRIB_ID}" == "centos" ]; then + wget https://storage.googleapis.com/collectd-tarballs/collectd-5.9.2.tar.bz2 + tar -xf collectd-5.9.2.tar.bz2 + cd collectd-5.9.2 && ./configure && make && cd - + export COLLECTD_HOME=${PWD}/collectd-5.9.2/src + fi +} + # Parameters: # $1 = Package name # @@ -197,12 +220,15 @@ build_package() { rm -rf libtransport ctrl/libhicnctrl + install_collectd_headers + cmake -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_HICNPLUGIN=ON \ -DBUILD_LIBTRANSPORT=ON \ -DBUILD_APPS=ON \ -DBUILD_HICNLIGHT=OFF \ -DBUILD_SYSREPOPLUGIN=ON \ + -DBUILD_TELEMETRY=ON \ ${SCRIPT_PATH}/.. make VERBOSE=1 -j8 package |