Default sequence of debhelper

lan*_*oxx 2 debhelper

I am trying to get a better understanding of debhelper's dh tool. As I understand it, dh is a frontend for various dh_* helper tools. These helper tools can both be called standalone or automatically from the dh tool. Usually a debian/rules file is created which somehow invokes dh and possibly overrides certain dh_* invocations. dh then seems to know which of the dh_* tools it needs to invoke and in which sequence.

The example under /usr/share/doc/debhelper/examples/rules.tiny contains the following as an example for a debian/rules file:

#!/usr/bin/make -f
%:
    dh $@
Run Code Online (Sandbox Code Playgroud)

What is the sequence of dh_* helper tools that gets executed by dh as result of this rules file? And more importantly, how does dh determine this sequence and where is this documented.

the*_*aul 6

将要执行的辅助工具的顺序取决于以下几点:

  1. 正在传递什么构建目标。这些包括:build-archbuild-indepbuildcleaninstall-indepinstall-archinstallbinary-archbinary-indep,和binaryDebian 政策 §4.9中讨论了(大部分)这些的含义。
  2. Debhelper 兼容级别(在debian/compat文件中找到)
  3. 您的 Debhelper 版本(尽管在相同兼容级别的情况下,会努力使不同版本的工作方式相同)
  4. 自上次清理以来已经运行了哪些辅助命令(在 debhelper 兼容级别 9 及更低级别)
  5. 正在使用什么插件(--with--without选项)
  6. 生成文件中存在哪些覆盖目标(例如override_dh_auto_test

如您所见,对于所有可能的构建目标和配置安排(甚至只是最常见的),记录运行哪些命令、以何种顺序运行可能会令人困惑。因此,知道的方法是使用--no-act参数 to dh,并按照您希望的方式设置构建目录。

这是一个示例,在binary我刚刚使用的虚拟构建目录中运行目标dh_make,并将其放入兼容级别 10。您将看到的确切命令或确切顺序可能会略有不同:

~/dh-demo$ dh binary --no-act
    dh_testdir
    dh_update_autotools_config
    dh_autoreconf
    dh_auto_configure
    dh_auto_build
    dh_auto_test
    dh_testroot
    dh_prep
    dh_installdirs
    dh_auto_install
    dh_install
    dh_installdocs
    dh_installchangelogs
    dh_installexamples
    dh_installman
    dh_installcatalogs
    dh_installcron
    dh_installdebconf
    dh_installemacsen
    dh_installifupdown
    dh_installinfo
    dh_systemd_enable
    dh_installinit
    dh_systemd_start
    dh_installmenu
    dh_installmime
    dh_installmodules
    dh_installlogcheck
    dh_installlogrotate
    dh_installpam
    dh_installppp
    dh_installudev
    dh_installgsettings
    dh_bugfiles
    dh_ucf
    dh_lintian
    dh_gconf
    dh_icons
    dh_perl
    dh_usrlocal
    dh_link
    dh_installwm
    dh_installxfonts
    dh_strip_nondeterminism
    dh_compress
    dh_fixperms
    dh_strip
    dh_makeshlibs
    dh_shlibdeps
    dh_installdeb
    dh_gencontrol
    dh_md5sums
    dh_builddeb
Run Code Online (Sandbox Code Playgroud)