我需要使用debian / rules中的哪个目标来生成文档?

我遇到了一些为共享库创建Debian打包的问题。 该应用程序包含一个Doxyfile ,用于生成库的文档。 我想创建一个包含文档的libfoo-doc包。

为了生成文档,我在debian/rules有以下几行:

 #!/usr/bin/make -f build-indep: cd $(DESTDIR)/share/doc/libfoo-doc ; doxygen %: dh $@ 

但是,这个目标永远不会被构建,尽管这个页面声称 :

“二进制目标必须是用户构建从此源代码包生成的二进制包所需的全部内容。它分为两部分:binary-arch构建特定于特定体系结构的二进制包,以及binary-indep构建那些不是。“

我也尝试将build-indep更改为installdocs但这没有任何区别。

我需要使用什么目标来生成文档?

您正在寻找override_dh_build-indep来自dh命令的联机帮助页 Manpage图标

 OVERRIDE TARGETS A debian/rules file using dh can override the command that is run at any step in a sequence, by defining an override target. To override dh_command, add a target named override_dh_command to the rules file. When it would normally run dh_command, dh will instead call that target. The override target can then run the command with additional options, or run entirely different commands instead. See examples below. (Note that to use this feature, you should Build- Depend on debhelper 7.0.50 or above.) Override targets can also be defined to run only when building architecture dependent or architecture independent packages. Use targets with names like override_dh_command-arch and override_dh_command-indep. (Note that to use this feature, you should Build-Depend on debhelper 8.9.7 or above.) 

关于Policy位…正在调用build-indep目标,而不是build-indep目标。