@cryptotaxi247 / netdata-1 / commits / c1b023226

reproducible build system (#4294)

- Move `m4` dir to `build/m4` to clean TLD - create `build/build.sh` script which builds netdata in docker container - create `build/Dockerfile` which creates reproducible build environment - exclude `.lgtm.yml` from final package - use `.tar.gz` package in `netdata.spec.in` as `*.xz` and `*.bz2` will be removed due to #3913 What it does is simple, you don't need any libraries installed on host to build netdata as they are provided inside a container.

Paweł Krupa committed Sep 26, 2018 at 12:46 UTC c1b02322653f8474c6dc077f33f016d68f54406b
17 files changed +49 -16
Makefile.am
+17 -14
@@ -2,8 +2,8 @@
2 # Copyright (C) 2015 Alon Bar-Lev <alon.barlev@gmail.com>
3 # SPDX-License-Identifier: GPL-3.0+
4 #
5 -AUTOMAKE_OPTIONS=foreign dist-bzip2 dist-xz 1.10
6 -ACLOCAL_AMFLAGS = -I m4
5 +AUTOMAKE_OPTIONS=foreign 1.10
6 +ACLOCAL_AMFLAGS = -I build/m4
7
8 MAINTAINERCLEANFILES= \
9 config.log config.status \
@@ -24,19 +24,22 @@ EXTRA_DIST = \
24 .csslintrc \
25 .eslintignore \
26 .eslintrc \
27 + .lgtm.yml \
28 .travis \
28 - m4/jemalloc.m4 \
29 - m4/ax_c___atomic.m4 \
30 - m4/ax_check_enable_debug.m4 \
31 - m4/ax_c_mallinfo.m4 \
32 - m4/ax_gcc_func_attribute.m4 \
33 - m4/ax_check_compile_flag.m4 \
34 - m4/ax_c_statement_expressions.m4 \
35 - m4/ax_pthread.m4 \
36 - m4/ax_c_lto.m4 \
37 - m4/ax_c_mallopt.m4 \
38 - m4/tcmalloc.m4 \
39 - m4/ax_c__generic.m4 \
29 + build/build.sh
30 + build/Dockerfile
31 + build/m4/jemalloc.m4 \
32 + build/m4/ax_c___atomic.m4 \
33 + build/m4/ax_check_enable_debug.m4 \
34 + build/m4/ax_c_mallinfo.m4 \
35 + build/m4/ax_gcc_func_attribute.m4 \
36 + build/m4/ax_check_compile_flag.m4 \
37 + build/m4/ax_c_statement_expressions.m4 \
38 + build/m4/ax_pthread.m4 \
39 + build/m4/ax_c_lto.m4 \
40 + build/m4/ax_c_mallopt.m4 \
41 + build/m4/tcmalloc.m4 \
42 + build/m4/ax_c__generic.m4 \
43 README.md \
44 CONTRIBUTORS.md \
45 LICENSE \
build/Dockerfile new
+8
@@ -0,0 +1,8 @@
1 +FROM gcc:8
2 +
3 +RUN apt-get update && apt-get install -y \
4 + autoconf-archive \
5 + autogen \
6 + libmnl-dev \
7 + uuid-dev \
8 + && rm -rf /var/lib/apt/lists/*
build/build.sh new
+22
@@ -0,0 +1,22 @@
1 +#!/bin/bash
2 +
3 +if [ -f build.sh ]; then
4 + cd ../ || exit 1
5 +fi
6 +
7 +if [ "$IS_CONTAINER" != "" ]; then
8 + autoreconf -ivf
9 + ./configure --enable-maintainer-mode
10 + make dist
11 + rm -rf autom4te.cache
12 +else
13 + if [[ "$(docker images -q netdata-gcc-builder:latest 2> /dev/null)" == "" ]]; then
14 + docker build -t netdata-gcc-builder:latest -f build/Dockerfile .
15 + fi
16 + docker run --rm -it \
17 + --env IS_CONTAINER=TRUE \
18 + --volume "${PWD}:/project:Z" \
19 + --workdir "/project" \
20 + netdata:gcc \
21 + ./.travis/build.sh
22 +fi
build/m4/ax_c___atomic.m4 renamed
build/m4/ax_c__generic.m4 renamed
build/m4/ax_c_lto.m4 renamed
build/m4/ax_c_mallinfo.m4 renamed
build/m4/ax_c_mallopt.m4 renamed
build/m4/ax_c_statement_expressions.m4 renamed
build/m4/ax_check_compile_flag.m4 renamed
build/m4/ax_check_enable_debug.m4 renamed
build/m4/ax_gcc_func_attribute.m4 renamed
build/m4/ax_pthread.m4 renamed
build/m4/jemalloc.m4 renamed
build/m4/tcmalloc.m4 renamed
configure.ac
+1 -1
@@ -35,7 +35,7 @@ AC_SUBST([PACKAGE_RPM_RELEASE])
35
36 AC_CONFIG_AUX_DIR([.])
37 AC_CONFIG_HEADERS([config.h])
38 -AC_CONFIG_MACRO_DIR([m4])
38 +AC_CONFIG_MACRO_DIR([build/m4])
39 AC_CONFIG_SRCDIR([src/main.c])
40 AM_INIT_AUTOMAKE([tar-pax])
41 AC_CANONICAL_HOST
netdata.spec.in
+1 -1
@@ -85,7 +85,7 @@ Version: @PACKAGE_RPM_VERSION@
85 Release: 1%{?dist}
86 License: GPLv3+
87 Group: Applications/System
88 -Source0: https://github.com/netdata/%{name}/releases/download/v@PACKAGE_VERSION@/%{name}-@PACKAGE_VERSION@.tar.xz
88 +Source0: https://github.com/netdata/%{name}/releases/download/v@PACKAGE_VERSION@/%{name}-@PACKAGE_VERSION@.tar.gz
89 URL: http://my-netdata.io
90 BuildRequires: pkgconfig
91 BuildRequires: xz