Skip to content

Instantly share code, notes, and snippets.

@Voker57
Created February 16, 2017 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Voker57/616a5e1e16593e00042f3a44959c7240 to your computer and use it in GitHub Desktop.
Save Voker57/616a5e1e16593e00042f3a44959c7240 to your computer and use it in GitHub Desktop.
#!/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