Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- RC=0
- INSTALL_PATH=~/ubin
- WORK_PATH=/media/ramdisk/smplayer_src
- URL=https://subversion.assembla.com/svn/smplayer/smplayer/trunk/
- typeset -i CORES=$(grep -m 1 "cpu cores" /proc/cpuinfo | awk '{print $4}')
- echo -e "\033[0;32m\nDownloading source from svn repo...\n\033[0m"
- if svn co $URL $WORK_PATH; then
- echo -e "\n\033[0;32mCompiling binary...\n\033[0m"
- cd $WORK_PATH
- if make -s -j$CORES; then
- if [ -f $INSTALL_PATH/smplayer"~" ]; then rm -f $INSTALL_PATH/smplayer"~"; fi
- if [ -f $INSTALL_PATH/smplayer ]; then mv $INSTALL_PATH/smplayer $INSTALL_PATH/smplayer"~"; fi
- echo -e "\n\033[0;32mCompressing and installing binary to "$INSTALL_PATH"...\n\033[0m"
- upx --lzma --ultra-brute src/smplayer -o $INSTALL_PATH/smplayer
- else
- echo -e "\n\033[0;31mUnable to compile. Contact developer or try a difrent source.\n\033[0m"
- RC=1
- fi
- else
- echo -e "\n\033[0;31mUnable to obtain source. Try again later!\n\033[0m"
- RC=1
- fi
- echo -ne "\n\033[0;32mCleaning up... "
- if [ -d $WORK_PATH ]; then
- cd ..
- rm -rf $WORK_PATH
- fi
- echo -e "done.\n\033[0m"
- exit $RC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement