On Thu, Sep 20, 2007 at 10:47:31AM +0100, Mark Rogers wrote:
I sometimes find I need to build applications from source for use on a live server. I don't like the idea of installing build tools on the server, so I want to create a virtual machine on my desktop to build the applications so all I need to do is install them on the server.
As a specific example, I have an Ubuntu-based mail server using postfix (installed from repositories). However, I need to add virtual mailbox quota support, using the patches here: http://vda.sourceforge.net/
So my theory is that I can create a new Ubuntu VM, install the postfix source package and compile tools, apply the patch, then build the .deb from that to install on the live server, replacing the version in the repositories.
Is that a sensible approach? If yes, although I have a rough idea what is needed I'm on the edge of my knowledge. Once I have the source installed and patched (assuming that the instructions with the patch help me get that far!) how do I then build the .deb, and how to I install it so that it doesn't conflict with the existing package from the repositories?
You'll be wanting to learn about how debian packages work, mostly! It's worth reading the developers reference and nm guide from http://www.debian.org/devel/ to get a feel for it, the nm guide is probably going to be the most use to you at this stage.
Basic idea would be to do: apt-get source postfix
Then change in to the directory it's just created, add the patch (depending on the way postfix is packaged it might just be a case of dropping the patch in to the debian/patches directory, otherwise you can probably get away with just using patch in the normal way), then edit the debian/changelog, preferably by using dch -i or similar, and change the version number to something you specific. (dch is in the devscripts package). To build the package use dpkg-buildpackage -rfakeroot.
That should give you a reasonable hint to how to do it, *always* test the packages before going in to production with them, though.
Cheers,