Using Lenny to Build Jaunty Packages

The process for building debian packages is actually very well documented, though many of the tutorials you will find are aimed at people who are packaging third-party software instead of their own.

Also, I'm running on Debian's Lenny, and I need to produce packages that install cleanly on Ubuntu's Jaunty Jackalope. It sounds worse than it is.

Take this with a grain of salt --- it works for me, but I'm certainly not an expert in this area.

Steps:

  1. Debianize each package. (Here's an excellent quick and dirty guide to getting a package created.)
  2. Build the packages: (cd MYPROJECT; fakeroot ./debian/rules binary). Don't distribute these packages, they are probably wrong! But this is the quickest way to get everything mostly-working.
  3. Sanity check the packages: dpkg-deb -c MYPROJECT.deb; dpkg-deb -I MYPROJECT.deb; dpkg -i MYPROJECT.deb
  4. Check in your MYPROJECT/debian/ directory to source control (e.g. git, svn, etc).
  5. This is the tricky step, and one that I didn't see explicitly documented.You need a version of debootstrap that knows about ubuntu distributions. (Ubuntu debootstrap knows about Debian, but not the other way around.)

    1. Download the jaunty (or whatever ubuntu version) debootstrap source package. Grab the .dsc and .tar.gz from that page.
    2. Run dpkg-source -x debootstrap_1.0.20~jaunty1.dsc -- this extracts the source.
    3. (cd debootstrap-1.0.20~jaunty1; debuild -uc -us) -- this will build a .deb you can install on your lenny machine. Install package "devscripts" if you don't have debuild.
    4. sudo dpkg -i debootstrap_1.0.20~jaunty1_all.deb
  6. Install pbuilder. This will help you build the packages in a clean chroot -- i.e. without all the pollution you have on your machine that could be making the packages work even though they will break on your users' machines.

  7. Put the code found here in your ~/.pbuilderrc.
  8. Apply this sudoers change (optional but convenient).
  9. sudo DIST=jaunty pbuilder create ... then wait. (If you have lame internet service (Hughes) and a daily bandwidth cap, you may want to schedule this for the free-for-all period: echo sudo DIST=jaunty pbuilder create | at 2:30am tomorrow)

If you see anything I'm missing or would like to add, please drop a comment below. Thanks!

Posted on 2010-05-13 by brian in tools .
Comments on this post are closed. If you have something to share, please send me email.