install-alpine-packages.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. # Packaging update
  10. apk update
  11. # Add required APK packages
  12. apk add --no-cache \
  13. bash \
  14. wget \
  15. curl \
  16. ncurses \
  17. git \
  18. netcat-openbsd \
  19. alpine-sdk \
  20. autoconf \
  21. automake \
  22. gcc \
  23. make \
  24. cmake \
  25. libtool \
  26. pkgconfig \
  27. util-linux-dev \
  28. openssl-dev \
  29. gnutls-dev \
  30. zlib-dev \
  31. libmnl-dev \
  32. libnetfilter_acct-dev \
  33. libuv-dev \
  34. lz4-dev \
  35. openssl-dev \
  36. snappy-dev \
  37. protobuf-dev \
  38. || exit 1
  39. # snappy doesnt have static version in alpine, let's compile it
  40. export SNAPPY_VER="1.1.7"
  41. wget -O /snappy.tar.gz https://github.com/google/snappy/archive/${SNAPPY_VER}.tar.gz
  42. cd /
  43. tar -xf snappy.tar.gz
  44. rm snappy.tar.gz
  45. cd /snappy-${SNAPPY_VER}
  46. mkdir build
  47. cd build
  48. cmake -DCMAKE_BUILD_SHARED_LIBS=true -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR=lib ../
  49. make && make install
  50. # Judy doesnt seem to be available on the repositories, download manually and install it
  51. export JUDY_VER="1.0.5"
  52. wget -O /judy.tar.gz http://downloads.sourceforge.net/project/judy/judy/Judy-${JUDY_VER}/Judy-${JUDY_VER}.tar.gz
  53. cd /
  54. tar -xf judy.tar.gz
  55. rm judy.tar.gz
  56. cd /judy-${JUDY_VER}
  57. CFLAGS="-O2 -s" CXXFLAGS="-O2 -s" ./configure
  58. make
  59. make install;