summaryrefslogtreecommitdiffstats
path: root/packaging/makeself/install-alpine-packages.sh
blob: a3e8cf60578b5859083aa004785b9b9c2eff9050 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env sh
#
# Installation script for the alpine host
# to prepare the static binary
#
# Copyright: SPDX-License-Identifier: GPL-3.0-or-later
#
# Author: Paul Emm. Katsoulakis <paul@netdata.cloud>

# Add required APK packages
apk add --no-cache -U \
  bash \
  wget \
  curl \
  ncurses \
  git \
  netcat-openbsd \
  alpine-sdk \
  autoconf \
  automake \
  gcc \
  make \
  cmake \
  libtool \
  pkgconfig \
  util-linux-dev \
  gnutls-dev \
  zlib-dev \
  zlib-static \
  libmnl-dev \
  libnetfilter_acct-dev \
  libuv-dev \
  libuv-static \
  lz4-dev \
  lz4-static \
  snappy-dev \
  protobuf-dev \
  binutils \
  gzip \
  xz || exit 1

# snappy doesn't have static version in alpine, let's compile it
export SNAPPY_VER="1.1.7"
wget -O /snappy.tar.gz https://github.com/google/snappy/archive/${SNAPPY_VER}.tar.gz
tar -C / -xf /snappy.tar.gz
rm /snappy.tar.gz
cd /snappy-${SNAPPY_VER} || exit 1
mkdir build
cd build || exit 1
cmake -DCMAKE_BUILD_SHARED_LIBS=true -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR=lib ../
make && make install