
==== Dependencies ====

Dose3 needs ocaml >= 3.11.2
On debian, dose3 **does not compile** on debian lenny.

required libraries ( DEBIAN / RPM ) :
 - libextlib-ocaml-dev / ocaml-extlib-devel
 - libre-ocaml-dev / ??
 - libocamlgraph-ocaml-dev >= 1.8.6

additional libraries (enable compilation with --with-<library>) :
 - libzip-ocaml-dev / ?
 - libbz2-ocaml-dev / ?
 - libounit-ocaml-dev / ocaml-ounit-devel
 - librpm-dev / librpm-devel
 - libexpat-ocaml-dev (for --with-xml)
 - libbenchmark-ocaml-dev (for --with-benchmark)

To use rpm support, dose3 needs librpm > 4.6

extlib >= 1.7.8

opam users need the following packages to compile dose with the default
options :

- opam install cppo extlib camlbz2 camlzip ocamlgraph extlib ounit re cudf

OR 

- opam install cppo extlib re cudf

to compile the core dose library.

To compile from git :
aclocal -I m4
autoconf
./configure
make

--with-rpm4
--with-rpm5
--with-xml
--with-parmap
--with-zip
--with-bz2
--with-oUnit
--with-curl
--with-experimental (not working at the moment?)

libcudf is included in the source tree of dose3 available by git but
not in the dose3 release tarball. By default dose3 uses the system
wide version of libcudf. To use the version of libcudf in the source
tree you can specify --without-libcudf as configure option. If using
an independently installed version of libcudf you'll need version >=
0.7.

Example:
./configure --with-zip --with-bz2 --prefix=/usr

Compiling applications
----------------------
In order to compile the a selection of applications do "make". To
compile specific application

$ocamlbuild -use-ocamlfind applications/$app.native
$ocamlbuild -use-ocamlfind experimental/$app.native

Some application might benefit from a fine-tune of the ocaml garbage collector.
You migth try to set the following values before running your application:
OCAMLRUNPARAM=s=4M,i=32M,o=150

Compiling experimental applications
-----------------------------------
From the dose top level directory, for instance to compile outdated.ml:

$ocamlbuild -use-ocamlfind experimental/outdated.native

Building the documentation
--------------------------
"make doc" builds the documentation. You need to have installed "graphviz".

Install
-------
 
Dose is installed using ocamlfind:
Install: ocamlfind install -destdir $LIBDIR <libs>
Remove: ocamlfind remove -destdir $LIBDIR <libs>
 
Binaries are installed in $BINDIR
 
"make printconf" shows the current configuration.

The configure script options are :
-prefix=PREFIX  install files in PREFIX
-bindir=DIR   user executables in DIR [PREFIX/bin]
-libdir=DIR   object code libraries in DIR [PREFIX/lib/ocaml/$(OCAML_VERSION)]
 
if --prefix is not specified, we use the ocamlfind **destdir** as default.
 
$./configure
$make printconf
DESTDIR:
OCAMLFIND_DESTDIR:
Prefix: /usr/local
Libdir: /usr/local/lib/ocaml/4.02.3
Bindir: /usr/local/bin
 
If the Makefile is invoked using the env variable DESTDIR then the configure
script options are ignored and the installation script will behave as :
 
$DESTDIR=/usr make printconf
DESTDIR: /usr
OCAMLFIND_DESTDIR:
Prefix: /usr/local
Libdir: /usr/lib/ocaml
Bindir: /usr/bin

If the Makefile is invoked using the env variable OCAMLFIND_DESTDIR then
the we honor the destdir as set by ocamlfind.

$OCAMLFIND_DESTDIR=/home/software/lib/ocaml make printconf
DESTDIR:
OCAMLFIND_DESTDIR: /home/software/lib/ocaml
Prefix: /usr/local
Libdir: /home/software/lib/ocaml
Bindir: /usr/local/bin

By default dose is installed in /usr/local/bin and /usr/local/lib/ocaml

Ocaml interpreter
-----------------

$ocaml
        Objective Caml version 3.12.1

Findlib has been successfully loaded. Additional directives:
  #require "package";;      to load a package
  #list;;                   to list the available packages
  #camlp4o;;                to load camlp4 (standard syntax)
  #camlp4r;;                to load camlp4 (revised syntax)
  #predicates "p,q,...";;   to set these predicates
  Topfind.reset();;         to force that packages will be reloaded
  #thread;;                 to enable threads

/usr/lib/ocaml/extlib: added to search path
/usr/lib/ocaml/extlib/extLib.cma: loaded
# #require "dose3";;
/usr/lib/ocaml/str.cma: loaded
/usr/lib/ocaml/pcre: added to search path
/usr/lib/ocaml/pcre/pcre.cma: loaded
/usr/local/lib/ocaml/3.12.1/cudf: added to search path
/usr/local/lib/ocaml/3.12.1/cudf/cudf.cma: loaded
/usr/lib/ocaml/ocamlgraph: added to search path
/usr/lib/ocaml/ocamlgraph/graph.cma: loaded
/usr/lib/ocaml/unix.cma: loaded
/usr/lib/ocaml/zip: added to search path
/usr/lib/ocaml/zip/zip.cma: loaded
/usr/lib/ocaml/bz2: added to search path
/usr/lib/ocaml/bz2/bz2.cma: loaded
/usr/local/lib/ocaml/3.12.1/dose3: added to search path
/usr/local/lib/ocaml/3.12.1/dose3/common.cma: loaded
/usr/local/lib/ocaml/3.12.1/dose3/algo.cma: loaded
/usr/local/lib/ocaml/3.12.1/dose3/debian.cma: loaded
/usr/local/lib/ocaml/3.12.1/dose3/eclipse.cma: loaded
# #require "dose3.boilerplate";;
/usr/local/lib/ocaml/3.12.1/dose3/rpm.cma: loaded
/usr/local/lib/ocaml/3.12.1/dose3/boilerplate.cma: loaded
#


How to create a tarball for distribution
----------------------------------------
edit configure.ac: put new version number in macro AC_INIT
aclocal -I m4
autoconf
make
make dist

How to run the tests
--------------------
The test script of the applications needs:
python
python-yaml

./configure --with-zip --with-oUnit --with-bz2
make
make test
make testlib

To run only the unit tests : make testlib

To only run specific tests or groups of tests use unit and group parameters,
respectively:

make test group=distcheck
make test unit=distcheck_coinst
