Installation

==================

-If you want to get up and running quickly and easily-

Compile mldonkey without GUI support
You have to have zlib, zlib-dev and m4 packages installed.

Mldonkey/> ./configure
Type in 'n' <enter> when it asks if you want to get lablgtk.
Mldonkey/> make depend
Mldonkey/> make

There is no additional 'make install' command. Copy the file 'mlnet'
(this is MLdonkey) to the folder where you've choosen to run MLdonkey.

Start 'mlnet'

Mlnet/> ./mlnet
Leave the terminal window open. MLdonkey is now running.

Open a browser and type in the URL http://localhost:4080 <enter>.
A web-based interface to MLdonkey appears. Certain ports enabling inbound
routing on your firewall/router need to be opened to fully use MLdonkey.
The Options tab in the web interface shows the ports.

-You're done!-

Some goodies (make_torrent, ed2k_hash) come with mldonkey, you can also
compile them using the additionnal command:

Mldonkey/> make utils

==================
There are additional ways besides the web interface to control Mlnet(MLdonkey).
- Compiling support for the 'mlgui' application while compiling MLdonkey
  is one. This requires additional libraries, which, depending on your platform
  and skill, may be easy or not so easy to add. The 'mlnet' application functions
  fine without the GUI.
- Other applications are written by third-parties and available for specific
  platforms. These vary in stability and functionality.

Compiling mldonkey with mldonkey_gui support:
-------------------

You have now two options to compile mldonkey:
- Individually install Objective-Caml 3.06 and LablGTK 1.2.?. Then, you can
  compile mldonkey. The instructions are given below at '1)'.
- If you want to install ocaml and lablgtk only to compile mldonkey. You must
  have a good internet access (you want mldonkey after all :). You must have
  "wget" installed. Then, run:

./configure -enable-batch

The configure script will download ocaml and lablgtk, compile and install them
locally so that they can be used to compile mldonkey. Steps below can be skipped
now. Be patient. Ocaml and lablgtk tools take a while to compile and install.

Note: At least 70 M of free disk space is required on the partition where mldonkey
is compiled.

------------------------------------------------------------------------
1) Installing required tools: Objective-Caml 3.06 and LablGTK 1.2.3 or 1.2.?

 1.1) Objective-Caml 3.06 (from   http://pauillac.inria.fr/caml)

    ~/tmp> tar zxf ocaml-3.06.tar.gz
    ~/tmp> cd ocaml-3.06

   If you REALLY want to patch it:
    ~/tmp/ocaml-3.06> ./configure
    ~/tmp/ocaml-3.06> make world opt opt.opt
    ~/tmp/ocaml-3.06> make install

 1.2) LablGTK 1.2.3 (from 
            http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html)

    ~/tmp> tar zxf lablgtk-1.2.3.tar.gz
    ~/tmp> cd lablgtk-1.2.3
    ~/tmp/lablgtk-1.2.3> make configure
    ~/tmp/lablgtk-1.2.3> make
    ~/tmp/lablgtk-1.2.3> make opt
    ~/tmp/lablgtk-1.2.3> make install

2) Compiling mldonkey:

    ~/tmp/mldonkey> ./configure
    ~/tmp/mldonkey> make depend
    ~/tmp/mldonkey> make

  You should now have 'mldonkey' (the daemon with edonkey/overnet support), 
'mlnet' (the daemon with all network support) and 'mldonkey_gui' (the
interface) No 'make install' is provided. 

  You can disable all other p2p networks using the --disable-multinet option
   with ./configure. Only edonkey support will then be compiled.

------------------------------------------------------------------------

Using mldonkey:
---------------

mldonkey binaries are normally distributed with only the content of the
mldonkey/distrib/ directory. Consequently, all documentation files on how to
use mldonkey are stored in this directory. You will also find default 
configuration files in this directory, and in particular, a list of servers
for edonkey in the servers.ini file.

 See the distrib/Readme.txt and distrib/FAQ.html files for more information
on how to use mldonkey.

 Note that you should execute mldonkey in the distrib/ directory, where a
list of servers is present with other files. It will create other
configuration files in this directory. mldonkey_gui has its own configuration
file in the user directory (~/.mldonkey_gui.ini). I would advise you to move
mldonkey, mldonkey_gui, mldonkey_gui2 and mlchat to distrib/, then move this
directory where you want to put your downloads, and then remove mldonkey 
sources.

You must NOT run mldonkey as root (or you should use the run_as_user
option to change the user after the port has been bound).

NOTES:
------
2002/12/18: To compile on MinGW
 * configure: -enable-batch will not work, you must download and install ocaml
    yourself
 * if ocamlopt/gcc fails to generate mldonkey.exe, add '-verbose -S'
     to the LIBS_opt in the Makefile. Use 'make &> log' to keep the
     commands, edit the 'log' file and remove all the commands except
     the 2 last 'as' and 'gcc' lines. Then use 'sh ./log' to rerun
     these commands, that should work this way :)
 * For a flawless compile these variables should be set
   (OCAMLDIR means the root directory of the Ocaml binaries):
   SET CAMLLIB=OCAMLDIR/lib
   SET CAMLP4LIB=OCAMLDIR/lib/camlp4
   SET OCAMLLIB=OCAMLDIR/lib
   SET OCAMLRUNPARAM="l=256M"
 * On the MLDonkeyworld forum is a great thread with information about
   how to compile MLDonkey with MinGW:
   http://mldonkey.berlios.de/modules.php?name=Forums&file=viewtopic&t=1363
