Просмотр исходного кода

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 5 лет назад
Родитель
Сommit
a1b1ee2f2c
3 измененных файлов с 16 добавлено и 0 удалено
  1. 1 0
      contrib/debian/rules
  2. 3 0
      netdata.spec.in
  3. 12 0
      packaging/bundle-mosquitto.sh

+ 1 - 0
contrib/debian/rules

@@ -18,6 +18,7 @@ TEMPTOP = $(CURDIR)/debian/tmp
 	#dh $@ --with autoreconf
 	#dh $@ --with autoreconf
 
 
 override_dh_auto_configure:
 override_dh_auto_configure:
+	packaging/bundle-mosquitto.sh .
 	autoreconf -ivf
 	autoreconf -ivf
 	dh_auto_configure -- --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib \
 	dh_auto_configure -- --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib \
 	--libexecdir=/usr/libexec --with-user=netdata --with-math --with-zlib --with-webdir=/var/lib/netdata/www
 	--libexecdir=/usr/libexec --with-user=netdata --with-math --with-zlib --with-webdir=/var/lib/netdata/www

+ 3 - 0
netdata.spec.in

@@ -229,6 +229,7 @@ happened, on your systems and applications.
 
 
 %prep
 %prep
 %setup -q -n %{name}-%{version}
 %setup -q -n %{name}-%{version}
+${RPM_BUILD_DIR}/packaging/bundle-mosquitto.sh ${RPM_BUILD_DIR}
 
 
 %build
 %build
 # Conf step
 # Conf step
@@ -517,6 +518,8 @@ are sensor monitoring, system event monitoring, power control, and serial-over-L
 %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
 %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
 
 
 %changelog
 %changelog
+* Thu Feb 13 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-13
+- Add handling for custom libmosquitto fork
 * Wed Jan 01 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-12
 * Wed Jan 01 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-12
 - Add explicit installation of log and cache directories
 - Add explicit installation of log and cache directories
 - Clean up build dependencies.
 - Clean up build dependencies.

+ 12 - 0
packaging/bundle-mosquitto.sh

@@ -0,0 +1,12 @@
+#!/bin/sh
+
+MOSQUITTO_TARBALL="$(cat "${1}/packaging/mosquitto.version").tar.gz"
+MOSQUITTO_BUILD_PATH="${1}/externaldeps/mosquitto/mosquitto-$(cat "${1}/packaging/mosquitto.version")/lib"
+
+mkdir -p "${1}/externaldeps/mosquitto" || exit 1
+curl -sSL --connect-timeout 10 --retry 3 "https://github.com/netdata/mosquitto/archive/${MOSQUITTO_TARBALL}" > "${MOSQUITTO_TARBALL}" || exit 1
+sha256sum -c "${1}/packaging/mosquitto.checksums" || exit 1
+tar -xzf "${MOSQUITTO_TARBALL}" -C "${1}/externaldeps/mosquitto" || exit 1
+make -C "${MOSQUITTO_BUILD_PATH}" || exit 1
+cp -a "${MOSQUITTO_BUILD_PATH}/libmosquitto.a" "${1}/externaldeps/mosquitto" || exit 1
+cp -a "${MOSQUITTO_BUILD_PATH}/mosquitto.h" "${1}/externaldeps/mosquitto" || exit 1