I have run into some problems creating Debian packaging for a shared library. The application contains a Doxyfile which is used to generate documentation for the library. I would like to create a libfoo-doc package which includes the documentation.

In order to generate the documentation, I have the following lines in debian/rules:

#!/usr/bin/make -f

    cd $(DESTDIR)/share/doc/libfoo-doc ; doxygen

    dh $@

However, this target never gets built, despite what this page claims:

"The binary target must be all that is necessary for the user to build the binary package(s) produced from this source package. It is split into two parts: binary-arch builds the binary packages which are specific to a particular architecture, and binary-indep builds those which are not."

I also tried changing build-indep to installdocs but that made no difference.

What target do I need to use for generating documentation?


You're looking for override_dh_build-indep From the manpage for the dh command Manpage icon

       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.)

Regarding the Policy bit... A build-indep target is being called, just not your build-indep target.

| improve this answer | |
  • Thanks! Would it be better to use override_dh_build-indep or override_dh_installdocs? Both seem to work. – Nathan Osman Apr 8 '13 at 16:58
  • I think override_dh_build-indep fits the bill better as you are building the docs. dh_installdocs installs documentation into package build directories. It handles thing like making sure debian/copyright get installed. So if you over-ride that to do something else in that target, make sure that you also call dh_installdocs in the override target (I know that sounds ridiculously circular, but it works). – andrewsomething Apr 8 '13 at 18:00
  • You were absolutely right - I was getting Lintian errors about debian/copyright being missing when overriding dh_installdocs and wondered why. I'll go with override_dh_build-indep then. – Nathan Osman Apr 8 '13 at 22:16
  • Now I've run into another problem: override_dh_build-indep isn't being built. – Nathan Osman Apr 9 '13 at 0:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.