adkprepare.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. openbsd_full() {
  35. PKG_PATH="ftp://ftp.openbsd.org/pub/OpenBSD/${ver}/packages/${arch}/"
  36. export PKG_PATH
  37. pkg_add -v bison
  38. pkg_add -v zip
  39. pkg_add -v intltool
  40. pkg_add -v libIDL
  41. pkg_add -v m4
  42. pkg_add -v autoconf-2.62p0
  43. pkg_add -v gperf
  44. pkg_add -v python-2.6.3p1
  45. }
  46. netbsd() {
  47. echo "Preparing NetBSD for OpenADK"
  48. PKG_PATH="ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/${arch}/5.0/All/"
  49. export PKG_PATH
  50. pkg_add -vu xz
  51. pkg_add -vu scmgit
  52. pkg_add -vu gmake
  53. pkg_add -vu mksh
  54. pkg_add -vu bash
  55. pkg_add -vu wget
  56. pkg_add -vu unzip
  57. pkg_add -vu gtar
  58. pkg_add -vu gsed
  59. pkg_add -vu gawk
  60. pkg_add -vu gperf
  61. }
  62. netbsd_full() {
  63. echo "Preparing NetBSD for full OpenADK package builds"
  64. PKG_PATH="ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/${arch}/5.0/All/"
  65. export PKG_PATH
  66. pkg_add -vu intltool
  67. pkg_add -vu lynx
  68. pkg_add -vu pkg-config
  69. pkg_add -vu zip
  70. pkg_add -vu bison
  71. pkg_add -vu libIDL
  72. pkg_add -vu xkbcomp
  73. pkg_add -vu python26
  74. }
  75. freebsd() {
  76. echo "Preparing FreeBSD for OpenADK"
  77. pkg_add -r git gmake mksh bash wget unzip gtar gsed gawk gperf
  78. }
  79. freebsd_full() {
  80. echo "Preparing FreeBSD for full OpenADK package builds"
  81. pkg_add -r intltool lynx bison zip xkbcomp glib20 libIDL autoconf262
  82. }
  83. case $os in
  84. Linux)
  85. linux
  86. [ $ext -eq 1 ] && linux_full
  87. ;;
  88. FreeBSD)
  89. freebsd
  90. [ $ext -eq 1 ] && freebsd_full
  91. ;;
  92. OpenBSD)
  93. openbsd
  94. [ $ext -eq 1 ] && openbsd_full
  95. ;;
  96. NetBSD)
  97. netbsd
  98. [ $ext -eq 1 ] && netbsd_full
  99. ;;
  100. Darwin)
  101. darwin
  102. [ $ext -eq 1 ] && darwin_full
  103. ;;
  104. *)
  105. echo "OS not supported"
  106. ;;
  107. esac