run.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. # Fetch and build
  3. # muon (a C reimplementation of the meson build system),
  4. # samurai (a C reimplementation of the ninja build tool),
  5. # and then use both to build tinc.
  6. set -euo pipefail
  7. git_samurai=https://github.com/michaelforney/samurai
  8. git_muon=https://git.sr.ht/~lattis/muon
  9. prefix=/opt/tinc_muon
  10. header() {
  11. echo >&2 '################################################################################'
  12. echo >&2 "# $*"
  13. echo >&2 '################################################################################'
  14. }
  15. header 'Try to make sure Python is missing'
  16. python --version && exit 1
  17. python3 --version && exit 1
  18. header 'Fetch and build samurai'
  19. git clone --depth=1 $git_samurai ~/samurai
  20. pushd ~/samurai
  21. make -j"$(nproc)"
  22. make install
  23. popd
  24. header 'Fetch and build muon'
  25. git clone --depth=1 $git_muon ~/muon
  26. pushd ~/muon
  27. ./bootstrap.sh build
  28. ./build/muon setup build
  29. samu -C build
  30. ./build/muon -C build install
  31. popd
  32. header 'Setup build directory'
  33. muon setup -D prefix=$prefix -D systemd=disabled build_muon
  34. samu -C build_muon
  35. header 'Install tinc'
  36. muon -C build_muon install
  37. header 'Run smoke tests'
  38. $prefix/sbin/tinc --version
  39. $prefix/sbin/tincd --version
  40. $prefix/sbin/tinc -c /tmp/muon_node <<EOF
  41. init muon
  42. set DeviceType dummy
  43. set Address localhost
  44. set Port 0
  45. start
  46. EOF