[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Understanding Rules File



On Sat, Aug 28, 2021 at 05:22:26AM +0000, Ryan McClue wrote:
> At a high level I understand that the debian/rules file instructs
> debhelper as to how to build your package. However, I'm confused
> regarding these two points:
This may be true in some way but to me it sounds like a wrong layering.
debian/rules is a file that, when run in a certain ways, generates a .deb.
To do this it will most likely (but not necessarily) call some helpers,
most of those are a part of the debhelper suite, but most of the helpers
just move files around or call other commands, and the lowest level are
the upstream build system for the compilation part and dpkg-* commands
from dpkg-dev for the building .deb, .changes etc. part.

> 1. Why is debhelper used? Why not just explicitly state in the
> debian/rules file how to build your package with either direct shell,
> e.g. gcc file.c -o file, or with a buildtool, e.g. cmake --build . etc.
> Why the level of indirection?
So that you don't need to write specific commands for each package.

> 2. How does debhelper work? Is there a way I can see what specific
> commands it is executing,
Yes, just read the build log. dh(1) prints which commands it executes. If
you set DH_VERBOSE=1 in the rules you should also see what do debhelper
helpers do in more details.


> e.g. what does the default %: dh $@ actually
> equate to?
You can run `dh <target> --no-act` for each <target> you want (build,
clean, binary etc.) to see what will dh(1) run for that target.

-- 
WBR, wRAR

Attachment: signature.asc
Description: PGP signature


Reply to: