postflight.in 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/sh
  2. # configured
  3. INST_DIR="@INST_DIR@"
  4. MACOSX_SUPPDIR="@MACOSX_SUPPDIR@"
  5. GRASS_VER="@GRASS_VER@"
  6. # support folder
  7. mkdir -p "$MACOSX_SUPPDIR"
  8. mkdir -p "$MACOSX_SUPPDIR/Modules/bin"
  9. mkdir -p "$MACOSX_SUPPDIR/Modules/lib"
  10. mkdir -p "$MACOSX_SUPPDIR/Modules/etc"
  11. mkdir -p "$MACOSX_SUPPDIR/Modules/docs/html"
  12. # help
  13. /bin/ln -sfh "$INST_DIR/docs/html" "/Library/Documentation/Help/GRASS-$GRASS_VER"
  14. # modbuild
  15. #cp -Rf "$PACKAGE_PATH/Contents/Resources/modbuild" "$MACOSX_SUPPDIR"
  16. # compile python - use python version GRASS was compiled for
  17. pyver_want="@PYVER@"
  18. py=`type -p python`
  19. if [ "$py" ] ; then
  20. pyver=`python -V 2>&1 | grep " $pyver_want"`
  21. if [ ! "$pyver" ] ; then
  22. py=""
  23. else
  24. pyconf="python-config"
  25. fi
  26. fi
  27. # try standard framework
  28. if [ ! "$py" ] ; then
  29. py="/Library/Frameworks/Python.framework/Versions/$pyver_want/bin/python"
  30. if [ ! -x "$py" ] ; then
  31. py=""
  32. else
  33. pyconf="/Library/Frameworks/Python.framework/Versions/$pyver_want/bin/python-config"
  34. fi
  35. fi
  36. # try system (may be the same as in shell path)
  37. if [ ! "$py" ] ; then
  38. py="/usr/bin/python"
  39. pyver=`$py -V 2>&1 | grep " $pyver_want"`
  40. if [ ! "$pyver" ] ; then
  41. py=""
  42. else
  43. pyconf="/usr/bin/python-config"
  44. fi
  45. fi
  46. if [ "$py" ] ; then
  47. pycompile=`$pyconf --prefix`/lib/python$pyver_want/compileall.py
  48. if [ ! -e "$pycompile" ] ; then
  49. pycompile=`$pyconf --prefix`/lib/python$pyver_want/compileall.pyc
  50. fi
  51. $py $pycompile "$INST_DIR"
  52. fi
  53. # readme
  54. # needs a better home?
  55. cp -f "$PACKAGE_PATH/Contents/Resources/ReadMe.rtf" "/Users/Shared/GRASS-$GRASS_VER-ReadMe.rtf"
  56. exit 0