Hi all,
short tutorial about creating a ready to install .deb for Debian stable/testing.
Perhaps somebody needs this. If not, this is for my own mind :-D
Tested with Debian Testing(Wheezy) on amd64.
First install the dependencies, you need:
Code:
sudo aptitude install cmake bzr libsdl1.2-dev libsdl-mixer1.2-dev liblua5.2-dev libminiupnpc-dev libcurl4-gnutls-dev libbz2-dev gettext
I also had to symlink lua:
Code:
sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.2.a /usr/lib/liblua5.2.a
Navigate to a place, where you want to store the source and checkout: (takes some minutes)
Code:
bzr branch lp:s25rttr
Go to the build dir and try to start ./cmake.sh
Code:
cd s25rttr/build
./cmake.sh
If everything is fine you can start compiling with: (took me less then 10 Minutes on a Core2Duo laptop with 3GB RAM)
Code:
make -j3
If you get 100% and no errors (ignore some warnings :-D) you have sucessfully build s25rttr. :-)
NOW you can either install it directly to your system:
Code:
sudo make install
OR
Create a ready to install .deb-package:
Code:
sudo aptitude install checkinstall
This should create the package without install it to your system, replace $revision withe actual number(e.g. 8493) and $version with the date ( e.g. 20121110).
I searched for a way to fetch these two variables automatically, found this in bzr, propaply there is a much safer way to do this:
Code:
lastrevision=`exec cat ../.bzr/branch/last-revision`
version=`echo $lastrevision | awk -F- '{sub("-","");print $2}' | cut -c1-8`
revision=${lastrevision% *}
And start:
Code:
sudo checkinstall --install=no --pkgname=s25rttr --pkgrelease=$revision --pkgversion=$version --pkglicense=GPLv3 --pkggroup=games --maintainer=$whoami --nodoc --backup=no
If checkinstall do its job without errors you will get a .deb in the builds-dir. Install it with:
Code:
dpkg -i build/s25rttr_20121110_8493_amd64.deb
Dont forget you need the original game data to play this wonderful game, before you can play put the the DATA and GFX dirs to:
Code:
/usr/local/share/s25rttr/S2/
and set the permissions:
Code:
sudo chmod 755 -R /usr/local/share/s25rttr/S2/
Last but not least a script you can place in s25rttr/ to fetch the newest version, compile and generate the deb:
Code:
bzr pull
lastrevision=`exec cat .bzr/branch/last-revision`
version=`echo $lastrevision | awk -F- '{sub("-","");print $2}' | cut -c1-8`
revision=${lastrevision% *}
cd build/
./cleanup.sh
./cmake.sh
make -j3
sudo checkinstall --install=no --pkgname=s25rttr --pkgrelease=$revision --pkgversion=$version --pkglicense=GPLv3 --pkggroup=games --maintainer=$whoami --nodoc --backup=no -y
Have fun! And please report, if somehting is wrong here. Thanks
Greetz,
scheich
Editiert von
scheich am 06.01.2013 16:13