Trinity Desktop Environment Packaging
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.

66 lines
1.5KB

  1. #!/bin/bash
  2. FEDORA=0
  3. RHEL=0
  4. MGA=0
  5. DIST=""
  6. if [ -r /etc/redhat-release ]; then
  7. read a b c d e f g < /etc/redhat-release
  8. elif [ -r /etc/SuSE-release ] || [ -r /etc/SUSE-brand ] || grep -q "opensuse" "/etc/os-release"; then
  9. a="opensuse"
  10. fi
  11. case $a in
  12. # Mageia release 1 (Official) for x86_64
  13. Mageia*)
  14. DIST=".mga${c}"
  15. # MDKVERSION="201002"
  16. ;;
  17. # Mandriva Linux release 2011.0 (Official) for x86_64
  18. Mandriva*)
  19. DIST=".mdv${d}"
  20. MDKVERSION="201100"
  21. ;;
  22. # CentOS release 5.7 (Final)
  23. # CentOS Linux release 6.0 (Final)
  24. CentOS*)
  25. if [ $c = "release" ]; then
  26. RHEL="${d%%.*}"; DIST=".el${RHEL}"
  27. else
  28. RHEL="${c%%.*}"; DIST=".el${RHEL}"
  29. fi
  30. ;;
  31. "Red")
  32. RHEL="${g%%.*}"; DIST=".el${RHEL}"
  33. ;;
  34. # Fedora release 15 (Lovelock)
  35. Fedora*) FEDORA="${c}"; DIST=".fc${FEDORA}";;
  36. # Opensuse
  37. opensuse)
  38. if [ -r "/etc/SuSE-release" ]; then
  39. DIST=".oss$((read l; read a b c; echo ${c//./}) </etc/SuSE-release)"
  40. elif [ -r "/etc/SUSE-brand" ]; then
  41. DIST=".oss$((read a; read a b c; echo ${c//./}) </etc/SUSE-brand)"
  42. elif grep -q "tumbleweed" "/etc/os-release"; then
  43. DIST=".osstw"
  44. else
  45. DIST=".oss"
  46. fi
  47. ;;
  48. # PCLinuxOS
  49. PCLinuxOS) PCLINUXOS="${c}"; DIST=".pclos${c}";;
  50. #PCLinuxOS) PCLINUXOS="${c}"; DIST=".pclos";;
  51. *) echo "distrib non reconnue !! $a";;
  52. esac
  53. case "$1" in
  54. "--dist") echo $DIST;;
  55. "--rhel") echo $RHEL;;
  56. "--fedora") echo $FEDORA;;
  57. "--mdkversion") echo $MDKVERSION;;
  58. "--pclinuxos") echo $PCLINUXOS;;
  59. esac