Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] What's the proper way to release ocaml projects?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Maxence Guesdon <maxence.guesdon@i...>
Subject: Re: [Caml-list] What's the proper way to release ocaml projects?
Jeremy Fincher wrote:

> I have a few small libraries I've written in the process of writing an IRC bot.  I'd like to release the code to these libraries (and maybe even the IRC bot itself :)) but I'm a bit unclear about the best way to do so.
> 
> I've translated a few Python modules to varying degrees and written a tiny database more or less based on CDB ( http://cr.yp.to/cdb.html ).  What's the best way to make these available, and what preparation should I do to the makefiles/etc. to make these actual "packages" rather than simply bundles of code?
> 

A nice way is to provide your sources with a configure script and a 
makefile with the following targets :
- depend : build the module dependencies in a .depend file
- all : compile all your project both bytecode and native code (all: 
byte opt)
- byte : compile all your project with ocaml or ocaml.opt
- opt : compile all your project with ocamlopt or ocamlopt.opt
- install : install your compiled files in a subdir of $OCAMLLIB
   where $OCAMLLIB is defined as <ocaml_dir>/lib/ocaml
- installopt (eventually) installs the nativecode files to the install 
directory.
- doc : build the doc (you can use OCamldoc for example ;-)

The 'all' target is usually the first, such that 'make' will be 
equivalent to 'make all'.

In the install directory, you usually put .mli, .cm[i|o|x|a|xa], and .a 
files (.a files if you have C-libraries in your project).

A good start to provide a configure script and use it in your Makefile :
http://www.lri.fr/~filliatr/ftp/ocaml/misc/configure.in
http://www.lri.fr/~filliatr/ftp/ocaml/misc/Makefile.in

Other examples of Makefiles and configure can be found here :

http://caml.inria.fr/hump.html#Makefiles__autoconf_support_____


Of course you'all add a README or INSTALL files (or both) where you 
explain what your project/lib is, what is required and how to compile 
and install it. A 'Changes' file is appreciated too to log differences 
between releases.

When all is ok, you can tar your directory :
tar cvfz myproject-0_1.tar.gz  myproject/

The .tar.gz extension is better than .tgz because some browsers (for 
example netscape) recognize .tar.gz extension and open the 'save' dialog 
box when yor file is clicked, while with .tgz extension, the binary file 
is displayed on the screen and you have to 'File/Save as' it.

Being in the parent directory of your project directory for this command 
is important since, this way, your future users won't have to create a 
specific directory to untar your code, it will be created wy the tar 
x... command.

When your tar file is ready and available from a link on your site or 
somewhere on the net, you can announce the release by sending an email 
to caml-announce@inria.fr.
You can also register it on
http://www.npc.de/ocaml/linkdb/frames.html

and email hump@caml.inria.fr if you want your contrib to be added to the 
caml hump :
http://caml.inria.fr/hump.html

That's it. I hope i didn't frighten you ;-)

--
Maxence Guesdon



-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr