Added code to bundle LWS in binary packages. (#8255)

* Added code to bundle LWS in binary packages.

This adds the required tode to bundle a custom build of libwebsockets as
required by Netdata Cloud functionality into the binary packages.

* Update packaging/bundle-lws.sh

Co-Authored-By: James Mills <prologic@shortcircuit.net.au>

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
This commit is contained in:
Austin S. Hemmelgarn 2020-03-09 07:38:05 -04:00 committed by GitHub
parent f473c176ec
commit 83a50413a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 26 additions and 0 deletions

View File

@ -17,6 +17,7 @@ Build-Depends: debhelper (>= 9),
libsnappy-dev,
libprotobuf-dev,
libprotoc-dev,
cmake,
autogen,
autoconf,
automake,

View File

@ -17,6 +17,7 @@ Build-Depends: debhelper (>= 9),
libsnappy-dev,
libprotobuf-dev,
libprotoc-dev,
cmake,
autogen,
autoconf,
automake,

View File

@ -16,6 +16,7 @@ Build-Depends: debhelper (>= 9),
libsnappy-dev,
libprotobuf-dev,
libprotoc-dev,
cmake,
autogen,
autoconf,
automake,

View File

@ -16,6 +16,7 @@ Build-Depends: debhelper (>= 9),
libsnappy-dev,
libprotobuf-dev,
libprotoc-dev,
cmake,
autogen,
autoconf,
automake,

View File

@ -3,6 +3,7 @@ Build-Depends: debhelper (>= 9),
dh-autoreconf,
pkg-config,
dpkg-dev (>= 1.13.19),
cmake,
zlib1g-dev,
uuid-dev
Section: net

View File

@ -17,6 +17,7 @@ Build-Depends: debhelper (>= 9),
libsnappy-dev,
libprotobuf-dev,
libprotoc-dev,
cmake,
autogen,
autoconf,
automake,

View File

@ -19,6 +19,7 @@ TEMPTOP = $(CURDIR)/debian/tmp
override_dh_auto_configure:
packaging/bundle-mosquitto.sh .
packaging/bundle-lws.sh .
autoreconf -ivf
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

View File

@ -109,6 +109,7 @@ BuildRequires: autoconf-archive
BuildRequires: autogen
%endif
BuildRequires: automake
BuildRequires: cmake
BuildRequires: pkgconfig
BuildRequires: curl
BuildRequires: findutils
@ -233,6 +234,7 @@ happened, on your systems and applications.
%prep
%setup -q -n %{name}-%{version}
${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-mosquitto.sh ${RPM_BUILD_DIR}/%{name}-%{version}
${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-lws.sh ${RPM_BUILD_DIR}/%{name}-%{version}
%build
# Conf step

17
packaging/bundle-lws.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
startdir="${PWD}"
LWS_TARBALL="v$(cat "${1}/packaging/libwebsockets.version").tar.gz"
LWS_BUILD_PATH="${1}/externaldeps/libwebsockets/libwebsockets-$(cat "${1}/packaging/libwebsockets.version")"
mkdir -p "${1}/externaldeps/libwebsockets" || exit 1
curl -sSL --connect-timeout 10 --retry 3 "https://github.com/warmcat/libwebsockets/archive/${LWS_TARBALL}" > "${LWS_TARBALL}" || exit 1
sha256sum -c "${1}/packaging/libwebsockets.checksums" || exit 1
tar -xzf "${LWS_TARBALL}" -C "${1}/externaldeps/libwebsockets" || exit 1
cd "${LWS_BUILD_PATH}" || exit 1
cmake -D LWS_WITH_SOCKS5:boolean=YES . || exit 1
make || exit 1
cd "${startdir}" || exit 1
cp -a "${LWS_BUILD_PATH}/lib/libwebsockets.a" "${1}/externaldeps/libwebsockets" || exit 1
cp -a "${LWS_BUILD_PATH}/include" "${1}/externaldeps/libwebsockets" || exit 1