Cross-building with Debian

Note: this documentation is fairly old, and is probably out-of-date. I haven't needed to cross-build a Debian package in a long time.

This was a pain. I needed to do it for ncompress because the autobuilders don't build for non-free, and nothing moves from unstable to testing unless it builds on all of the arches it's currently available for. Solution? Build for as many as possible by hand, and then ask ftp-master to remove the ones that can't be built.

How do I build? Two ways - either look for a machine that runs sid or look for a machine that runs woody but is listed as (+chroot):

   http://db.debian.org/machines.cgi

I used the following machines:

   alpha    escher.debian.org    chroot
   arm      debussy.debian.org   chroot
   hppa     paer.debian.org      sid (but use chroot)
   ia64     merulo.debian.org    chroot
   mips     casals.debian.org    chroot
   powerpc  voltaire.debian.org  sid (but use chroot)
   s390     trex.debian.org      chroot
   sparc    vore.debian.org      chroot
   m68k     crest.debian.org     chroot

To get into a chroot on a machine that has one, you use:

   dchroot unstable

You could also use stable, oldstable, etc. as needed. I've updated my ~/.profile to put the name of the chroot environment in the prompt. I got this from /etc/debian_chroot.

Since the .dsc and .orig.tar.gz files have already (presumably) been uploaded by the i386 build, you can't upload them again. You can only make this work with the -b option to dpkg-buildpackage. Also, it's not a good idea to have your secret key on a machine you don't control - so, you should be taking the changes file back home and signing it by hand.

   dpkg-buildpackage -b -uc -us -rfakeroot -i
   gpg --clearsign <changefile>

When I download everything (the build files and everything) then these three steps accomplish the signing and leave me just the files I need to upload.

   gpg --clearsign *.changes
   mv *.asc *.changes
   rm *.diff.gz *.orig.tar.gz

It's not too bad. Using an autobuilder would be nicer, though. :-(

DebianCrossBuild (last edited 2010-05-28 16:58:54 by KennethPronovici)