adkprepare.sh 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #!/bin/sh
  2. # This file is part of the OpenADK project. OpenADK is copyrighted
  3. # material, please see the LICENCE file in the top-level directory.
  4. os=$(uname)
  5. ver=$(uname -r)
  6. arch=$(uname -m)
  7. ext=0
  8. while getopts "el" option
  9. do
  10. case $option in
  11. e) ext=1 ;;
  12. l) lux=1 ;;
  13. *) printf "Option not recognized\n";exit 1 ;;
  14. esac
  15. done
  16. shift $(($OPTIND - 1))
  17. linux() {
  18. echo "Preparing Linux for OpenADK"
  19. }
  20. darwin() {
  21. echo "Preparing MacOS X for OpenADK"
  22. }
  23. openbsd() {
  24. echo "Preparing OpenBSD for OpenADK"
  25. PKG_PATH="ftp://ftp.openbsd.org/pub/OpenBSD/${ver}/packages/${arch}/"
  26. export PKG_PATH
  27. pkg_add -v gmake
  28. pkg_add -v git
  29. pkg_add -v bash
  30. pkg_add -v unzip
  31. pkg_add -v wget
  32. pkg_add -v gtar--
  33. pkg_add -v gawk
  34. pkg_add -v gsed
  35. pkg_add -v xz
  36. }
  37. openbsd_full() {
  38. PKG_PATH="ftp://ftp.openbsd.org/pub/OpenBSD/${ver}/packages/${arch}/"
  39. export PKG_PATH
  40. pkg_add -v bison
  41. pkg_add -v zip
  42. pkg_add -v intltool
  43. pkg_add -v libIDL
  44. pkg_add -v m4
  45. pkg_add -v autoconf-2.62p0
  46. pkg_add -v gperf
  47. pkg_add -v python-2.6.6p0
  48. }
  49. openbsd_lux() {
  50. PKG_PATH="ftp://ftp.openbsd.org/pub/OpenBSD/${ver}/packages/${arch}/"
  51. export PKG_PATH
  52. pkg_add -v screen--
  53. pkg_add -v vim--no_x11
  54. }
  55. netbsd() {
  56. echo "Preparing NetBSD for OpenADK"
  57. PKG_PATH="ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/${arch}/${ver}/All/"
  58. export PKG_PATH
  59. pkg_add -vu xz
  60. pkg_add -vu scmgit
  61. pkg_add -vu gmake
  62. pkg_add -vu bash
  63. pkg_add -vu wget
  64. pkg_add -vu pkg-config
  65. pkg_add -vu unzip
  66. pkg_add -vu gtar
  67. pkg_add -vu gsed
  68. pkg_add -vu gawk
  69. pkg_add -vu gperf
  70. }
  71. netbsd_full() {
  72. echo "Preparing NetBSD for full OpenADK package builds"
  73. PKG_PATH="ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/${arch}/${ver}/All/"
  74. export PKG_PATH
  75. pkg_add -vu intltool
  76. pkg_add -vu lynx
  77. pkg_add -vu zip
  78. pkg_add -vu bison
  79. pkg_add -vu libIDL
  80. pkg_add -vu xkbcomp
  81. pkg_add -vu python26
  82. }
  83. netbsd_lux() {
  84. echo "Preparing NetBSD for deluxe OpenADK package builds"
  85. PKG_PATH="ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/${arch}/${ver}/All/"
  86. export PKG_PATH
  87. pkg_add -vu vim
  88. pkg_add -vu screen
  89. pkg_add -vu mksh
  90. }
  91. freebsd() {
  92. echo "Preparing FreeBSD for OpenADK"
  93. pkg_add -r git gmake bash wget unzip gtar gsed gawk gperf
  94. }
  95. freebsd_full() {
  96. echo "Preparing FreeBSD for full OpenADK package builds"
  97. pkg_add -r intltool lynx bison zip xkbcomp glib20 libIDL autoconf268 libxslt automake14 swig
  98. }
  99. freebsd_lux() {
  100. echo "Preparing FreeBSD for deluxe OpenADK package builds"
  101. pkg_add -r screen mksh vim
  102. }
  103. case $os in
  104. Linux)
  105. linux
  106. [ $ext -eq 1 ] && linux_full
  107. ;;
  108. FreeBSD)
  109. freebsd
  110. [ $ext -eq 1 ] && freebsd_full
  111. [ $lux -eq 1 ] && freebsd_lux
  112. ;;
  113. OpenBSD)
  114. openbsd
  115. [ $ext -eq 1 ] && openbsd_full
  116. [ $lux -eq 1 ] && openbsd_lux
  117. ;;
  118. NetBSD)
  119. netbsd
  120. [ $ext -eq 1 ] && netbsd_full
  121. [ $lux -eq 1 ] && netbsd_lux
  122. ;;
  123. Darwin)
  124. darwin
  125. [ $ext -eq 1 ] && darwin_full
  126. ;;
  127. *)
  128. echo "OS not supported"
  129. ;;
  130. esac