I've been inspecting different howto's and guides on how to build packages lately. And there seems to be a lot of ways one could go about it. So I'm a bit confused about what exactly to use. That is I'm trying to see the whole picture. What tools exist? What are the relationships between them? Which are wrappers for which? Which are better suited for what? Like, apt-get source
is probably mainly targeting users, not developers. Better alternative must be dget
. Which are the alternatives for which? To name a few there are pbuilder
, pdebuild
, pbuilder-dist
, cowbuilder
, sbuild
, debuild
, dpkg-buildpackage
, fakeroot
. And there must be a lot more I don't even know about. What are the most common workflows?
What I managed to find out. First, there is this brief description which is what I mostly ask here.
At the core of the build system lies
dpkg-buildpackages
, which usesfakeroot
, which in its turn runsdebian/rules
(which is a makefile) to bulid a package. And that might be enough if you're going to build a package for internal use for the release you're running it in.If on the other hand you're aiming at contibuting to
debian
/ubuntu
, you're going to use at leastdebuild
, which runslintian
and signs the files.If you want to target different
debian
/ubuntu
releases, you're going to usepbuilder
, which among other things builds packages in a clean environment not clobbered with your already installed packages to see the actual dependencies. One might consider usingpbuilder-dist
to simplify matters even more.There's
pdebuild
which is said to be "pbuilder way of doing debuild". I don't see it runninglintian
, but that might be not in line withpbuilder
way.Then there's also
cowbuilder
, if you want to speed up building packages (wrapper aroundpbuilder
?). There are also tools for building fromgit
repositories, I haven't dug into.UPD I'm told on
#debian-mentors
that "sbuild
behaves the same as thebuildd
, less surprises", that "pbuilder
's support for experimental is just wrong", that "OTOHsbuild
still misses something to take away network from the build process", and thatpbuilder
is not maintained. Taking away network is needed since building packages should not rely on it being present, they shouldn't download anything.schroot
from experimental is supposedly able to isolate (unshare) network.You do not say much about your source environment.
If it is open source and just one project (one control file under the
debian/
directory) then https://launchpad.net is a really good solution. More or less, you have to get the files right and they take care of the rest.Getting the files right is a little bit of magic for me, even now, but there is a plethora of documentation on how to create a package. You could start with a very simple example that works and then take the time to add other options/features as you move forward. That way you do not have to learn all the ins and outs all at once.