(Update: Yes,
Gunnar, the policy says that the
debian/rules file must be a makefile, so if you do something else, you have a serious bug because of a policy break. Of course, probably there is nothing that should stop one from using, let's say bash, or python or perl, from a technical PoV.)
Erich has a wish list for Lenny.
What draw my attention was the very first "
define and deploy a standard way of packaging software, that can be used for like 90% of packages", later he mentions rationale "
other distributions (e.g. *BSD ports, Gentoo?) are ahead of us in this respect, having a standard way of packaging and building things and keeping track of changes."; these two quotes contain the real essence of
Gentoo's success in the area of fast development.
A half a year ago I did an experiment in packaging a
rpm, a
deb and an
ebuild for the same piece of software. What I observed back then made me think a lot about the entry level knowledge needed for a person to create a decent package for those types of package systems.
With the risk of being flamed by many people that will miss my point, I will tell you from the start that the deb would have been the most painful if had to start from scratch. Second would have been the rpm due to lack of good/updated documentation and the clear winner in lack of pain points was the
ebuild. In reality places were switched between the deb and the rpm.
And before I start,
please understand that what I want to point out is that the building system in
debian is showing its age and we should do something about it, and is not about pointing people to documentation; it is about making things behave more sanely by default and not about having to read a whole day to understand why the package fails to install a file you just added then to find that you had to add the destination path to a
debian/
dirs file etc...
The deb had to be the
most difficult. Not because I didn't do it before, or because it was hard, but because there are a lot of things that need to be done because the package management is not smart enough to do it by default (i.e. class
inheritance does not exist, like is the case for the
ebuilds or the macros for
rpms).
The Debian approach is backwards, is reversed with regard to the others and the way it should be by default, to allow easier understanding of the packaging. You can, by default, make a package that is tweaked a lot. There is no concept (if you don't count
cdbs which is boo-ed a lot by some people) or possibility to just say "
make this package a package that is a standard linux app with the regular ./configure && make && make install recipe". And I don't count such a recipe the templates based on
dh_make, that is way too verbose. A new maintainer wannabe has difficulties understanding
why are those lines in there, and
what they do, and most importantly, why is
that order correct and no other. Another question which is legitimate is "
is that the minimum or can that be trimmed"? (Follow
debian-mentors and see how many people leave the .ex files just because they are afraid they will not know how to generate them again.)
Even the rpm has a concept of standard stuff to do for a package, there are some macros that implement that. And that is more logical for an
untainted mind (as in not yet
debianized) than what we have in the
dh_make template, or worse, a clean and new
debian/rules file. Why should one care to learn the ways and philosophy of make
just to make a small package?
Let me tell you something that will feel like knife stab for many people in our community:
the clear winner was the ebuild, not because I was smart or exciting, but because:
- it was dead simple to make a working one
- the documentation is really verbose and complete
- there is a default behaviour for every ebuild, even for a minimalist ebuild
- if your ebuild has a special need, the ebuilt can override the default behaviour by redefining the function (target, in debian/rules-speech), but you don't need to, in most cases
- there are some already defined classes which can be inherited to obtain a tweaked default behaviour (imagine typical cmake build system, typical autotools build system, typical kde build system - and iirc, this can include build dependencies)
- all the information about the package is centralized in one file which is human readable from the start, plus that is obvious, or one can understand fast what a field/function/variable means from the start, without digging through the documentation continuously
I did the
ebuild in one day's work (it was less, but some will not believe me, so I'd say 1 day is reasonable enough) starting from absolutely 0 knowledge about the packaging system (if you don't count knowing to
emerge package as knowledge).
What is done properly in the portage system is the fact that there are some
default classes which your
ebuild can inherit to behave more like a certain type of packages (base - a generic recipe, gnome,
kde, games,
sourceforge - they download tarballs directly, if needed - ...)
Why this is not possible for deb right now? Simple, we have it as a rule in the policy that the
debian/rules file is a
makefile. So even if one would implement a class-like model for deb packages, you'd still have the
debian/rules file as a make file...
Gentoo implemented initially portage's default behaviour (and as a consequence, the "classes") in shell, later they migrated some parts to python and the whole portage is implemented in python now (while classes are implemented in bash). I am not saying that we should put python in essential, God forbid, probably the
emdebian guys would stab me :-), I am saying that possibilities exist, alternatives should be possible.
I know, some will just say "show me the code", "making such a change over the entire archive is insane" or "the
makefile is a really good way to do things like installing and building, after all, that's what it was designed for". Yes, all of these will miss the point, which is
having nothing-to-do as a default policy for a package is a bad policy, it should be
an empty/default package will use a standard recipe to build itself, and that recipe should be implemented in the build system.
And if you still don't believe me, just look at these few
ebuilds and tell me you'd not be able to write them after a quarter after seeing one the first time and
skimming over the docs or/and knowing what a regular
gentoo user knows (what a keyword is, what is a slot). Also compare with the
debian counter parts and don't forget the different building aids that we have.
http://sources.gentoo.org/viewcvs.py/gentoo-x86/games-arcade/amphetamine/amphetamine-0.8.10.ebuild?view=markuphttp://svn.debian.org/wsvn/pkg-games/packages/trunk/amphetamine/debian/rules?op=file&rev=0&sc=0http://svn.debian.org/wsvn/pkg-games/packages/trunk/amphetamine/debian/control?op=file&rev=0&sc=0http://svn.debian.org/wsvn/pkg-games/packages/trunk/amphetamine/debian/postinst?op=file&rev=0&sc=0http://sources.gentoo.org/viewcvs.py/gentoo-x86/games-arcade/holotz-castle/holotz-castle-1.3.8.ebuild?rev=1.3&view=markuphttp://svn.debian.org/wsvn/pkg-games/packages/trunk/holotz-castle/debian/rules?op=file&rev=0&sc=0http://svn.debian.org/wsvn/pkg-games/packages/trunk/holotz-castle/debian/control?op=file&rev=0&sc=0http://sources.gentoo.org/viewcvs.py/gentoo-x86/games-arcade/late/late-0.1.0.ebuild?rev=1.10&view=markuphttp://svn.debian.org/wsvn/pkg-games/packages/trunk/late/debian/rules?op=file&rev=0&sc=0http://svn.debian.org/wsvn/pkg-games/packages/trunk/late/debian/postinst?op=file&rev=0&sc=0http://svn.debian.org/wsvn/pkg-games/packages/trunk/late/debian/postrm?op=file&rev=0&sc=0http://sources.gentoo.org/viewcvs.py/gentoo-x86/games-arcade/ppracer/ppracer-0.3.1.ebuild?rev=1.15&view=markuphttp://svn.debian.org/wsvn/pkg-games/packages/trunk/ppracer/debian/rules?op=file&rev=0&sc=0One more thing, the
ebuilds mostly need not be updated when an upstream release occurs, they just need to be copied and given a different
filename.