install-deps 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #!/usr/bin/env bash
  2. set -e
  3. set -u
  4. set -o pipefail
  5. distro=debian9stretch
  6. __private_print_help() {
  7. echo "script usage: $(basename $0)" &&\
  8. echo " [-d distro]"
  9. __private_print_distros
  10. }
  11. __private_print_distros() {
  12. echo "supported distros:" &&\
  13. echo "- debian9stretch" &&\
  14. echo "- ubuntu1804LTS"
  15. }
  16. while getopts 'd:h' OPTION; do
  17. case "$OPTION" in
  18. d)
  19. distro=$OPTARG
  20. ;;
  21. h)
  22. __private_print_help
  23. exit
  24. ;;
  25. ?)
  26. __private_print_help >&2
  27. exit 1
  28. ;;
  29. esac
  30. done
  31. shift "$(($OPTIND -1))"
  32. # NOTE: https://packages.debian.org/stretch/build-essential
  33. # Of course the build-essential contains some of the
  34. # other packages listed, but for explicit reasons
  35. # I will keep them. In fact, I might remove
  36. # build-essential later. Same for git, which one probably
  37. # already has when cloning the repo.
  38. __private_deps_debian9stretch() {
  39. echo "Installing dependencies for Debian 9 Stretch..."
  40. apt install \
  41. build-essential \
  42. curl \
  43. emacs-goodies-el \
  44. emacs25 \
  45. filezilla \
  46. firefox-esr-l10n-is \
  47. gcc \
  48. git \
  49. gnome-disk-utility \
  50. keepass2 \
  51. make \
  52. openconnect \
  53. p7zip-full \
  54. pelican \
  55. synaptic \
  56. thunderbird \
  57. thunderbird-l10n-is \
  58. virtualenv \
  59. vlc \
  60. zlib1g-dev
  61. }
  62. # Untested and incomplete, but assumed at the time of original init for this project.
  63. __private_deps_ubuntu1804LTS() {
  64. echo "Installing dependencies for Ubuntu 18.04 LTS..."
  65. apt install \
  66. build-essential \
  67. gcc \
  68. make \
  69. virtualenv \
  70. zlib1g-dev
  71. }
  72. __private_main() {
  73. # NOTE: Could either keep this as an if block or change to case.
  74. # But mainly keep it encapsulated here.
  75. if [ "$distro" = "debian9stretch" ]; then
  76. __private_deps_debian9stretch
  77. elif [ "$distro" = "ubuntu1804LTS" ]; then
  78. __private_deps_ubuntu1804LTS
  79. elif [ "$distro" = "" ]; then
  80. echo "No distro set."
  81. __private_print_help
  82. exit 1
  83. else
  84. echo "Unsupported distro: $distro"
  85. fi
  86. exit
  87. }
  88. __private_main