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.

153 lines
4.4 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 - 2004 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 [ "$1" = "-paranoia" ]; then
  35. paranoia=1
  36. fi
  37. if [ -n "$paranoia" ] && \
  38. [ ! -w / -o "$(id -u)" != 0 -a "$(id -g)" != 0 ] ; then
  39. echo
  40. echo "Paranoia Check: You are trying to build as non-root!"
  41. echo "Building ROCK Linux requires root privileges."
  42. echo
  43. echo "You can disable the Paranoia Checks in the Config tool"
  44. echo "on your own risk!"
  45. found_error=1
  46. fi
  47. if [ -n "$paranoia" -a "`date '+%Y'`" -lt 1990 ] ; then
  48. echo
  49. echo "Paranoia Check: Your clock is not set!"
  50. echo "Set you clock using the command: date MMDDhhmm[[CC]YY][.ss]"
  51. echo
  52. echo "You can disable the Paranoia Checks in the Config tool"
  53. echo "on your own risk!"
  54. found_error=1
  55. fi
  56. if [ -n "$paranoia" -a -z "`grep '^/' < /proc/swaps`" ] ; then
  57. echo
  58. echo "Paranoia Check: No active swap partition found!"
  59. echo "That can cause the build scripts to hang your system!. Activate"
  60. echo "a swap partition using the 'swapon' command and try again."
  61. echo
  62. echo "You can disable the Paranoia Checks in the Config tool"
  63. echo "on your own risk!"
  64. found_error=1
  65. fi
  66. if [ ! -L /dev/fd/0 ] ; then
  67. echo
  68. echo "System Check: It seams like you don't have a functional"
  69. echo "/dev/fd symlink! A symlink from /dev/fd to /proc/self/fd"
  70. echo "and a mounted /proc is needed."
  71. found_error=1
  72. fi
  73. if [ -z "`type -p curl`" ] ; then
  74. echo
  75. echo "System Check: Program 'curl' not found!"
  76. echo "The curl utility is needed for Downloading the package"
  77. echo "source tars. Install the latest curl version."
  78. found_error=1
  79. fi
  80. if [ -z "`type -p bzip2`" ] ; then
  81. echo
  82. echo "System Check: Program 'bzip2' not found!"
  83. echo "The bzip2 utility is needed for extracting the package"
  84. echo "source tars. Install the latest bzip2 version."
  85. found_error=1
  86. fi
  87. if [ -z "`type -p gawk`" ] ; then
  88. echo
  89. echo "System Check: Program 'gawk' not found!"
  90. echo "The gawk utility is needed for extracting the package"
  91. echo "source tars. Install the latest gawk version."
  92. found_error=1
  93. fi
  94. if [ -n "$paranoia" -a -z "`type -p makeinfo`" ] ; then
  95. echo
  96. echo "Paranoia Check: Program 'makeinfo' not found!"
  97. echo "The makeinfo program is needed for translating Texinfo"
  98. echo "documents. Please make sure that a current version of the"
  99. echo "texinfo package (including makeinfo) is installed on your system."
  100. echo
  101. echo "You can disable the Paranoia Checks in the Config tool"
  102. echo "on your own risk!"
  103. found_error=1
  104. fi
  105. case $BASH_VERSION in
  106. 2.05b*|3.*) ;;
  107. *) echo "The running bash version is not listed as supported version"
  108. echo "You need to update 'bash' to at least version 2.05b."
  109. found_error=1
  110. esac
  111. x="`mktemp -p /tmp 2> /dev/null`"
  112. if [ -z "$x" -o ! -f "$x" ] ; then
  113. echo
  114. echo "System Check: Program 'mktemp' not found or too old!"
  115. echo "You need an 'mktemp' installed which does know about the -p"
  116. echo "option. Install the latest mktemp version."
  117. found_error=1
  118. else
  119. rm -f "$x"
  120. fi
  121. tmpfile=`mktemp`
  122. if [ -z "`type -p sed`" ] || ! sed -i s/a/b/ $tmpfile 2> /dev/null
  123. then
  124. echo
  125. echo "System Check: Program 'sed' not found or too old!"
  126. echo "You need a 'sed' installed which does know about the -i option"
  127. echo "(GNU/sed since 2001-09-25). Install the latest sed version."
  128. found_error=1
  129. fi
  130. rm -f $tmpfile
  131. if [ $found_error -ne 0 ] ; then
  132. echo
  133. echo "System Check found errors -> not doing anything."
  134. echo
  135. fi
  136. exit $found_error