[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

dh_ocaml



Now that the version of the ocaml package with ocaml-md5sums has been
uploaded is time to speak about dh_ocaml: a new debhelper able to
automatically compute ocaml dependencies.

Architecture:

  The architecture is centered on the "md5sums registry", located in
  /var/lib/ocaml/md5sums/MD5SUMS, its format is described below.

  The overall idea is that each package shipping an ocaml library adds
  entries to the registry. Each entry roughly state "I provide unit Foo
  with md5sum ....".

  When another package is built dh_ocaml looks for all ocaml bytecode
  objects it ships and using ocaml-md5sums collects information about
  referenced units and corresponding md5sums. Then, looking up in
  md5sums registry, dh_ocaml is able to collect a list of dependencies
  for the package being built and fills the substvar ${ocaml:Depends}
  with that list.

  In order to keep the registry up to date each package ships a .md5sums
  entry which get installed in /var/lib/ocaml/md5sums/. ocaml-md5sums is
  then used in postinst/prerm scripts to merge all .md5sums entries in
  the md5sums registry. dh_ocaml is also in charge of automatically
  creating .md5sums entries, install it in the proper place at package
  build time and of creating postinst/prerm scripts.

  dh_ocaml takes care also of adding "standard" dependencies like that
  on ocaml-base..., and findlib.

Md5sums registry format:

  Its structure is a list of records, one per row. Each record has 5
  fields, field separator is a space. The first two fields are keys in
  the registry: an md5sums and a unit name as those reported by
  ocamlobjinfo. The remaining three fields denotes the dependencies
  which a packages using a given unit name with a given md5sums should
  have. Field 3 is the name of a development time ("-dev") dependency
  while field 4 is the name of the corresponding runtime dependency (if
  any, the string "-" if no runtime dependency exists). The last field
  is the version information for the dependencies (if needed, the string
  "-" if not needed).

Please test it ...

  dh_ocaml is not yet part of debhelper, but joeyh is ready to include
  it as soon as we will ask for. Before doing so I would like it to be
  tested a bit more. I alreay rebuilt with it the following packages:
  pcre, pxp, ulex, equeue, ocamlnet and all went fine. I also spotted a
  missing dependency in the ocamlnet package :-) All of them are on svn
  with locations trunk/packages/<pkgname>/branches/dh_ocaml/

  I'm thus asking to people maintaining ocaml libraries and bytecode
  applications to give dh_ocaml a try with their packages and report
  bugs and other issues.

  In order to have a copy of debhelper which include dh_ocaml you can go
  in the svn repo in trunk/tools/dh_ocaml/ and type "make debhelper".
  In order for dh_ocaml to be useful you will need a version of the
  packages you depend on which has been built with dh_ocaml, I've put
  .debs of mine on svn in trunk/packages/dh_ocaml_test/ so that other
  people could add their packages there.

  For more info have a look at the dh_ocaml manpage and at the example
  packages I made, have a look at the one that best matches yours (see
  below).

Summary of the example packages I rebuilt:

  ocamlnet:   uses debhelper, library with both -dev and runtime parts
  equeue:     uses debhelper, library with both -dev and runtime parts
  pxp:        uses debhelper, library with -dev part only
  pcre-ocaml: uses cdbs, library with both -dev and runtime parts
  ulex:       uses cdbs, library with -dev part only, non standard
              library name

Questions, bug reports, whatever ... are welcome.

Cheers.

PS Samuel, sorry for playing with the equeue package without asking, but
   I needed to rebuild it before rebuilding ocamlnet

-- 
Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. -!-

Attachment: signature.asc
Description: Digital signature


Reply to: