@cryptotaxi247 / netdata-1 / commits / a1b1ee2f2

Add handling of libmosquitto to binary packages. (#8085)

This adds code to handle bundling our custom fork of libmosquitto into our binary packages. It pulls down the required sources, builds them, and copies the build artifacts into the right place so that the build of Netdata actually uses them.

Austin S. Hemmelgarn committed Feb 14, 2020 at 07:45 UTC a1b1ee2f2cd68b168825bb54ec0b8654af703054
3 files changed +16
contrib/debian/rules
+1
@@ -18,6 +18,7 @@ TEMPTOP = $(CURDIR)/debian/tmp
18 #dh $@ --with autoreconf
19
20 override_dh_auto_configure:
21 + packaging/bundle-mosquitto.sh .
22 autoreconf -ivf
23 dh_auto_configure -- --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib \
24 --libexecdir=/usr/libexec --with-user=netdata --with-math --with-zlib --with-webdir=/var/lib/netdata/www
netdata.spec.in
+3
@@ -229,6 +229,7 @@ happened, on your systems and applications.
229
230 %prep
231 %setup -q -n %{name}-%{version}
232 +${RPM_BUILD_DIR}/packaging/bundle-mosquitto.sh ${RPM_BUILD_DIR}
233
234 %build
235 # Conf step
@@ -517,6 +518,8 @@ are sensor monitoring, system event monitoring, power control, and serial-over-L
518 %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
519
520 %changelog
521 +* Thu Feb 13 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-13
522 +- Add handling for custom libmosquitto fork
523 * Wed Jan 01 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-12
524 - Add explicit installation of log and cache directories
525 - Clean up build dependencies.
packaging/bundle-mosquitto.sh new
+12
@@ -0,0 +1,12 @@
1 +#!/bin/sh
2 +
3 +MOSQUITTO_TARBALL="$(cat "${1}/packaging/mosquitto.version").tar.gz"
4 +MOSQUITTO_BUILD_PATH="${1}/externaldeps/mosquitto/mosquitto-$(cat "${1}/packaging/mosquitto.version")/lib"
5 +
6 +mkdir -p "${1}/externaldeps/mosquitto" || exit 1
7 +curl -sSL --connect-timeout 10 --retry 3 "https://github.com/netdata/mosquitto/archive/${MOSQUITTO_TARBALL}" > "${MOSQUITTO_TARBALL}" || exit 1
8 +sha256sum -c "${1}/packaging/mosquitto.checksums" || exit 1
9 +tar -xzf "${MOSQUITTO_TARBALL}" -C "${1}/externaldeps/mosquitto" || exit 1
10 +make -C "${MOSQUITTO_BUILD_PATH}" || exit 1
11 +cp -a "${MOSQUITTO_BUILD_PATH}/libmosquitto.a" "${1}/externaldeps/mosquitto" || exit 1
12 +cp -a "${MOSQUITTO_BUILD_PATH}/mosquitto.h" "${1}/externaldeps/mosquitto" || exit 1