Appendix A. The OCaml CDBS class

To help maintainers of OCaml-related packages in adhering to this policy, a class for the CDBS build system has been made available and is shipped as part of the ocaml-nox package. Please consider using it in your packages at it will both ease your work and permit to perform changes to a wide range of packages acting on a single piece of software (the CDBS class itself).

To use the class in your package it is enough to include the file /usr/share/cdbs/1/class/ocaml.mk from your debian/rules. If you use debhelper (please do) you should include the OCaml class after the debhelper on. A typical debian/rules heading for a package using plain Makefile (i.e. no autotools) and dpatch is as follows:


#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk
include /usr/share/cdbs/1/class/ocaml.mk
include /usr/share/cdbs/1/rules/dpatch.mk
  
For an example of such a package see the pcre-ocaml Debian source package.

A detailed description of how to use the OCaml CDBS class should be provided in this section, but at the time of writing is a future work :-). In the meantime if you know CDBS, the .mk files which compose the OCaml class are well commented and they should give you enough information to customize the build process of your package. The latest version of them is available in the repository of the The Debian OCaml Task Force and can be browsed on the web:

ocaml-vars.mk

contains (Makefile) convenience variables which can be used in debian/rules

ocaml.mk

implements the class logic