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

Re: debian packaging of findlib



On Fri, 16 Feb 2001, Stefano Zacchiroli wrote:
>Hi Gerd,
>	I'm a debian applicant and I whish to package findlib for debian,
>a discussion on this question is going on on the mailing list
>debian-ocaml-maint@lists.debian.org (as you can see I'm ccing to this ml
>and I'll be very glad if you can cc answers to that ml too).
>
>The main point of discussion is that findlib has a db for handling ocaml
>modules, but there isn't a way to add info to that db if modules are not
>installaed with findlib.
>My idea is that ocaml modules on a debian system will be installed from
>a .deb package and not with findlib, in a post installation phase we
>need a tool that permit to add info on the installed package to the
>findlib db, there exists such a tool ?

No, findlib does not use a db to store information about installed packages. It
simply looks at certain positions in the filesystem. For example, in my
installation the structure is as follows:

/opt/ocaml-3.00/site-lib/<packagename>/<packagefile>

The directory "/opt/ocaml-3.00/site-lib" is called the site-lib directory, and
is normally automatically figured out by the "configure" script (or determined
by the -sitelib argument). The site-lib directory contains a subdirectory for
every package, and that subdirectory contains the files.

There is one important file in the subdirectory: META. It specifies the
properties of the package, for example:

- The version of the package
- The names of the archive files containing the compiled code
- The required packages

You can consider the sum of all that META files as equivalent to a db.

Yes, you can add a package to the package base managed by findlib: simply add
the necessary directories and files to the filesystem!

>Another problem: how findlib guess the dir where modules are to be
>installed ?

As already explained, the base directory is set when findlib is configured. It
is compiled into the ocamlfind binary, and into the findlib.cma/cmxa archives.
It is possible to pass a path of other base directories in the
environment variable OCAMLPATH; this is simply a colon-separated list of
alternatives to the configured site-lib directories. They are all searched for
packages. However, findlib always installs into the configured base directory.

>The related question is: can we tell findlib to use different dirs for
>modules ?
>The problem is that on a debian system, debianized software have to be
>installed in /usr tree and other software in /usr/local (not so strictly
>but similar). So I wonder if in a debian system with findlib installed
>may be possible to use findlib both for register modules installed from
>.deb package (to /usr tree) and for handle other modules not yet
>debianized in other dir (maybe /usr/local tree).

Two solutions:

(1) Configure findlib for /usr/xxx, set OCAMLPATH to /usr/local/xxx.

This means that the .deb packages are found by default, and that a simple
setting enables the /usr/local tree as well.

However, if a user tries to add a self-compiled package to the system, it will
be installed under /usr/xxx, and not /usr/local/xxx. As far as I understand
your plan, this is not what you want.

(2) Change findlib such that it supports the debian requirements

I am willing to include such changes into the findlib source; other packagers
will probably have similar problems. Of course, I need your exact requirements. 
I suppose you want the following features:

- The possibility to set a default package path which is compiled into
  ocamlfind; not only a single base directory.

  For Debian, this default path would be /usr/xxx:/usr/local/xxx.

- The possibility to specify the default installation directory independently.
  
  For Debian, the default installation dir is /usr/local/xxx.

  However, it must be possible to override this spec in "ocamlfind install",
  so the packagers can still install into /usr/xxx. This could be determined by
  an environment variable.
  
Gerd
-- 
----------------------------------------------------------------------------
Gerd Stolpmann      Telefon: +49 6151 997705 (privat)
Viktoriastr. 100             
64293 Darmstadt     EMail:   gerd@gerd-stolpmann.de
Germany                     
----------------------------------------------------------------------------



Reply to: