Chapter 2. Packaging OCaml Programs

2.1. Creating Packages for OCaml Programs

Any package providing executables built from OCaml source should conform to the following guidelines.

The source package should, if possible, use the name of the upstream package without modifications.

Programs which are not particularly CPU hungry should be compiled into bytecode form, and the corresponding binary packages should be Architecture: all in order to minimize archive usage and avoid the need of rebuilding them on all architectures. See Section 2.2 for details on this kind of packages.

Other programs should be compiled into native form on architectures where the native compiler is available, and into bytecode on other architectures. See Section 2.3 for details on how to achieve this. The corresponding binary packages should be Architecture: any and will need to be built on any architecture.

All bytecode executables should be linked dynamically against the shared libraries for C bindings, so as to not bloat the archive. That said, often the upstream authors will favor statically linked bytecode executables, because so they don't need to worry about the presence of the dll stub libraries and such. This is not a valid reason to use statically linked bytecode in a Debian package.