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

[post-sarge] RFC: dh_ocaml



[ This post covers post-sarge issue so don't waste your time reading it
  if packages of yours are not yet ready for the 3.08.3 transition :-) ]

Hi all,
  I started writing a debhelper for ocaml for automatic calculation of
OCaml dependencies. You can find the state of the art in the SVN repo as
tools/dh_ocaml/.

At the time of writing the debhelper should be invoked as dh_ocaml in
debian/rules after the install target (e.g, just after
dh_installchangelogs) and it does two different things:

1) Handle the md5sums registry, that is:
   a) Compute ocaml md5sums of units _defined_ in .cm[ao] shipped by the
      package and create add a new file to the package being built. The
      file is named /var/lib/ocaml/md5sums/<pkgname>.md5sums and is a
      two columns table: md5sum, unit name
   b) Add postinst and postrm scripts which keep up to date the registry
      of ocaml md5sums located on the machine of people having installed
      ocaml packages. The registry is located in
      /var/lib/ocaml/md5sums/MD5SUMS and is a 4 columns table: md5sum,
      package name, version, unit name. It can always be compute
      starting from *.md5sums files and the version of the corresponding
      package

2) Compute dependencies of the package being built and fills the
   substvar ${ocaml:Depends}, that is:
   a) Compute ocaml md5sums of units _imported_ by .cm[ao] shipped by
      the package. For each of them look them up in the registry and if
      a match is found adds a versioned entry to the substvar above

Since dh_ocaml is not yet part of debhelper, in order to test it you can
"make" in the dh_ocaml/ dir. The outcome should be a version of the
debhelper package rebuilt so that it ships dh_ocaml and the needed
autoscripts.

A lot of things still needs to be done, this is an excerpt from the TODO
lines of dh_ocaml:

  # TODO ask Joey Hess about how much dh_ocaml follows debhelper
  #      guidelines
  # TODO check how dh_ocaml work when multiple binary packages are being
  #      built
  # TODO for libraries: add proper dependencies on ocaml (and findlib?)
  # TODO for binaries: check if package is shipping any bytecode
  #      binaries (head -1 should be enough) and add proper dependencies
  #      on ocaml
  # TODO complete POD documentation
  # TODO add comment headers for uncommented subs
  # TODO check if dh_ocaml md5sums calculcation works with -pack -ed
  #      units (e.g.  Foo.Bar)

Comments are welcome.

Cheers.

-- 
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: