install-alpine-packages.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. bash \
  12. wget \
  13. curl \
  14. ncurses \
  15. git \
  16. netcat-openbsd \
  17. alpine-sdk \
  18. autoconf \
  19. automake \
  20. gcc \
  21. make \
  22. cmake \
  23. libtool \
  24. pkgconfig \
  25. util-linux-dev \
  26. openssl-dev \
  27. gnutls-dev \
  28. zlib-dev \
  29. libmnl-dev \
  30. libnetfilter_acct-dev \
  31. libuv-dev \
  32. lz4-dev \
  33. openssl-dev \
  34. snappy-dev \
  35. protobuf-dev \
  36. binutils \
  37. gzip \
  38. xz || 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. tar -C / -xf /snappy.tar.gz
  43. rm /snappy.tar.gz
  44. cd /snappy-${SNAPPY_VER} || exit 1
  45. mkdir build
  46. cd build || exit 1
  47. cmake -DCMAKE_BUILD_SHARED_LIBS=true -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR=lib ../
  48. make && make install
  49. # Judy doesnt seem to be available on the repositories, download manually and install it
  50. export JUDY_VER="1.0.5"
  51. wget -O /judy.tar.gz http://downloads.sourceforge.net/project/judy/judy/Judy-${JUDY_VER}/Judy-${JUDY_VER}.tar.gz
  52. tar -C / -xf /judy.tar.gz
  53. rm /judy.tar.gz
  54. cd /judy-${JUDY_VER} || exit 1
  55. CFLAGS="-O2 -s" CXXFLAGS="-O2 -s" ./configure
  56. make
  57. make install