aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/build-packages.sh
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2020-02-11 08:54:33 +0100
committerAlberto Compagno <acompagn+fdio@cisco.com>2020-02-18 15:44:20 +0100
commit4590ae6202d7f3fbf932a57e4d9500ce5ac1e473 (patch)
tree57ec4de8d93fc899e45222d1f24f1d9b84c30d5f /scripts/build-packages.sh
parentfbe679d3c25a69ab6b238ebe896ba83e3c8ac6e4 (diff)
[HICN-510] Adding collectd plugins to get telemetry from vpp and hicn-plugin
Change-Id: Idb322dc712b52301c66c5256ad8d1a6a65b503b9 Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'scripts/build-packages.sh')
-rw-r--r--scripts/build-packages.sh26
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