mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

158 lines
4.5 KiB

  1. #!/bin/bash
  2. #
  3. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  4. #
  5. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  6. # Please add additional copyright information _after_ the line containing
  7. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  8. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  9. #
  10. # ROCK Linux: rock-src/scripts/Check-System
  11. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  12. #
  13. # This program is free software; you can redistribute it and/or modify
  14. # it under the terms of the GNU General Public License as published by
  15. # the Free Software Foundation; either version 2 of the License, or
  16. # (at your option) any later version. A copy of the GNU General Public
  17. # License can be found at Documentation/COPYING.
  18. #
  19. # Many people helped and are helping developing ROCK Linux. Please
  20. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  21. # file for details.
  22. #
  23. # --- ROCK-COPYRIGHT-NOTE-END ---
  24. if [ -n "$1" -a "$1" != "-paranoia" ] ; then
  25. echo "Usage: $0 [ -paranoia ]"
  26. echo
  27. echo " Check the build system for and warn about various conditions that will likely"
  28. echo " cause ROCK to not work properly."
  29. echo
  30. exit 1
  31. fi
  32. found_error=0
  33. paranoia=""
  34. if [ "$ROCK_CHECK_SYSTEM_OK" = 1 ]; then
  35. exit 0
  36. fi
  37. if [ "$1" = "-paranoia" ]; then
  38. paranoia=1
  39. fi
  40. if [ -n "$paranoia" ] && \
  41. [ ! -w / -o "$(id -u)" != 0 -a "$(id -g)" != 0 ] ; then
  42. echo
  43. echo "Paranoia Check: You are trying to build as non-root!"
  44. echo "Building ROCK Linux requires root privileges."
  45. echo
  46. echo "You can disable the Paranoia Checks in the Config tool"
  47. echo "on your own risk!"
  48. found_error=1
  49. fi
  50. if [ -n "$paranoia" -a "`date '+%Y'`" -lt 1990 ] ; then
  51. echo
  52. echo "Paranoia Check: Your clock is not set!"
  53. echo "Set you clock using the command: date MMDDhhmm[[CC]YY][.ss]"
  54. echo
  55. echo "You can disable the Paranoia Checks in the Config tool"
  56. echo "on your own risk!"
  57. found_error=1
  58. fi
  59. if [ -n "$paranoia" -a -z "`grep '^/' < /proc/swaps`" ] ; then
  60. echo
  61. echo "Paranoia Check: No active swap partition found!"
  62. echo "That can cause the build scripts to hang your system!. Activate"
  63. echo "a swap partition using the 'swapon' command and try again."
  64. echo
  65. echo "You can disable the Paranoia Checks in the Config tool"
  66. echo "on your own risk!"
  67. found_error=1
  68. fi
  69. if [ ! -L /dev/fd/0 ] ; then
  70. echo
  71. echo "System Check: It seams like you don't have a functional"
  72. echo "/dev/fd symlink! A symlink from /dev/fd to /proc/self/fd"
  73. echo "and a mounted /proc is needed."
  74. found_error=1
  75. fi
  76. if [ -z "`type -p curl`" ] ; then
  77. echo
  78. echo "System Check: Program 'curl' not found!"
  79. echo "The curl utility is needed for Downloading the package"
  80. echo "source tars. Install the latest curl version."
  81. found_error=1
  82. fi
  83. if [ -z "`type -p bzip2`" ] ; then
  84. echo
  85. echo "System Check: Program 'bzip2' not found!"
  86. echo "The bzip2 utility is needed for extracting the package"
  87. echo "source tars. Install the latest bzip2 version."
  88. found_error=1
  89. fi
  90. if [ -z "`type -p gawk`" ] ; then
  91. echo
  92. echo "System Check: Program 'gawk' not found!"
  93. echo "The gawk utility is needed for extracting the package"
  94. echo "source tars. Install the latest gawk version."
  95. found_error=1
  96. fi
  97. if [ -n "$paranoia" -a -z "`type -p makeinfo`" ] ; then
  98. echo
  99. echo "Paranoia Check: Program 'makeinfo' not found!"
  100. echo "The makeinfo program is needed for translating Texinfo"
  101. echo "documents. Please make sure that a current version of the"
  102. echo "texinfo package (including makeinfo) is installed on your system."
  103. echo
  104. echo "You can disable the Paranoia Checks in the Config tool"
  105. echo "on your own risk!"
  106. found_error=1
  107. fi
  108. case $BASH_VERSION in
  109. 2.05b*|3.*) ;;
  110. *) echo "The running bash version is not listed as supported version"
  111. echo "You need to update 'bash' to at least version 2.05b."
  112. found_error=1
  113. esac
  114. x="`mktemp -p /tmp 2> /dev/null`"
  115. if [ -z "$x" -o ! -f "$x" ] ; then
  116. echo
  117. echo "System Check: Program 'mktemp' not found or too old!"
  118. echo "You need an 'mktemp' installed which does know about the -p"
  119. echo "option. Install the latest mktemp version."
  120. found_error=1
  121. else
  122. rm -f "$x"
  123. fi
  124. tmpfile=`mktemp`
  125. if [ -z "`type -p sed`" ] || ! sed -i s/a/b/ $tmpfile 2> /dev/null
  126. then
  127. echo
  128. echo "System Check: Program 'sed' not found or too old!"
  129. echo "You need a 'sed' installed which does know about the -i option"
  130. echo "(GNU/sed since 2001-09-25). Install the latest sed version."
  131. found_error=1
  132. fi
  133. rm -f $tmpfile
  134. if [ $found_error -ne 0 ] ; then
  135. echo
  136. echo "System Check found errors -> not doing anything."
  137. echo
  138. fi
  139. exit $found_error