Reworking .deb - Does debian/rules really need to be a makefile?

Submitted by gwolf on Tue, 03/13/2007 - 11:17
Eddy Petrisor wrote quite an interesting text about the shortcomings of the .deb packaging format, specially comparing it to Gentoo's ebuilds. And, basically, it all comes down to this phrase:
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
Now... Is debian/rules really expected to be a makefile, or it is just customary for it to be so? Look at the very top of your rules files - you will see they (at least, almost) always start with #!/usr/bin/make -f - That means, of course, that you can omit the fact they are makefiles. While packaging/debugging, I often run -say- fakeroot debian/rules build && fakeroot debian/rules clean. That, my friend, is closer to the invocation you often use for a shell script than for a makefile. I don't know if we have tools that rely on having rules called via make (and that should be easy to correct if needed), but I really don't see it problematic at a first glance to create packages based on something different than a makefile. Recently, I've been tempted by CDBS. I still don't fully understand its flow, and it's still mostly a dark-magic beast for me, but at least I am comfortable using it for my everyday packaging work (hey, pkg-perl group, I'll be bugging you again with my weird ideas soon ;-) ), but it surely has the advantages you quote in your message: It takes part of the complexity away. Of course, it introduces some extra bits. By using CDBS, the packaging entry level is considerably lowered - but the real understanding of properly maintaining a package becomes somewhat more difficult. Or is it just me clinging to the comfort of having learned my way around writing debian/rules?
( categories: )
Eddy Petrisor's picture

Re: Reworking .deb - Does debian/rules really need to be a makef

Yes, it is, see the policy: http://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules
Gunnar's picture

Yes, it's in the policy, but...

Do the _tools_ really need it to be so? If not, remember the policy only documents existing behaviour :)