mpmk 801 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. ### Overall revision 6 ###
  3. # this is a script to compile mplayer
  4. OLD_VER=`cat /.mplayer/mk_data`
  5. ### this allows changing the niceness ###
  6. if [ -n $1 ]; then
  7. SPEED='-10'
  8. else
  9. if echo $1|egrep '^(-[.1-9]|[.1-9])*$'>/dev/null; then
  10. SPEED=$1
  11. if [ $1 -gt 20 ]; then
  12. SPEED='20'
  13. fi
  14. if [ $1 -lt -20 ]; then
  15. SPEED='-20'
  16. fi
  17. fi
  18. fi
  19. ### end speed changing ###
  20. NEW_VER=`cat /.mplayer/up_data`
  21. if [ $OLD_VER != $NEW_VER ]; then
  22. cd /mplayer/ &&
  23. sudo nice -n $SPEED ./configure --enable-menu &&
  24. #--enable-gui &&
  25. sudo nice -n $SPEED make &&
  26. growlnotify -m "mplayer compiled" &&
  27. echo $NEW_VER>/.mplayer/mk_data &&
  28. cd -
  29. else
  30. growlnotify -m "source is the same, not compiling...."
  31. echo -e "\e[1;31mmplayer's source is the same, not going to compile...\e[m"
  32. fi