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.

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