adkprepare.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #!/bin/sh
  2. os=$(uname)
  3. ver=$(uname -r)
  4. arch=$(uname -m)
  5. ext=0
  6. while getopts "e" option
  7. do
  8. case $option in
  9. e) ext=1 ;;
  10. *) printf "Option not recognized\n";exit 1 ;;
  11. esac
  12. done
  13. shift $(($OPTIND - 1))
  14. linux() {
  15. echo "Preparing Linux for OpenADK"
  16. }
  17. darwin() {
  18. echo "Preparing MacOS X for OpenADK"
  19. }
  20. openbsd() {
  21. echo "Preparing OpenBSD for OpenADK"
  22. PKG_PATH="ftp://ftp.openbsd.org/pub/OpenBSD/${ver}/packages/${arch}/"
  23. export PKG_PATH
  24. pkg_add -v gmake
  25. pkg_add -v git
  26. pkg_add -v bash
  27. pkg_add -v unzip
  28. pkg_add -v wget
  29. pkg_add -v gtar--
  30. pkg_add -v gawk
  31. pkg_add -v gsed
  32. pkg_add -v xz
  33. }
  34. netbsd() {
  35. echo "Preparing NetBSD for OpenADK"
  36. PKG_PATH="ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/${arch}/5.0/All/"
  37. export PKG_PATH
  38. pkg_add -vu xz
  39. pkg_add -vu scmgit
  40. pkg_add -vu gmake
  41. pkg_add -vu mksh
  42. pkg_add -vu bash
  43. pkg_add -vu wget
  44. pkg_add -vu unzip
  45. pkg_add -vu gtar
  46. pkg_add -vu gsed
  47. pkg_add -vu gawk
  48. }
  49. netbsd_full() {
  50. echo "Preparing NetBSD for full OpenADK package builds"
  51. pkg_add -vu intltool
  52. pkg_add -vu lynx
  53. pkg_add -vu pkg-config
  54. pkg_add -vu zip
  55. pkg_add -vu bison
  56. pkg_add -vu libIDL
  57. pkg_add -vu xkbcomp
  58. }
  59. freebsd() {
  60. echo "Preparing FreeBSD for OpenADK"
  61. pkg_add -r git gmake mksh bash wget unzip gtar gsed gawk
  62. }
  63. freebsd_full() {
  64. echo "Preparing FreeBSD for full OpenADK package builds"
  65. pkg_add -r intltool lynx bison zip xkbcomp glib20 libIDL
  66. }
  67. case $os in
  68. Linux)
  69. linux
  70. [ $ext -eq 1 ] && linux_full
  71. ;;
  72. FreeBSD)
  73. freebsd
  74. [ $ext -eq 1 ] && freebsd_full
  75. ;;
  76. OpenBSD)
  77. openbsd
  78. [ $ext -eq 1 ] && openbsd_full
  79. ;;
  80. NetBSD)
  81. netbsd
  82. [ $ext -eq 1 ] && netbsd_full
  83. ;;
  84. Darwin)
  85. darwin
  86. [ $ext -eq 1 ] && darwin_full
  87. ;;
  88. *)
  89. echo "OS not supported"
  90. ;;
  91. esac