English Finnish
This document seeks to document the conventions and customs surrounding the proper packaging of OCaml modules in Fedora. It does not intend to cover all situations, but to codify those practices which have served the Fedora OCaml community well.
The base OCaml compiler is called ocaml.
OCaml modules, libraries and syntax extensions should be named ocaml-foo. Examples include: ocaml-extlib, ocaml-ssl.
This naming does not apply to applications written in OCaml, which can be given their normal name. Examples include: mldonkey, virt-top, cduce.
Rationale: this is how they are named in other distros (Debian, PLD) and this is consistent with Perl / PHP / Python naming.
Packaging libraries
The following is an example specfile for an imaginary OCaml library called _foolib_.
Main package
In order to allow OCaml scripts and the toplevel to use a library, the main package should contain only files matching:
*.cma (contains the bytecode)
*.cmi (contains the compiled signature)
*.so (if present, contains OCaml <-> C stubs)
META (the findlib description)
*.so.owner (if present, used by findlib)
a license file (if present) marked %doc
.cmo files are not normally included. There are two exceptions where *.cmo files may be included:
if file is needed for link (like gtkInit.cmo in lablgtk or std_exit.cmo in OCaml itself), then it must be included to allow the library to be linked properly.
if the cmo file is a camlp4 preprocessor (like Camlp4OCamlPrinter.cmo in OCaml), then it must be included because otherwise the syntax extension would not be available.