Linux – Compiling and building Linux packages for multiple distributions / platforms

linuxpackage-management

My company has a software product that's written in C for a Linux platform, built with autotools and distributed via binary packages. To make the binaries, we first produce a source RPM and then compile the source from the SRPM.

Currently we only provide RPM packages for 64-bit Fedora 10, but we want to start providing packages for multiple Linux distributions – 32-bit as well as 64-bit – and possibly different versions of each distribution as well (e.g. Fedora 11 as well as Fedora 10).

I've heard that the best way to produce builds for multiple Linux flavours is to have a single build server and use a different chrooted environment for each set of packages that you want to build. Does anyone have a good resource that explains this in more detail, maybe with examples of well known projects that use this build mechanism, or have a better alternative to achieve the same goal ?

NOTE – I'm fairly familiar with how to use tools like checkinstall to produce packages in the right format for different distros. What I'm less familiar with is how to compile the same code multiple times on the same machine and end up with the correct binary files for each distro that I want to package for.

Best Answer

I highly recommend you look into the openSUSE Build Service. They've got all the various distros and architectures set up in Xen virtual servers, and they support a wide variety of packages, including RPM and DEB formats. It will save you loads of time and hassle setting up every one of those servers yourself, much less the time it'd take to get all of the includes and build-depends right.

http://en.opensuse.org/Build_Service

Edit: As a side note, if you have security concerns, you can download the code and set up an OBS on one of your own servers instead of using the public ones.

Related Topic