How to create the Linux package

Since creating an executable binary of any program that runs across several distributions is quite a problem, we use autopackage's apbuild to solve some of the problems. If the process gives no problem, it's pretty straightforward; but these are many steps, and are listed here as a reference.

This assumes you got the sources from SVN and that you can use a command-line interface. You will also need to have gcc version 3.2 or 3.3 *and* 3.4 or higher because of the c++ ABI compatibility problem.

Warning: these instructions were written for version 0.6, so it won't work with earlier versions and most likely will have to be modified a bit for next versions. Also please note that if you do find a problem and it's not your fault, most likely fixing it will take a great deal of time.

Contents

Instructions

Install autopackage
    % make install
Build STK
    % sh autogen.sh
    % CC=apgcc CXX=apg++ sh configure
    % make clean all
    % cd src/
    % apg++ -O2 -Wall -Ibullet/src -o supertuxkart *.o -L. -lstatic_ssg /usr/lib/libplibjs.a /usr/lib/libplibsl.a
      /usr/lib/libplibssg.a /usr/lib/libplibpu.a /usr/lib/libplibfnt.a /usr/lib/libplibsg.a /usr/lib/libplibul.a
      /usr/lib/libplibssgaux.a -Lbullet/Demos/OpenGL -lbulletopenglsupport -Lbullet/src -lbulletdynamics
      -lbulletcollision -lbulletmath -Lenet -lenet -lglut -lGL -lSDL -lSDLmain /usr/lib/libalut.a
      /home/coz/Desktop/Descargados/openal-soft-1.6.372/libopenal.a /usr/lib/libvorbisfile.a /usr/lib/libvorbis.a
      /usr/lib/libogg.a
    % strip supertuxkart
Creating the compressed archive

That's it. If there are any missing steps or problems with this, contact the mailing list.

A final note

Ideally you should build yourself each dependency to be static linked (for example, libvorbisfile.a, libopenal.a ), instead of using your system's provided libraries, and even more if you use a source-based distro like Gentoo; I have had problems with the dependencies even with systems running on the same processor type.

If the maker of the dependency provides a binary of some sort for development( like in the case of OpenAL ), you should use it instead of compiling the dependency yourself.

Remember to test your package among a wide variety of distros if you can.

Troubleshooting

I have had cases where I had to fix permission problems with apbuild first; a dangerous/risky alternative to fixing this is to use the root user or sudo for steps where you have trouble.

By default, gcc will link to dynamic libraries instead of the static libraries. Also, plib by default only provides static libraries, so when you build STK with bindings to dynamic libraries, it won't work on installations only with the static libraries. The steps which links manually before 'strip supertuxkart' when building STK should take care of this, but you could have forgotten about doing it. Thanks to Christian Zigotzky (Xeno74) for the fix for this problem.

Verify that your have the static libraries, they end with the .a suffix. Some distros provide packages which will only build the dynamic libraries, and some libraries build the dynamic version by default( for example, at the moment of this writting, openal ). That doesn't means they can't be built statically, it just means you'll have to get the static library somehow, the easiest way is to download the sources of the library and compile the static version yourself. Usually this is pretty straight forward.

Retrieved from "http://supertuxkart.sourceforge.net/How_to_create_the_Linux_package"

User Tools