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.

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