dh_ocaml(1)

NAME

dh_ocaml - calculates OCaml packages dependencies

SYNOPSIS

dh_ocaml [debhelper options]

DESCRIPTION

dh_ocaml is a debhelper program that is responsible for filling the
${ocaml:Provides} and ${ocaml:Depends} substitutions and adding them to substvars files. It also adds postinst and postrm scripts for
maintaining system registry of OCaml md5sums where required.

dh_ocaml acts on two kinds of binary packages: those shipping
development part of OCaml libraries (usually named libXXX-ocaml-dev),
and those shipping OCaml bytecode non-custom executables (i.e.
executables interpreted by /usr/bin/ocamlrun).

On OCaml library packages dh_ocaml will firstly look at OCaml objects
(files matching *.cm[ao]) shipped by the package. Then, dh_ocaml uses
ocamlobjinfo on them for collecting information about OCaml modules (or units, in ocamlobjinfo terminology) defined and used by them.
Information about defined units will be used to automatically create
the OCaml md5sums registry entry for your package, e.g.
/var/lib/ocaml/md5sums/libXXX-ocaml-dev.md5sums. Information about
imported units will instead be used as keys in the OCaml md5sums
registry for retrieving dependency information for the package. Those
information will then be used to fill the "${ocaml:Depends}" substvars. They will also be used to fill the "${ocaml:Provides}" substvar which
will be replaced by a name of the form libXXX-ocaml-dev-NNNN, where
NNNN is an md5sum computed from the interfaces of the modules provided by the library.

dh_ocaml takes also care of creating postinst and postrm autoscripts
which update the global system registry
(/var/lib/ocaml/md5sums/MD5SUMS) with the registry entry shipped by
your package.

On non-library packages, dh_ocaml tries to guess the OCaml objects
corresponding to shipped bytecode binaries and extract from them
information about imported units. Extracted information will then be
used for filling "${ocaml:Depends}" as discussed for the library case.

In addition to dependencies extracted from the system md5sum registry, dh_ocaml will add in ${ocaml:Provides}:

1. dependency from libXXX-ocaml-dev to libXXX-ocaml (runtime part of
the library), if there is a libXXX-ocaml package in debian/control;
2. dependency from libXXX-ocaml-dev to ocaml-findlib if the package
ships any META file in the OCaml library directory;
3. dependency from libXXX-ocaml, if any, to the appropriateocaml-base-* package (please note that the substvar for libXXXocaml will be filled while processing libXXX-ocaml-dev);
4. dependency on ocaml-base-nox-<ocaml_version> for packages shipping bytecode non-custom OCaml executables.

OPTIONS

-m filename
By default, the list of OCaml objects shipped by your package which should be analyzed for retrieving dependency information is guessed by dh_ocaml.
The -m option permit to specify a file which lists, one per line,
that OCaml objects. They should be in one of the format
understandable by ocamlobjinfo (*.cma, *.cmi, *.cmo) and are
considered relative to the package build directory.
-l dev1:runtime1,dev2:runtime2,... The association between development part of libraries and their
runtimes is guessed by dh_ocaml according to the OCaml packaging
policy. Thus, libXXX-ocaml-dev is the name of the package shipping the development part of XXX library while libXXX-ocaml, if any, is the name of the package shipping the corresponding runtime.
Using -l you could override the pairs development package name,
runtime package name. The value passed to -l admits no spaces and
must be a comma separated list of items. Each item can be a single package name (stating that that name corresponds to the development part of a library) or two package names separated by a colon
(stating that the first corresponds to the development part of a
library, while the second to its accompanying runtime part).
-d By default, dependency on findlib is generated for development parts of libraries which ship any META file. Using -d you can
disable the generation of such dependency (even if this is
discouraged and is very likely to violate the OCaml packaging
policy)

CONFORMS TO

Debian policy, version 3.7.2

OCaml packaging policy, version 1.0.0

SEE ALSO

ocamlobjinfo(1), debhelper(7), ocaml-md5sums(1)

This program is a part of debhelper.

AUTHORS

Stefano Zacchiroli <zack@debian.org>, Samuel Mimram
<smimram@debian.org>
Copyright © 2010-2025 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout