%preinstall << END
# echo Command before installing
exit 0
END

%postinstall << END
# echo Command after installing
# searching for the PRODUCTINSTALLLOCATION for the different platforms
platform=`uname -s`
case $$platform in
SunOS)
  PRODUCTINSTALLLOCATION="$$BASEDIR"
  ;;
Linux)
  PRODUCTINSTALLLOCATION="$$RPM_INSTALL_PREFIX"
  ;;
*)
  PRODUCTINSTALLLOCATION="$$BASEDIR" 
  ;;
esac

if [ -d $$PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/program/python-core-2.3.4 ]
then
  ln -s python-core-2.3.4 $$PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/program/python-core >/dev/null 2>&1
fi

if [ -f $$PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/program/python.sh ]
then
  ln -s python.sh $$PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/program/python >/dev/null 2>&1
fi

if [ -f $$PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/program/python-core-2.3.4/bin/python ]
then
  chmod +x $$PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/program/python-core-2.3.4/bin/python
fi

exit 0
END

%preremove << END
# echo Command before removing
exit 0
END

%postremove << END
# echo Command after removing

# searching for the PRODUCTINSTALLLOCATION for the different platforms
platform=`uname -s`
case $$platform in
SunOS)
  PRODUCTINSTALLLOCATION="$$BASEDIR"
  ;;
Linux)
  PRODUCTINSTALLLOCATION="$$RPM_INSTALL_PREFIX"
  ;;
*)
  PRODUCTINSTALLLOCATION="$$BASEDIR" 
  ;;
esac

exit 0
END
