install-alpine-packages.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/usr/bin/env sh
  2. #
  3. # Installation script for the alpine host
  4. # to prepare the static binary
  5. #
  6. # Copyright: SPDX-License-Identifier: GPL-3.0-or-later
  7. #
  8. # Author: Paul Emm. Katsoulakis <paul@netdata.cloud>
  9. # Add required APK packages
  10. apk add --no-cache -U \
  11. alpine-sdk \
  12. autoconf \
  13. automake \
  14. bash \
  15. binutils \
  16. cmake \
  17. curl \
  18. gcc \
  19. git \
  20. gnutls-dev \
  21. gzip \
  22. libmnl-dev \
  23. libnetfilter_acct-dev \
  24. libtool \
  25. libuv-dev \
  26. libuv-static \
  27. lz4-dev \
  28. lz4-static \
  29. make \
  30. ncurses \
  31. netcat-openbsd \
  32. openssh \
  33. pkgconfig \
  34. protobuf-dev \
  35. snappy-dev \
  36. util-linux-dev \
  37. wget \
  38. xz \
  39. zlib-dev \
  40. zlib-static ||
  41. exit 1
  42. # snappy doesn't have static version in alpine, let's compile it
  43. export SNAPPY_VER="1.1.7"
  44. wget -O /snappy.tar.gz https://github.com/google/snappy/archive/${SNAPPY_VER}.tar.gz
  45. tar -C / -xf /snappy.tar.gz
  46. rm /snappy.tar.gz
  47. cd /snappy-${SNAPPY_VER} || exit 1
  48. mkdir build
  49. cd build || exit 1
  50. cmake -DCMAKE_BUILD_SHARED_LIBS=true -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR=lib ../
  51. make && make install