Created
February 16, 2017 12:00
-
-
Save Voker57/616a5e1e16593e00042f3a44959c7240 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
VERSION=$1 | |
if [ -f /opt/freeorion/$VERSION ] ; then | |
echo "Already installed." | |
exit 0 | |
fi | |
if [ -f ~/Sources/freeorion/$VERSION.tar.gz ] ; then | |
echo "Unpacking..." | |
sudo rm -rf /opt/freeorion | |
cd / | |
sudo tar xf ~/Sources/freeorion/$VERSION.tar.gz || ( echo "failed!" && exit 1 ) | |
sudo touch /opt/freeorion/$VERSION | |
echo "Done" | |
exit 0 | |
fi | |
echo "Building from source..." | |
cd ~/Sources/freeorion/build | |
git checkout $1 | |
make -j7 > build.log || ( echo "build failed!" && exit 1 ) | |
sudo rm -rf /opt/freeorion | |
sudo make install || ( echo "build failed!" && exit 1 ) | |
tar cf ~/Sources/freeorion/$VERSION.tar.gz /opt/freeorion | |
sudo touch /opt/freeorion/$VERSION | |
echo "Done" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment