1
0

adkprepare.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 zip
  41. pkg_add -v intltool
  42. pkg_add -v libIDL
  43. pkg_add -v m4
  44. pkg_add -v gperf
  45. }
  46. openbsd_lux() {
  47. PKG_PATH="ftp://ftp.openbsd.org/pub/OpenBSD/${ver}/packages/${arch}/"
  48. export PKG_PATH
  49. pkg_add -v screen--
  50. pkg_add -v vim--no_x11
  51. }
  52. netbsd() {
  53. echo "Preparing NetBSD for OpenADK"
  54. PKG_PATH="ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/${arch}/${ver}/All/"
  55. export PKG_PATH
  56. pkg_add -vu xz
  57. pkg_add -vu scmgit
  58. pkg_add -vu gmake
  59. pkg_add -vu bash
  60. pkg_add -vu wget
  61. pkg_add -vu pkg-config
  62. pkg_add -vu unzip
  63. pkg_add -vu gtar
  64. pkg_add -vu gsed
  65. pkg_add -vu gawk
  66. pkg_add -vu gperf
  67. }
  68. netbsd_full() {
  69. echo "Preparing NetBSD for full OpenADK package builds"
  70. PKG_PATH="ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/${arch}/${ver}/All/"
  71. export PKG_PATH
  72. pkg_add -vu intltool
  73. pkg_add -vu lynx
  74. pkg_add -vu zip
  75. pkg_add -vu libIDL
  76. pkg_add -vu xkbcomp
  77. }
  78. netbsd_lux() {
  79. echo "Preparing NetBSD for deluxe OpenADK package builds"
  80. PKG_PATH="ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/${arch}/${ver}/All/"
  81. export PKG_PATH
  82. pkg_add -vu vim
  83. pkg_add -vu screen
  84. pkg_add -vu mksh
  85. }
  86. freebsd() {
  87. echo "Preparing FreeBSD for OpenADK"
  88. pkg_add -r git gmake bash wget unzip gtar gsed gawk gperf
  89. }
  90. freebsd_full() {
  91. echo "Preparing FreeBSD for full OpenADK package builds"
  92. pkg_add -r intltool lynx zip xkbcomp glib20 libIDL libxslt swig
  93. }
  94. freebsd_lux() {
  95. echo "Preparing FreeBSD for deluxe OpenADK package builds"
  96. pkg_add -r screen mksh vim
  97. }
  98. case $os in
  99. Linux)
  100. linux
  101. [ $ext -eq 1 ] && linux_full
  102. ;;
  103. FreeBSD)
  104. freebsd
  105. [ $ext -eq 1 ] && freebsd_full
  106. [ $lux -eq 1 ] && freebsd_lux
  107. ;;
  108. OpenBSD)
  109. openbsd
  110. [ $ext -eq 1 ] && openbsd_full
  111. [ $lux -eq 1 ] && openbsd_lux
  112. ;;
  113. NetBSD)
  114. netbsd
  115. [ $ext -eq 1 ] && netbsd_full
  116. [ $lux -eq 1 ] && netbsd_lux
  117. ;;
  118. Darwin)
  119. darwin
  120. [ $ext -eq 1 ] && darwin_full
  121. ;;
  122. *)
  123. echo "OS not supported"
  124. ;;
  125. esac