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:
- Debianize each package. (Here's an excellent quick and dirty guide to getting a package created.)
- 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. - Sanity check the packages:
dpkg-deb -c MYPROJECT.deb; dpkg-deb -I MYPROJECT.deb; dpkg -i MYPROJECT.deb
- Check in your MYPROJECT/debian/ directory to source control (e.g. git, svn, etc).
-
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.)
- Download the jaunty (or whatever ubuntu version) debootstrap source package. Grab the .dsc and .tar.gz from that page.
- Run
dpkg-source -x debootstrap_1.0.20~jaunty1.dsc
-- this extracts the source. (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.sudo dpkg -i debootstrap_1.0.20~jaunty1_all.deb
-
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.
- Put the code found here in your ~/.pbuilderrc.
- Apply this sudoers change (optional but convenient).
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!