MegaGlest Forum
Archives (read only) => Vanilla Glest => Linux and other ports => Topic started by: assassin on 31 May 2009, 13:33:37
-
Getting glest and GAE installed onto your (linux) computer.
By Assassin
UPDATE 31/08/09: Improved install locations and added GAE v0.2.12
UPDATE 20/09/09: Improved security in installation with help from Jda (https://forum.megaglest.org/index.php?action=profile;u=6410)
Can this post be Stickied Please?
EDIT: To install via SVN go here: https://forum.megaglest.org/index.php?topic=4375.msg27748#msg27748
Make sure you have all dependencies. (These will show up when you first run configure if you don't have them).
It is recommended that you go through these instructions step by step, so that you can post exactly what and where the problem is if something goes wrong.
Step 1: Normal Glest
First, we want to go to a temporary directory:
cd /tmp
Now get the source package:
wget http://kent.dl.sourceforge.net/sourceforge/glest/glest_source_3.2.2.zip
unzip it:
mkdir glestsource ; cd glestsource ; unzip /tmp/glest_source_3.2.2.zip
change to the compile directory:
cd mk/linux
change permissions:
chmod a+x autogen.sh
run autogen
./autogen.sh
run configure:
./configure
NOTE: this is when any missing dependencies will be shown.
now time to compile:
jam
now we have glest!
make a directory for it:
sudo mkdir /usr/local/games/glest ; sudo chown $USER:$USER /usr/local/games/glest
and move your files to it
mv glest /usr/local/games/glest/glest ; mv glest.ini /usr/local/games/glest/glest.ini ; mv glest_editor /usr/local/games/glest/glest_editor
now we can go to your permanent glest directory:
cd /usr/local/games/glest
now we need the data:
wget http://kent.dl.sourceforge.net/sourceforge/glest/glest_data_3.2.1.zip
unzip it:
unzip glest_data_3.2.1.zip
now annoyingly the files are all in a directory called "glest_game" but we want them in the root directory of glest so:
mv glest_game/data data ; mv glest_game/maps maps ; mv glest_game/scenarios scenarios ; mv glest_game/screens screens ; mv glest_game/techs techs ; mv glest_game/tilesets tilesets ; mv glest_game/tutorials tutorials ; mv glest_game/glest.ico glest.ico ; mv glest_game/servers.ini servers.ini ; rm -r glest_game ; rm glest_data_3.2.1.zip
now we rename the .lng file:
cp data/lang/english.lng data/lang/english.lng.lng
Now glest should work. To test type ./glest
Step 2: GAE
cd /tmp
svn co https://glestae.svn.sourceforge.net/svnroot/glestae/trunk glest-svn
cd glest-svn/mk/linux
chmod a+x autogen.sh
./autogen.sh
./configure
jam
This would be a good time to go have a snack...
mv glestadv /usr/local/games/glest/glestadv
cd /tmp/glest-svn/data/game
mv data /usr/local/games/glest/data;
cd /tmp
wget http://glest.codemonger.org/files/glestadv-src-0.2.11.zip
unzip glestadv-src-0.2.11.zip
cd gae/data/glest_game
cp -r data /usr/local/games/glest
mkdir /usr/local/games/glest/gae_scenarios
ln -s /usr/local/games/glest/scenarios /usr/local/games/glest/gae_scenarios/scenarios
sudo chown root:root /usr/local/games/glest
That should then mean that gae works!
to try type:
cd /usr/local/games/glest ; ./glestadv
Step 3: Sorting out scenarios:
mkdir /usr/local/games/glest/gae_scenarios
ln -s /usr/local/games/glest/scenarios /usr/local/games/glest/gae_scenarios/scenarios
NOTE:
* In-game, you will notice you have only one category of scenarios, called "All_scenarios". If you want to have your scenarios organized in different categories, just create one folder for each category you want inside folder gae_scenarios and move the scenarios you want for that category in there. E.g.:
sudo mkdir /usr/local/games/glest/gae_scenarios/megapack_v4
ln -s /usr/local/games/glest/scenarios/m4* /usr/local/games/glest/gae_scenarios/megapack_v4(you will now have a new category containing only Titi's Megapack v4 scenarios. Wink )
now set the folder prioroties back to root (recoomended,but not 100% necessary)
sudo chown root:root /usr/local/games/glest
Step 4: Creating shortcuts in your $PATH
To find your path type type:
echo $PATHand chose whichever directory that you think is the most appropriate for glest.
(save these scripts as "glest" and "gae" (respectively) in your $PATH
VANILLA GLEST:
#!/bin/sh
# glest
MAINDIR=/usr/local/games/glest
DIR=$HOME/.glest
[ -d $DIR ] || mkdir $DIR
cd $DIR
if [ -f glest.ini ]; then
# Update for Glest 3.2.1
sed -i 's/\.lng//' glest.ini
language=$(cat glest.ini | grep Lang | cut -d'=' -f2)
[ -f $MAINDIR/data/lang/${language}.lng ] || \
sed -i "s/${language}/english/" glest.ini
else
cp $MAINDIR/glest.ini .
fi
[ -h glest ] || ln -s $MAINDIR/glest .
[ -f servers.ini ] || cp $MAINDIR/servers.ini .
for i in data docs scenarios techs tilesets; do
[ -h $i ] || ln -s $MAINDIR/$i .
done
[ -d maps ] || mkdir maps
cd maps
for i in $MAINDIR/maps/*; do
[ -h `basename $i` ] || ln -s $i .
done
cd ..
exec ./glest
GAE
#!/bin/sh
# glestadv
MAINDIR=/usr/local/games/glest
DIR=$HOME/.glest
[ -d $DIR ] || mkdir $DIR
cd $DIR
#if [ -f glestadv.ini ]; then # I could NOT get this to work properly for GAE. Hence
# # Update for Glest 3.2.1 # I just commented this out, which means that, if you
# sed -i 's/\.lng//' glestadv.ini # happen to messup your language settings, this script
# language=$(cat glestadv.ini | grep Lang | cut -d'=' -f2) # will not automatically fix it for you. You'll have to
# [ -f $MAINDIR/data/lang/${language}.lng ] || \ # manually fix it yourself.
# sed -i "s/${language}/english/" glestadv.ini
#else
# cp $MAINDIR/glestadv.ini .
#fi # End of commented-out language-setting routine.
[ -h glestadv ] || ln -s $MAINDIR/glestadv .
[ -f servers.ini ] || cp $MAINDIR/servers.ini .
for i in data docs scenarios techs tilesets gae_scenarios ; do
[ -h $i ] || ln -s $MAINDIR/$i .
done
[ -d maps ] || mkdir maps
cd maps
for i in $MAINDIR/maps/*; do
[ -h `basename $i` ] || ln -s $i .
done
cd ..
exec ./glestadv
To run gae just type "gae" in the terminal.
Note: place mods in /usr/local/games/glest/techs
Step 5: Enjoy!
Credit goes to Jda (https://forum.megaglest.org/index.php?action=profile;u=6410) for improved security!
-
Sweet!
I've had some issues getting linux working to my satisfaction, and will probably have to reinstall with a newer/better distro, but it'll be nice to have this all laid out for me when I get around to it.
Cheers !! ;D
-
If you want download glest over svn and install system wide:
cd /opt/
svn co https://glestae.svn.sourceforge.net/svnroot/glestae/trunk glest-svn
cd glest-svn/mk/linux/
chmod a+x autogen.sh
./autogen.sh
./configure
jam
cd /opt/
mkdir glest
chmod a+w glest
cd glest/
ln -s /opt/glest-svn/mk/linux/glestadv glest/glest
ln -s /opt/glest/glest /usr/local/bin/glest
ln -s /opt/glest-svn/mk/linux/glest_editor glest/glest_editor
ln -s /opt/glest/glest_editor /usr/local/bin/glest_editor
The Data should be downloaded as following:
cd /opt/
svn co https://glestae.svn.sourceforge.net/svnroot/glestae/data glest-data-svn
cd glest/
ln -s /opt/glest-data-svn/game/data/ glest/data
ln -s /opt/glest-data-svn/game/maps/ glest/maps
ln -s /opt/glest-data-svn/game/tilesets/ glest/tilesets
ln -s /opt/glest-data-svn/game/docs/ glest/docs
ln -s /opt/glest-data-svn/game/techs/ glest/techs
ln -s /opt/glest-data-svn/game/scenarios/ glest/scenarios
ln -s /opt/glest-data-svn/game/servers.ini glest/servers.ini
ln -s /opt/glest-data-svn/game/glestadv.ini glest/glestadv.ini
ln -s /opt/glest-data-svn/game/glest.ico/ glest/glest.ico
If you want to get a new version of glest:
cd /opt/glest-svn
svn update
Compile glest and glest-editor(See above)
cd /opt/glest-data-svn
svn update
-
The 'chmod's shouldn't really be needed, but changing permissions doesn't count as modifying a file, so SVN never updates them. I will remember to 'touch' all the shell scripts next I'm on the linux box, I promise.
Also, our data folder is incomplete :)
-
Some of the Devs still said that they forget to upload the tech contents. :-) So i hope it will be in the next time uploaded. If they upload the tech contents, then it should be fine to only execute "svn update" in my ToDo and all is fine with few traffic. :-)
-
The 'chmod's shouldn't really be needed, but changing permissions doesn't count as modifying a file, so SVN never updates them.
So you mean i should not chmod any of the downloaded files ? But the directory /opt/glest/ should be chmod, because of the ini files ? Otherwise i get an error. It would be nice if glest creates ini files in the home directory of the user, but it doesn't seem so. Any idea how to avoid this ?
-
Some of the Devs still said that they forget to upload the tech contents. :-) So i hope it will be in the next time uploaded.
Forgot that I hadn't uploaded rather than forgot to upload :P . It should be exactly the same as the one in vanilla glest's repository if you don't want to download everything again. http://glest.svn.sourceforge.net/viewvc/glest/trunk/data/glest_game/techs/magitech/factions/tech/
It would be nice if glest creates ini files in the home directory of the user, but it doesn't seem so.
I keep the entire Glest game directory in home so there are no issues with permissions. It could be something to look into though.
-
If you want download glest over svn and install system wide:
cd /opt/
svn co https://glestae.svn.sourceforge.net/svnroot/glestae/trunk glest-svn
cd glest-svn/mk/linux/
chmod a+x autogen.sh
./autogen.sh
./configure
jam
cd /opt/
mkdir glest
chmod a+w glest
cd glest/
ln -s /opt/glest-svn/mk/linux/glestadv glest/glest
ln -s /opt/glest/glest /usr/local/bin/glest
ln -s /opt/glest-svn/mk/linux/glest_editor glest/glest_editor
ln -s /opt/glest/glest_editor /usr/local/bin/glest_editor
The Data should be downloaded as following:
cd /opt/
svn co https://glestae.svn.sourceforge.net/svnroot/glestae/data glest-data-svn
cd glest/
ln -s /opt/glest-data-svn/game/data/ glest/data
ln -s /opt/glest-data-svn/game/maps/ glest/maps
ln -s /opt/glest-data-svn/game/tilesets/ glest/tilesets
ln -s /opt/glest-data-svn/game/docs/ glest/docs
ln -s /opt/glest-data-svn/game/techs/ glest/techs
ln -s /opt/glest-data-svn/game/scenarios/ glest/scenarios
ln -s /opt/glest-data-svn/game/servers.ini glest/servers.ini
ln -s /opt/glest-data-svn/game/glestadv.ini glest/glestadv.ini
ln -s /opt/glest-data-svn/game/glest.ico/ glest/glest.ico
If you want to get a new version of glest:
cd /opt/glest-svn
svn update
Compile glest and glest-editor(See above)
cd /opt/glest-data-svn
svn update
how do i fit in checkinstall with steps above in order to make a debian package on my debian 64 bit system so i can remove it anytime with apt?
-
Glest does not support makeinstall and thus checkinstall due to the fact that it uses jam :(
-
A couple glitches:
You're installing Glest and GAE to /usr/local without using sudo which, in most linux out-of-the-box distros will not work, since /usr is owned by root and thus are all of its sub-folders.
Sollutions:
A) Use sudo before every command (including the ones after the ; character) starting from step: mkdir /usr/local/games/glest This will however pose a security risk, as in order to actually play the game, you will have to run prefix it with sudo too (i.e. you will be running glestadv as root)! If you don't, no files can be written to /usr/local/games/glest and Glest will crash right on startup for not being able to create the file glest.log (and so will GAE I assume). And that file is not the only problem - the game will be unable to save anything to that folder.
It is unwise to run any command as root (e.g. prefixing it with the sudo command) unless it actually needs to be run so - in other words, something that would be a minor bug or glitch in GAE, with limited impact on your system might become a huge bug with serious consequences or even a possible backdoor for some malintended exploit.
See sollution for this sollution below. :P
B) Replace step: mkdir /usr/local/games/glest with this: sudo mkdir /usr/local ; sudo chown $USER:$USER /usr/local ; mkdir /usr/local/games/glestThis will make /usr/local owned by user/group <your-user>/<your-user-group>. From then on, all commands run inside /usr/local/games/glest can be run by your regular user (instead of root) and you won't need to run GAE (or Glest) as root.
HOWEVER, that raises another security-problem. Though Glest/GAE now has limmited access to your system and hence is able to do little damage, it can still damage your personal files and folders - this is usually an "acceptable risk" as all programs are enabled some control over your system (otherwise they would be pointless).
But the problem now is that you can write to that executable file (glest or glestadv)! Binaries in Linux are usually owned by root and only root can change them; but usually everyone can execute them (there are exceptions) which is fairly safe. But now you've allowed a ton of programs and other exploit-doors to change your program! Hence, though the damage is limmited, the risk of someone malintendedly messing with your file has been increased.
Sollution for the problem with sollution A:
-> Have a folder you can safely write to and make it used by Glest/GAE as the default data and settings directory!
The .deb package available from Ubuntu repos implements this through a small shell-script (that also takes care of other stuff). This is the version I changed to work with the /usr/local directory we installed GAE/Glest to, instead of the Ubuntu package default directories, /usr/share and /usr/lib:
Vanilla Glest:#!/bin/sh
# glest
MAINDIR=/usr/local/games/glest
DIR=$HOME/.glest
[ -d $DIR ] || mkdir $DIR
cd $DIR
if [ -f glest.ini ]; then
# Update for Glest 3.2.1
sed -i 's/\.lng//' glest.ini
language=$(cat glest.ini | grep Lang | cut -d'=' -f2)
[ -f $MAINDIR/data/lang/${language}.lng ] || \
sed -i "s/${language}/english/" glest.ini
else
cp $MAINDIR/glest.ini .
fi
[ -h glest ] || ln -s $MAINDIR/glest .
[ -f servers.ini ] || cp $MAINDIR/servers.ini .
for i in data docs scenarios techs tilesets; do
[ -h $i ] || ln -s $MAINDIR/$i .
done
[ -d maps ] || mkdir maps
cd maps
for i in $MAINDIR/maps/*; do
[ -h `basename $i` ] || ln -s $i .
done
cd ..
exec ./glest
GAE:#!/bin/sh
# glestadv
MAINDIR=/usr/local/games/glest
DIR=$HOME/.glest
[ -d $DIR ] || mkdir $DIR
cd $DIR
#if [ -f glestadv.ini ]; then # I could NOT get this to work properly for GAE. Hence
# # Update for Glest 3.2.1 # I just commented this out, which means that, if you
# sed -i 's/\.lng//' glestadv.ini # happen to messup your language settings, this script
# language=$(cat glestadv.ini | grep Lang | cut -d'=' -f2) # will not automatically fix it for you. You'll have to
# [ -f $MAINDIR/data/lang/${language}.lng ] || \ # manually fix it yourself.
# sed -i "s/${language}/english/" glestadv.ini
#else
# cp $MAINDIR/glestadv.ini .
#fi # End of commented-out language-setting routine.
[ -h glestadv ] || ln -s $MAINDIR/glestadv .
[ -f servers.ini ] || cp $MAINDIR/servers.ini .
for i in data docs scenarios techs tilesets gae_scenarios ; do
[ -h $i ] || ln -s $MAINDIR/$i .
done
[ -d maps ] || mkdir maps
cd maps
for i in $MAINDIR/maps/*; do
[ -h `basename $i` ] || ln -s $i .
done
cd ..
exec ./glestadv
As you can see, I got some problems with automating the language settings for GAE. Hence I just commented that part out. If you can find a sollution, please post it (note: I did try and make a link english -> english.lng or english.lng.lng, also tried putting english.lng in the $HOME/.glest/glestadv.ini file instead of english. Either of these do solve the initial problem of glestadv crashing on startup; however, if you then go to the "Options" menu-item, GAE will crash with a somewhat similiar message as before).
Another issue regards the GAE Scenarios with Glest 3.2.2 - I could not get the Glest scenarios to work with it. For details, see this post (https://forum.megaglest.org/index.php?topic=3454.msg30326#msg30326).
-
Thanks!
I wasn't so sure about some unix permissions to certain directories but I am now ;)
I will update the guide shortly
-
You're welcome!
And BTW, I do think this topic should be stickied too!
I tried a couple of the stickies in the GAE section to install it and could get nowhere (at lest not fast! :D ). This one was the one! ;)
And it should help to compile your own vanilla Glest too, of course... ;D
-
Yeah, no one check this part of the forum very much :(
Do you know the dependencies for glest?
-
Did you try PMing this section's moderator?
For the dependencies, you can check the file mk/linux/config.log. All programs, libraries and headers glest needs to be built will have been checked and their results posted there. Assuming you successfully compiled it, that would mean all dependencies are listed in there - you'll have to parse some irrelevant output to get only what you want though...
As a general clue, the fact you have say package xorg (what you'll need in case configure tells you it couldn't find X) doesn't mean you'll have xorg-dev (which is what you actually need in order to build something that'll use X!).
So, if you know you have something that configure tells you you don't, chances are you are just missing the "dev" (development) package of it. ;)
-
Oh, thanks!
I will add dependencies when the next version of gae is out.
Do you know who this sections moderator is?
-
Just PMed you. ;)
-
Thanks for the credit, assassin! :-[
UPDATE 1: BTW, I just realised there was something not so great about one of my suggestions:
sudo mkdir /usr/local ; sudo chown $USER:$USER /usr/local ; mkdir /usr/local/games/glestwould avtually be better this way:
sudo mkdir /usr/local/games/glest ; sudo chown $USER:$USER /usr/local/games/glest(It's probably more system-wide secure and also doesn't go over this guide's reader's choices (or knowledge) regarding EVERYTHING in /usr/local (he/she may want to have other stuff besides glest/gae with different ownerships in there...)
UPDATE 2: Also, as you took that aproach, the scripts I gave you do not really increase the security of the system (they do work for automatically setting up the user-sepcific settings though)... But you can work around that by making /usr/local/games/glest owned by root again (after you've copied everything to it)... ;)
sudo chown root:root /usr/local/games/glestOf course, you will from now on need to use the sudo command and input you administrator password to add any data to your /usr/local/games/glest folder, but that's the proper way to do it anyways. ;) Though there is a more elegant alternative but it takes a little longer to setup...
UPDATE 3: Finally, the vanilla glest scenarios do not work out of the box with gae (details here (https://forum.megaglest.org/index.php?topic=3454.msg30326#msg30326)).
The easy sollution is to setup the GAE specific gae_scenarios folder as follows:
sudo mkdir /usr/local/games/glest/gae_scenarios
sudo ln -s /usr/local/games/glest/scenarios /usr/local/games/glest/gae_scenarios/scenariosNOTES:
* If the above is done before changing the ownership of /usr/local/games/glest back to root, you can omit the "sudo" commands.
* In-game, you will notice you have only one category of scenarios, called "All_scenarios". If you want to have your scenarios organized in different categories, just create one folder for each category you want inside folder gae_scenarios and move the scenarios you want for that category in there. E.g.:sudo mkdir /usr/local/games/glest/gae_scenarios/megapack_v4
ln -s /usr/local/games/glest/scenarios/m4* /usr/local/games/glest/gae_scenarios/megapack_v4 (you will now have a new category containing only Titi's Megapack v4 scenarios. ;) )
-
Cool, I'll update tomorrow.