Advertisement
pintcat

do-smplayer.bash 1.1

Oct 22nd, 2016
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.10 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. RC=0
  4. INSTALL_PATH=~/ubin
  5. WORK_PATH=/media/ramdisk/smplayer_src
  6. URL=https://subversion.assembla.com/svn/smplayer/smplayer/trunk/
  7. typeset -i CORES=$(grep -m 1 "cpu cores" /proc/cpuinfo | awk '{print $4}')
  8.  
  9. echo -e "\033[0;32m\nDownloading source from svn repo...\n\033[0m"
  10. if svn co $URL $WORK_PATH; then
  11.     echo -e "\n\033[0;32mCompiling binary...\n\033[0m"
  12.     cd $WORK_PATH
  13.     if make -s -j$CORES; then
  14.     if [ -f $INSTALL_PATH/smplayer"~" ]; then rm -f $INSTALL_PATH/smplayer"~"; fi
  15.     if [ -f $INSTALL_PATH/smplayer ]; then mv $INSTALL_PATH/smplayer $INSTALL_PATH/smplayer"~"; fi
  16.     echo -e "\n\033[0;32mCompressing and installing binary to "$INSTALL_PATH"...\n\033[0m"
  17.     upx --lzma --ultra-brute src/smplayer -o $INSTALL_PATH/smplayer
  18.     else
  19.     echo -e "\n\033[0;31mUnable to compile. Contact developer or try a difrent source.\n\033[0m"
  20.     RC=1
  21.     fi
  22. else
  23.     echo -e "\n\033[0;31mUnable to obtain source. Try again later!\n\033[0m"
  24.     RC=1
  25. fi
  26. echo -ne "\n\033[0;32mCleaning up... "
  27. if [ -d $WORK_PATH ]; then
  28.     cd ..
  29.     rm -rf $WORK_PATH
  30. fi
  31. echo -e "done.\n\033[0m"
  32. exit $RC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement