netdata/installer: Make netdata installer more flexible, to accommodate install with ssl on MacOS (#6922)
* netdata/packaging: allow passing of LDFLAGS, together with CFLAGS * netdata/packaging: add instructions for mac * Update packaging/installer/README.md Co-Authored-By: Joel Hans <joel.g.hans@gmail.com> * Update packaging/installer/README.md Co-Authored-By: Joel Hans <joel.g.hans@gmail.com> * Update packaging/installer/README.md Co-Authored-By: Joel Hans <joel.g.hans@gmail.com> * netdata/docs: fix doc as per feedback Co-authored-by: Joel Hans <joel.g.hans@gmail.com>
Paul Emm. Katsoulakis committed
Jan 2, 2020 at 23:34 UTC
c7ea25076270a9f68fc8db8b75c71280776861ae
3 files changed
+24
-1
netdata-installer.sh
+12
-1
@@ -80,6 +80,7 @@ umask 002
80
renice 19 $$ >/dev/null 2>/dev/null
81
82
# you can set CFLAGS before running installer
83
+LDFLAGS="${LDFLAGS}"
84
CFLAGS="${CFLAGS--O2}"
85
[ "z${CFLAGS}" = "z-O3" ] && CFLAGS="-O2"
86
@@ -88,6 +89,7 @@ CFLAGS="${CFLAGS--O2}"
89
printf "\\n# " >>netdata-installer.log
90
date >>netdata-installer.log
91
printf 'CFLAGS="%s" ' "${CFLAGS}" >>netdata-installer.log
92
+printf 'LDFLAGS="%s" ' "${LDFLAGS}" >>netdata-installer.log
93
printf "%q " "${PROGRAM}" "${@}" >>netdata-installer.log
94
printf "\\n" >>netdata-installer.log
95
@@ -187,6 +189,14 @@ If you need to pass different CFLAGS, use something like this:
189
190
CFLAGS="<gcc options>" ${PROGRAM} [options]
191
192
+If you also need to provide different LDFLAGS, use something like this:
193
+
194
+ LDFLAGS="<extra ldflag options>" ${PROGRAM} [options]
195
+
196
+or use the following if both LDFLAGS and CFLAGS need to be overriden:
197
+
198
+ CFLAGS="<gcc options>" LDFLAGS="<extra ld options>" ${PROGRAM} [options]
199
+
200
For the installer to complete successfully, you will need these packages installed:
201
202
gcc make autoconf automake pkg-config zlib1g-dev (or zlib-devel) uuid-dev (or libuuid-devel)
@@ -422,7 +432,7 @@ run ./configure \
432
--with-math \
433
--with-user=netdata \
434
${NETDATA_CONFIGURE_OPTIONS} \
425
- CFLAGS="${CFLAGS}" || exit 1
435
+ CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" || exit 1
436
437
# remove the build_error hook
438
trap - EXIT
@@ -1083,6 +1093,7 @@ cat <<EOF > "${NETDATA_USER_CONFIG_DIR}/.environment"
1093
# Created by installer
1094
PATH="${PATH}"
1095
CFLAGS="${CFLAGS}"
1096
+LDFLAGS="${LDFLAGS}"
1097
NETDATA_PREFIX="${NETDATA_PREFIX}"
1098
NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS}"
1099
NETDATA_ADDED_TO_GROUPS="${NETDATA_ADDED_TO_GROUPS}"
packaging/installer/README.md
+11
@@ -430,6 +430,17 @@ sudo ./netdata-installer.sh --install /usr/local
430
431
The installer will also install a startup plist to start Netdata when your Mac boots.
432
433
+**Note:** Should you wish to install Netdata with TLS support:
434
+1. Install OpenSSL via brew by executing `brew install openssl`
435
+2. Run the installer with the extra CFLAGS and LDFLAGS, since your OpenSSL installation is not automatically symlinked to `/usr/local`
436
+
437
+```sh
438
+# install Netdata in /usr/local/netdata
439
+cd netdata
440
+CFLAGS="-I$(brew --prefix)/opt/openssl/include" LDFLAGS="${LDFLAGS} -L$(brew --prefix)/opt/openssl/lib" sudo -E ./netdata-installer.sh --install /usr/local
441
+```
442
+
443
+
444
##### Alpine 3.x
445
446
Execute these commands to install Netdata in Alpine Linux 3.x:
packaging/installer/netdata-updater.sh
+1
@@ -6,6 +6,7 @@
6
# Variables needed by script:
7
# - PATH
8
# - CFLAGS
9
+# - LDFLAGS
10
# - NETDATA_CONFIGURE_OPTIONS
11
# - REINSTALL_COMMAND
12
# - NETDATA_TARBALL_URL