build-install-gnunet-debian10.sh 894 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. set -exo
  3. set -u pipefail
  4. if [ "$USER" = "root" ]; then
  5. export SUDO_CMD=""
  6. else
  7. SUDO_CMD="sudo"
  8. fi
  9. $SUDO_CMD apt update
  10. $SUDO_CMD apt install -y git libtool autoconf \
  11. autopoint libmicrohttpd-dev build-essential libgcrypt-dev \
  12. libidn11-dev zlib1g-dev libunistring-dev libglpk-dev miniupnpc \
  13. libextractor-dev libjansson-dev libcurl4-gnutls-dev gnutls-bin \
  14. libsqlite3-dev openssl libnss3-tools libopus-dev libpulse-dev libogg-dev
  15. mkdir ~/gnunet_installation || true
  16. cd ~/gnunet_installation
  17. git clone --depth 1 https://gnunet.org/git/gnunet.git || true
  18. cd ~/gnunet_installation/gnunet
  19. ./bootstrap
  20. export GNUNET_PREFIX=/usr
  21. export CFLAGS="-g -Wall -O0"
  22. ./configure --prefix=$GNUNET_PREFIX --enable-logging=verbose --disable-documentation
  23. $SUDO_CMD addgroup gnunet || true
  24. $SUDO_CMD usermod -aG gnunet $USER || true
  25. make -j$(nproc || echo -n 1)
  26. $SUDO_CMD make install