ocaml (3.10.2-4) UNRELEASED; urgency=low
+ [ Stephane Glondu ]
* Switching packaging to git (from svn)
* Bump debhelper compatibility level to 7, and use debian/clean feature
of dh_clean
+ [ Stefano Zacchiroli ]
+ * Remove the OCaml Packaging Policy document, it will be shipped by the
+ new dh-ocaml package
+
-- Stephane Glondu <steph@glondu.net> Tue, 08 Jul 2008 14:30:11 +0200
ocaml (3.10.2-3) unstable; urgency=low
Changes
README
-debian/policy/ocaml_packaging_policy.txt
-debian/policy/ocaml_packaging_policy.html
+++ /dev/null
-Document: ocaml-packaging-policy
-Title: OCaml Packaging Policy
-Author: Debian OCaml Task Force <debian-ocaml-maint@lists.debian.org>
-Abstract: This manual describes the policy requirement for OCaml libraries and
- programs in the Debian GNU/Linux distribution.
-Section: Debian
-
-Format: HTML
-Index: /usr/share/doc/ocaml/ocaml_packaging_policy.html/index.html
-Files: /usr/share/doc/ocaml/ocaml_packaging_policy.html/*.html
+++ /dev/null
-NULL =
-INSTALL_STUFF = \
- ocaml_packaging_policy.html/ \
- ocaml_packaging_policy.txt \
- $(NULL)
-
-all: html text
-
-# to be used on alioth for updating policy linked by pkg-ocaml-maint home page
-install: all
- cp -r $(INSTALL_STUFF) ~/pkg-ocaml-maint/htdocs/
-
-html: ocaml_packaging_policy.html/index.html
-text: ocaml_packaging_policy.txt
-
-ocaml_packaging_policy.html/index.html: ocaml_packaging_policy.xml *.xml
- docbook2html $< -o $(dir $@)
-ocaml_packaging_policy.txt: ocaml_packaging_policy.xml *.xml
- docbook2txt $<
-
-clean:
- $(RM) -rf ocaml_packaging_policy.html/ ocaml_packaging_policy.txt
-
-upload_web: all
- scp -rC ocaml_packaging_policy.txt ocaml_packaging_policy.html alioth.debian.org:/org/alioth.debian.org/chroot/home/groups/pkg-ocaml-maint/htdocs/
- ssh alioth.debian.org "chmod g+w /org/alioth.debian.org/chroot/home/groups/pkg-ocaml-maint/htdocs/ocaml_packaging_policy.txt /org/alioth.debian.org/chroot/home/groups/pkg-ocaml-maint/htdocs/ocaml_packaging_policy.html/*"
-
-.PHONY: html text upload_web
+++ /dev/null
------------------------
-* *
-* HOWTO-XML *
-* DOCBOOK *
-* *
-* *
------------------------
-
-
-If you are interested in writing in the policy, you should
-take a look at
-
-http://docbook.sourceforge.net/
-http://www.oasis-open.org/docbook/documentation/reference/html/docbook.html
-
-When you finish write your part, just do a make clean && make all. It will result
-in having ocaml_packaging_policy.html...
-
-Sylvain LE GALL
-Sat, 18 October 2003
-
-In order to compile the xml documents you need to install the package
-docbook-utils. [Ralf, 5/7/2006]
+++ /dev/null
-<para>
- To help maintainers of OCaml-related packages in adhering to this policy, a
- class for the <ulink url="http://build-common.alioth.debian.org/">CDBS
- build system</ulink> has been made available and is shipped as part of
- the <filename>ocaml-nox</filename> package. Please consider using it in your
- packages at it will both ease your work and permit to perform changes to a
- wide range of packages acting on a single piece of software (the CDBS class
- itself).
-</para>
-
-<para>
- To use the class in your package it is enough to include the file
- <filename>/usr/share/cdbs/1/class/ocaml.mk</filename> from your
- <filename>debian/rules</filename>. If you use debhelper (please do) you
- should include the OCaml class after the debhelper on. A typical
- <filename>debian/rules</filename> heading for a package using plain Makefile
- (i.e. no autotools) and dpatch is as follows:
- <programlisting>
-#!/usr/bin/make -f
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/makefile.mk
-include /usr/share/cdbs/1/class/ocaml.mk
-include /usr/share/cdbs/1/rules/dpatch.mk
- </programlisting>
- For an example of such a package see the <filename>pcre-ocaml</filename>
- Debian source package.
-</para>
-
-<para>
- A detailed description of how to use the OCaml CDBS class should be provided
- in this section, but at the time of writing is a future work :-). In the
- meantime if you know CDBS, the .mk files which compose the OCaml
- class are well commented and they should give you enough information to
- customize the build process of your package. The latest version of them is
- available in the repository of the &ocaml-force; and can be browsed on the
- web:
- <variablelist>
-
- <varlistentry>
- <term><filename><ulink url="http://git.debian.org/?p=pkg-ocaml-maint/packages/ocaml.git;a=blob;f=debian/cdbs/ocaml-vars.mk;hb=HEAD">ocaml-vars.mk</ulink></filename></term>
- <listitem>
- <para>
- contains (Makefile) convenience variables which can be used in
- <filename>debian/rules</filename>
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><filename><ulink url="http://git.debian.org/?p=pkg-ocaml-maint/packages/ocaml.git;a=blob;f=debian/cdbs/ocaml.mk;hb=HEAD">ocaml.mk</ulink></filename></term>
- <listitem>
- <para>
- implements the class logic
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
-</para>
+++ /dev/null
-<para>
- <itemizedlist>
- <listitem><para>&ocaml-force;'s website: <ulink url="http://pkg-ocaml-maint.alioth.debian.org/">http://pkg-ocaml-maint.alioth.debian.org/</ulink> (it's an <ulink url="http://alioth.debian.org/projects/pkg-ocaml-maint/">Alioth project</ulink>)</para></listitem>
- <listitem><para>&ocaml-force;'s mailing list: <ulink url="mailto:debian-ocaml-maint@lists.debian.org">debian-ocaml-maint@lists.debian.org</ulink> (<ulink url="http://lists.debian.org/debian-ocaml-maint/">archives</ulink>)</para></listitem>
- </itemizedlist>
-</para>
+++ /dev/null
-
-<section>
- <title>Use SVN and let your users know about it</title>
- <para>
- (Hopefully) All OCaml-related Debian packages are maintained using a
- centralized <ulink url="http://subversion.tigris.org/">Subversion</ulink>
- (<acronym>SVN</acronym> for short) repository. This practice reduce the
- efforts needed to contribute work inside &ocaml-force; and, in case of
- need, provides a place where to massively perform changes to all
- OCaml-related Debian packages.
- </para>
- <para>
- Nonetheless, Debian users can benefit knowing we are using a SVN
- repository (they can for instance subscribe to the RSS feed for changes
- or have a place where to look for finding patches corresponding to bugs
- tagged "pending" in the BTS).
- </para>
- <para>
- For this reason <emphasis>it is recommended to add the
- <code>XS-Vcs-Svn</code> and <code>XS-Vcs-Browser</code> fields to the
- <filename>debian/control</filename> of packages maintained in
- &ocaml-force; SVN repository</emphasis>. Its name specifies that we are
- using Subversion as our Version Control System (<acronym>VCS</acronym>);
- their values are the URLs pointing to the package's trunk directory and to
- a browsable view of the same directory. See <ulink
- url="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=391023">Bug
- #391023</ulink> (which contains the forthcoming text for the Debian
- Developer's Reference) for more information about these fields.
- </para>
- <para>
- The general scheme for using the fields are thus:
- <programlisting>
- XS-Vcs-Svn: svn://svn.debian.org/svn/pkg-ocaml-maint/trunk/packages/<emphasis>PACKAGE_NAME</emphasis>
- XS-Vcs-Browser: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/<emphasis>PACKAGE_NAME</emphasis>/trunk/
- </programlisting>
- <example>
- <title>Usage example of the XS-Vcs-* fields, from the
- <application>findlib</application> package
- </title>
- <programlisting>
- Source: findlib
- Section: devel
- Priority: optional
- Maintainer: Stefano Zacchiroli <zack@debian.org>
- Build-Depends: debhelper (>> 4.0.0), ocaml (>= 3.09.2), m4, gawk | awk, dpatch, cdbs
- Standards-Version: 3.7.2
- <emphasis>XS-Vcs-Svn: svn://svn.debian.org/svn/pkg-ocaml-maint/trunk/packages/findlib</emphasis>
- <emphasis>XS-Vcs-Browser: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/findlib/trunk/</emphasis>
-
- Package: ocaml-findlib
- Section: devel
- Architecture: any
- Depends: ocaml-nox-${F:OCamlABI}, ${shlibs:Depends}, ${misc:Depends}
- Description: Management tool for OCaml programming language libraries
- ...
- </programlisting>
- </example>
- </para>
-</section>
-
-<section>
- <title>How to obtain a copy of the SVN repository</title>
- <para>
- You can obtain a copy of debian-ocaml-maint SVN repository by
- <programlisting>
- svn co svn+ssh://svn.debian.org/svn/pkg-ocaml-maint
- </programlisting>
- You must be member of the
- <ulink url="http://pkg-ocaml-maint.alioth.debian.org/">Debian
- OCaml Task Force</ulink> in order to have write access to the repository.
- </para>
-</section>
-
-<section>
- <title>Structure of the SVN repository</title>
- <para>
- We keep all files of the debian subdirectory under SVN control, and
- upstream only as a compressed tarball. The rationale behind this is
- that changes to upstream files should be managed by the <application>dpatch</application> patch
- manager. Hence, all the diffs to upstream files are kept in a
- subdirectory of <filename>debian/</filename>, and it is not necessary to manage upstream on
- file-by-file basis.
- </para>
-
- <para>
- The structure of the pkg-ocaml-maint SVN repository is as follows, where
- generic names are indicated in square brackets <varname>[ .. ]</varname>, and where the
- contents of subdirectories not directly relevant for package management
- are not detailed:
- <programlisting>
- tags
- packages
- [package1]
- [version1]
- [version2]
- ...
- [package2]
- [version1]
- ...
- ...
- projects
- test
- trunk
- packages
- [package1]
- trunk
- debian
- tarballs
- [upstream-tarball-version1]
- [upstream-tarball-version2]
- ...
- [package2]
- ...
- policy
- projects
- tools
- </programlisting>
- </para>
-</section>
-
-<section>
- <title>How to add a new package to the SVN repository</title>
- <para>
- Place yourself in the directory <filename>trunk/packages</filename> of your working copy of
- the SVN repository. Create a directory with the same name as your
- source package (let's say, my-package), and subdirectories <filename>tarballs</filename>
- and <filename>trunk</filename>. Put the current upstream tarball in <filename>tarballs</filename>, and the
- current debian directory with all its relevant files in <filename>trunk</filename>. This
- should now look like this:
- <programlisting>
- trunk/packages/my_package
- tarballs
- my_package_1.2.3.orig.tar.gz
- trunk
- debian
- changelog
- control
- copyright
- patches
- 00_list
- 01_patch1.dpatch
- ...
- ...
- </programlisting>
- </para>
-
- <para>
- If everything is in order you can do a <command>svn add my_package</command> from the <filename>trunk/packages</filename> directory, and eventually <command>svn commit</command>.
- </para>
-</section>
-
-<section>
- <title>How to set up your package for use with <application>svn-buildpackage</application></title>
-
- <para>
- Please see the <application>svn-buildpackage</application> documentation for complete
- information. The important issues here are:
- <itemizedlist>
- <listitem>
- <para>
- Since we keep upstream as a tarball we have to use <application>svn-buildpackage</application> in
- so-called merge mode. This means that, before compiling the package,
- the debianized source tree is constructed by untarring the orig tarball, and then merging the contents of the trunk subdirectory in it.
- </para>
- </listitem>
- <listitem>
- <para>
- The structure of our SVN repository is not among the default structures
- of <application>svn-buildpackage</application>. Hence, we have to override the default location of some
- directories.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- Place yourself in <filename>trunk/packages/my_packages/trunk</filename>, and do the following:
- <command>svn propset mergeWithUpstream 1 debian</command>.
- This registers the property "mergeWithUpstream" with the current
- directory, such that <application>svn-buildpackage</application> knows
- that it has to use merge mode as explained above.
- </para>
-
- <para>
- Create a file <filename>debian/svn-deblayout</filename> with the following contents:
- <programlisting>
-tagsUrl=svn+ssh://svn.debian.org/svn/pkg-ocaml-maint/tags/packages/my_package
- </programlisting>
- </para>
-
- <para>
- Remember that "my_package" has to be replaced by the name of your
- actual package. <application>svn-buildpackage</application> will not include this file in the
- source package when actually building the package.
- </para>
-
- <para>
- If you tried <application>svn-buildpackage</application> before writing your <filename>debian/svn-deblayout</filename> remember
- to delete <filename>.svn/deb-layout</filename>, since <application>svn-buildpackages</application> caches here the content
- of <filename>svn-deblayout</filename> (that would be empty in this case) and will ignore
- your <filename>debian/svn-deblayout</filename>.
- </para>
-</section>
-
-<section>
- <title>How to build a package with <application>svn-buildpackage</application></title>
-
- <para>
- Please refer to the <application>svn-builpackage</application> documentation for more complete
- information. Here is just a quick guide.
- </para>
-
- <para>
- All options, except those starting on <option>--svn</option>, are passed to
- <application>dpkg-buildpackage</application>. Hence, basic usage should be something like this
- (from the <filename>trunk/packages/my_package/trunk</filename> directory): <command>svn-buildpackage -rfakeroot -uc -us</command>.
- </para>
-
- <para>
- <application>svn-buildpackage</application> will complain when your copy
- of the debian directory is not in sync with the repository. You may use
- the option <option>--svn-ignore-new</option> to override this behaviour.
- The package will be build in the directory
- <filename>../build-area</filename>.
- </para>
-
- <para>
- If your package is ready for upload you may use the <option>--svn-tag</option> option
- for the final build. This will put a tag in the svn-repository on the
- current version, and add a new entry in the changlog to start working
- on the upcomming next version: <command>svn-buildpackage --svn-tag</command>.
- Provided you have commited all your changes to the svn repository, this
- will after a successful build of the package create a tag for the current
- version in <filename>tags/packages/my_package</filename>. The tagging is done directly in the
- SVN repository.
- </para>
-
- <tip>
- <para>
- Some useful aliases taken from the
- <application>svn-buildpackage</application> HOWTO:
- <programlisting>
-alias svn-b='svn-buildpackage -rfakeroot --svn-dont-clean -us -uc --svn-ignore'
-alias svn-bt='svn-buildpackage -rfakeroot --svn-lintian --svn-dont-clean --svn-tag'
- </programlisting>
- </para>
-
- <para>
- The former (<command>svn-b</command>) is to be used for test builds, while you are
- working on your package; while the latter (<command>svn-bt</command>) is to be used at
- the end, after you commit your changes and just before uploading a new
- version of the package to the debian archive.
- </para>
-
- <para>
- Adding -k<your gpg id> to the svn-bt alias may also be useful when working on
- collaboratively maintained packages:
- <programlisting>
-alias svn-bt='svn-buildpackage -rfakeroot -k<gpgid> --svn-lintian --svn-dont-clean --svn-tag'
- </programlisting>
- </para>
- </tip>
-</section>
-
-<section>
- <title>dpatch</title>
-
- <para>
- dpatch will work properly at package build time with the SVN
- structure described above since all of the build process will be
- carried out in a fresh directory. However, invoking
- <filename>debian/rules</filename> with the "clean" target in
- the <filename>trunk/</filename> directory will fail since
- dpatch is unable to de-apply patches. Passing
- <option>--svn-dont-clean</option> to
- <application>svn-buildpackage</application> fixes this
- misbehaviour (aliases suggested above already include this
- flag). </para>
-
- <para>
- If you want to use dpatch-edit-patch to handle patches, you will need to invoke
- it in "debian only mode" (<option>-b</option> flag, see man dpatch-edit-patch) and to tell him
- where to find the upstream tarball. Adding the following line to your
- <filename>~/.dpatch.conf</filename> will be enough:
- <programlisting>
-conf_origtargzpath=../tarballs
- </programlisting>
- </para>
-</section>
-
+++ /dev/null
- <!--author>
- <firstname>Sven</firstname>
- <surname>Luther</surname>
- <affiliation>
- <orgname>The Debian Project</orgname>
- <address><email>luther@debian.org</email></address>
- </affiliation>
- </author>
- <author>
- <firstname>Stefano</firstname>
- <surname>Zacchiroli</surname>
- <affiliation>
- <orgname>The Debian Project</orgname>
- <address><email>zack@debian.orgcs.unibo.it</email></address>
- </affiliation>
- </author>
- <author>
- <firstname>Sylvain</firstname>
- <surname>Le Gall</surname>
- <affiliation>
- <orgname>The NM Debian Project</orgname>
- <address><email>sylvain.le-gall@polytechnique.org</email></address>
- </affiliation>
- </author>
- <author>
- <firstname>Ralf</firstname>
- <surname>Treinen</surname>
- <affiliation>
- <orgname>The NM Debian Project</orgname>
- <address><email>treinen@debian.org</email></address>
- </affiliation>
- </author-->
-<author>
- <affiliation>
- <orgname>The Debian OCaml Task Force</orgname>
- <address><email>debian-ocaml-maint@lists.debian.org</email></address>
- </affiliation>
-</author>
+++ /dev/null
-<section id="name-ocaml">
- <title>The Name of the Game</title>
-
- <para>
- The correct short name of Objective Caml
- is <emphasis>&ocaml-name;</emphasis>. Other
- spellings/capitalizations
- like <quote>ocaml</quote>, <quote>OCAML</quote>, <quote>O'Caml</quote>
- should be avoided when talking about the Objective Caml project,
- the system, or the programing language.
- </para>
- </section>
-
-<section id="bytecode-native">
- <title>Bytecode and Native Code</title>
-
-
-
- <section>
- <title>Bytecode and Native Code Executables</title>
-
- <para>
- The OCaml compiler can produce two kinds of executables: bytecode
- and native. Native executables (produced by the compiler
- <filename>ocamlopt</filename>) are generally faster than bytecode
- executables since they are compiled specifically for an
- architecture. Bytecode executables (produced by the compiler
- &ocamlc;) have the advantage of being portable,
- which means that a bytecode executable can be run on any
- architecture without having to be recompiled. Bytecode executables
- are smaller than native code executables. If considering only one
- process the advantage in size is annihilated by the need for the
- OCaml run time system for executing bytecode, however there is an
- advantage when running several bytecode processes in parallel
- since the runtime system can then be shared. It should be noted
- that OCaml compilers to native code are not provided for every
- architecture. Only the following ones are supported:
- &supported-archs;. </para>
-
- <para>
- Packages providing both native and bytecode versions of a program
- <filename>prog</filename> usually name them respectively
- <filename>prog.opt</filename> and <filename>prog.byte</filename>
- and provide a symbolic link <filename>prog</filename> to the best
- available version (generally <filename>prog.opt</filename>).
- </para>
- </section>
-
- <section>
- <title>Bytecode and Native Code Compilers</title>
-
- <para>
- The <filename>ocaml-native-compilers</filename> package contains
- the OCaml compiler executables built in native mode:
- <command>ocamlc.opt</command>, which produces bytecode, and
- <command>ocamlopt.opt</command>, which produces native
- code. Since the OCaml compilers are themselves written in OCaml
- this package exists only on architectures where compilation to
- native code is supported.
- </para>
-
- <para>
- The <filename>ocaml-nox</filename> package contains the OCaml
- compiler executables built in bytecode mode:
- <command>ocamlc</command>, which produces bytecode, and on
- architectures where compilation to native code is supported the
- compiler <filename>ocamlopt</filename>, which produces native
- code. It is important to understand that on architectures where
- compilation to native code is supported <emphasis>both</emphasis>
- packages contain compilers from OCaml to both bytecode and native
- code, the difference lies in the nature (installation size and
- execution speed) of the compiler executables.
- </para>
-
- <table>
- <title>OCaml Compilers</title>
- <tgroup cols="3">
- <thead>
- <row>
- <entry></entry>
- <entry>Compiles to bytecode</entry>
- <entry>Compiles to native code</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Compiler executable in bytecode</entry>
- <entry><command>ocamlc</command></entry>
- <entry><command>ocamlopt</command></entry>
- </row>
- <row>
- <entry>Compiler executable in native code</entry>
- <entry><command>ocamlc.opt</command></entry>
- <entry><command>ocamlopt.opt</command></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
-
- <para>
- Compiling with native code versions of the compilers is generally
- faster than with compilers in bytecode. Unfortunately, the
- <filename>ocaml-native-compilers</filename> package is not
- available on every architecture. <emphasis>Packages should
- therefore never depend directly on this package.</emphasis> In
- order to build big programs and benefit from this natively built
- compiler, packages should depend on
- <filename>ocaml-best-compilers</filename> which itself depends on
- <filename>ocaml-native-compilers</filename> where available and on
- <filename>ocaml</filename> elsewhere. Since it is a virtual
- package, it cannot (yet) be a versioned dependency. The version
- dependency should thus be carried by the
- <filename>ocaml</filename> dependency. Note that dependency on
- <filename>ocaml-best-compilers</filename> is only necessary for
- real big programs for which compilation takes a lot of
- resources. For most small programs the compilers from the
- <filename>ocaml-nox</filename> package are perfectly sufficient,
- and faster to install in a build environment than compiler executables
- in native code.
- </para>
- </section>
-</section>
-
-<section>
- <title>OCaml in Debian</title>
-
- <para>
- At the time of this writing, the latest version of OCaml in
- Debian is &ocaml-version;. </para>
-
- <section>
- <title>Packages for OCaml</title>
- <para>
- The <filename>ocaml</filename> package depends on all the basic
- packages needed to develop programs with OCaml. More specifically,
- the packaging of OCaml is split into smaller packages. The
- packages with suffix <filename>-nox</filename> contain libraries
- that don't need X (i.e., for programs that don't use the
- <code>Graphics</code> or <code>LablTk</code> modules) in order to
- avoid dependencies on big packages for users who do not need to
- run graphical applications. Here is the list of binary packages into
- which OCaml is split:
-
- <orderedlist>
- <listitem>
- <para>
- The <filename>ocaml</filename> and <filename>ocaml-nox</filename> packages contain the compiler and its libraries.
- </para>
- </listitem>
- <listitem>
- <para>
- The <filename>ocaml-native-compilers</filename> package contains the OCaml compilers built in native mode (<command>ocamlc.opt</command> and <command>ocamlopt.opt</command>).
- </para>
- <note>
- <para>The compilers themselves are built in native mode, nonetheless, both compilers for compiling toward bytecode and native code are contained in this package.</para>
- </note>
- </listitem>
- <listitem>
- <para>
- The <filename>ocaml-base</filename> and <filename>ocaml-base-nox</filename> packages contain the interpreter and runtime libraries needed by bytecode programs compiled with OCaml (in particular, the package <filename>ocaml-base-nox</filename> contains the <filename>ocamlrun</filename> program).
- </para>
- </listitem>
- <listitem>
- <para>
- The <filename>ocaml-interp</filename> package contains the toplevel system for OCaml (<filename>ocaml</filename>) which provides for an interactive interpreter of the language.
- </para>
- </listitem>
- <listitem>
- <para>
- The <filename>ocaml-mode</filename> package contains the OCaml Emacs mode (the one provided with OCaml, not the tuareg mode which is in the package <filename>tuareg-mode</filename>).
- </para>
- </listitem>
- <listitem>
- <para>
- The <filename>ocaml-source</filename> package contains the sources of the OCaml compiler.
- </para>
- </listitem>
- <listitem>
- <para>
- The <filename>ocaml-compiler-libs</filename> package contains some internal libraries of the OCaml compiler (needed only in very rare cases, e.g. for developing languages which reuse OCaml internals).
- </para>
- </listitem>
- </orderedlist>
- </para>
-
- <para>
- Since libraries produced by OCaml are binary incompatible when
- compiled with different releases of OCaml, versioned virtual
- packages are also provided by packages at items (1) and (2):
- <filename>ocaml-&ocaml-version;</filename>,
- <filename>ocaml-nox-&ocaml-version;</filename>,
- <filename>ocaml-base-&ocaml-version;</filename>,
- <filename>ocaml-base-nox-&ocaml-version;</filename>.
-</para>
-</section>
-
- <section>
- <title>OCaml Location</title>
- <para>
- The root of all installed OCaml libraries is the <emphasis>OCaml
- standard library directory</emphasis>, which is
- <filename>/usr/lib/ocaml/VERSION/</filename>, at the time of writing
- <filename>&ocaml-sys-dir;</filename>. This location can be obtained
- from the OCaml compiler by invoking it as <userinput>ocamlc -where</userinput>.
- </para>
-
- </section>
-
-</section>
-
-
-
-<section id="files">
- <title>Files Used and Produced by the OCaml Compiler</title>
-
- <para>
- The &ocaml-name; compiler can produce or use the following kind of files:
- <itemizedlist>
- <listitem><para>bytecode executables (they can be recognized since they start with the shebang line <code>#!/usr/bin/ocamlrun</code>)</para></listitem>
- <listitem>
- <para>bytecode executables linked in <emphasis>custom mode</emphasis>. They are generated by <command>ocamlc</command> (or <command>ocamlc.opt</command>), when the <userinput>-custom</userinput> flag is given at link time. Those executables are in ELF format and include both the final bytecode and the bytecode interpreter. <command>strip</command> should never be invoked on them, since it will remove the bytecode part.
- </para>
- </listitem>
- <listitem><para>native executables (in ELF format)</para></listitem>
- <listitem><para>bytecode libraries (<filename>*.cma</filename>)</para></listitem>
- <listitem><para>native libraries (<filename>*.cmxa</filename>)</para></listitem>
- <listitem><para>shared libraries (for C bindings) (<filename>dll*.so</filename>, <filename>lib*.so</filename>)</para></listitem>
- <listitem><para>static libraries (for C bindings) (<filename>lib*.a</filename>)</para></listitem>
- <listitem><para>bytecode object files (<filename>*.cmo</filename>)</para></listitem>
- <listitem><para>native object files (<filename>*.cmx</filename>)</para></listitem>
- <listitem><para>configuration files for handling libraries with <filename>ocamlfind</filename> (<filename>META</filename>)</para></listitem>
- </itemizedlist>
- </para>
-</section>
-
-<section id="liblocal-path">
- <title>Locally Installing OCaml Programs and Libraries</title>
-
- <para>
- Locally installed files are files that are installed directly by
- the system administrator, in contrast to files installed through
- Debian packages. Installation and use of locally installed
- OCaml related programs is out of the scope of this
- document. However, in order to have it work with a standard
- Debian installation, a local system administrator should follow
- these guidelines:
- <itemizedlist>
- <listitem>
- <para>
- Executable files should be installed
- in <filename>/usr/local/bin</filename>.
- </para>
- </listitem>
- <listitem>
- <para>
- Shared libraries (for C bindings) should be installed
- in <filename>/usr/local/lib/ocaml/&ocaml-version;/stublibs/</filename>
- </para>
- </listitem>
- <listitem>
- <para>
- Basically, every other file should be installed
- in <filename>/usr/local/lib/ocaml/&ocaml-version;/</filename>. This
- includes in particular bytecode libraries
- (<filename>*.cma</filename>), native libraries
- (<filename>*.cmxa</filename>), bytecode object files
- (<filename>*.cmo</filename>), native object files
- (<filename>*.cmx</filename>), static libraries
- (<filename>*.a</filename>) and <filename>META</filename>
- files.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- The default configuration of <filename>ocamlfind</filename> (the OCaml
- library manager recommended in Debian) first looks for a local
- installation of libraries and then for libraries installed by Debian
- packages. The next section describes the standard paths for files
- contained in Debian packages.
- </para>
-
- <warning>
- <para>
- The <varname>+</varname> preceding any library in the <option>-I</option> of <command>ocamlc</command> or <command>ocamlopt</command> won't be expanded to the local standard library path. You need to specify the path entirely.
- </para>
- </warning>
-
-</section>
-
-<section id="doc-base">
- <title>Registering Documentation with doc-base</title>
- <para>
- Documentation relevant to programming in OCaml (language, tools,
- libraries, ...) should be registered with doc-base in
- Section <code>Programming/OCaml</code>.
-</para>
-</section>
+++ /dev/null
-<section>
- <title>Creating Packages for OCaml Libraries</title>
-
- <para>
- A package which provides an OCaml library called <filename>xxx</filename> should be split as follows:
-
- <itemizedlist>
- <listitem>
- <para>
- For libraries which are not purely programmed in OCaml (e.g. C bindings), <filename>libxxx-ocaml</filename> should provide the shared library stubs (<filename>dll*.so</filename>), and all other stuff needed to run a bytecode executable that links into this library. It should depend on <filename>ocaml-base-&ocaml-version;</filename> (or <filename>ocaml-base-nox-&ocaml-version;</filename>) as well as any other library needed. The <emphasis>versioned</emphasis> dependency on <filename>ocaml-base</filename> is important since libraries are binary incompatible between releases of OCaml.
- </para>
- <para>
- <filename>libxxx-ocaml</filename> packages should be in <code>Section: libs</code>
- </para>
- </listitem>
- <listitem>
- <para>
- <filename>libxxx-ocaml-dev</filename> should provide the rest of the library package, in fact anything needed to develop programs using the library. If the library uses other libraries or C libraries, this package should depend on them.
- </para>
- <para>
-
- <filename>libxxx-ocaml-dev</filename> should depend on its
- companion <filename>libxxx-ocaml</filename> package (if any).
- The reason is that at compile time the &ocaml-name; compiler
- will try to load the shared library stubs, aborting the
- compilation in case of failure. Hence the development package
- is useless if the corresponding stub package is missing. To
- ensure compatibility the dependency among the two packages
- should be strictly versioned. In order for the resulting
- packages to be <ulink
- url="http://wiki.debian.org/binNMU">binNMU safe</ulink> this
- requirement states that the dependency should make use of a
- <code>${binary:Version}</code> substitution variable.
-
- <example>
- <title>Dependency from a -dev package to its companion share
- library stub package (if any), from the
- <application>pcre-ocaml</application> package</title>
- <programlisting>
- Package: libpcre-ocaml
- Architecture: any
- Section: libs
- Depends: ocaml-base-nox-${F:OCamlABI}, ${shlibs:Depends}, ${misc:Depends}
- ...
-
- Package: libpcre-ocaml-dev
- Architecture: any
- Section: libdevel
- Depends: ocaml-nox-${F:OCamlABI}, libpcre3-dev (>= 4.5), <emphasis>libpcre-ocaml (= ${binary:Version})</emphasis>, ocaml-findlib (>= 1.1), ${misc:Depends}
- ...
- </programlisting>
- </example>
-
- </para>
- <para>
- <filename>libxxx-ocaml-dev</filename> packages should be in <code>Section: libdevel</code>
- </para>
- <para>
- All &ocaml-name; bytecode libraries
- (<filename>*.cma</filename>) and bytecode object files
- (<filename>*.cmo</filename>) should be compiled for
- debugging, i.e. they should be compiled passing the
- <option>-g</option> option to <command>ocamlc</command> (or
- <command>ocamlc.opt</command>).
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- Optionally, two other packages may be created:
- <itemizedlist>
- <listitem>
- <para>
- <filename>libxxx-ocaml-bin</filename> may include binaries provided by the library source package if they are numerous. This package should conform with the same regulations as other packages providing ocaml programs. It is only needed to split off this package if there is a significant number of programs included in the library, if not, the programs should go into <filename>libxxx-ocaml-dev</filename>.
- </para>
- </listitem>
- <listitem>
- <para>
- <filename>libxxx-ocaml-doc</filename> may include any kind of documentation provided by the library source package or as separate documentation. Again, if there is only little documentation, they should go with the <filename>-dev</filename> package.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- It is recommended that libraries use the <option>-pack</option> option to pack all the modules provided by the library into one module.
- <!-- ZACK: yes, it works, it has been fixed in ocaml 3.09.1 IIRC -->
- <!--We are not sure this really works right now for libraries, and-->
- We don't think upstream libraries will be moving to this scheme anytime soon (unless we actively lobby for it) so this is just a recommendation for now.
- </para>
-
- <para>
- It is recommended that each library package ships a <filename>META</filename> file in order to make the library usable via <filename>ocamlfind</filename> (see the Debian package <filename>ocaml-findlib</filename>). See <xref linkend="META" /> for more information on this.
- </para>
-</section>
-
-<section id="library-path">
- <title>Paths for libraries</title>
-
- <para>
- Libraries should be installed in <filename>&ocaml-sys-dir;/</filename> or in a subdirectory of this directory. This includes in particular bytecode libraries (<filename>*.cma</filename>), native libraries (<filename>*.cmxa</filename>), bytecode object files (<filename>*.cmo</filename>), native object files (<filename>*.cmx</filename>), static libraries (<filename>*.a</filename>) and <filename>META</filename> files. The only exception to this rule is for shared libraries (<filename>dll*.so</filename>) which should be installed in <filename>&ocaml-sys-dir;/stublibs</filename>, as can it be seen in the <filename>&ocaml-sys-dir;/ld.conf</filename> file.
- </para>
-
- <para>
- If upstream developers already use a subdirectory of the OCaml standard library path, this path should be preserved in the Debian package but made relative to the standard library path of OCaml. Before using the provided subdirectory, packagers should obviously check if there is no subdirectory name clash with another OCaml library.
- </para>
-
- <para>
- If upstream developers don't use this scheme, packagers are encouraged not to install this library in the standard library directory. They should create at least a subdirectory per source package (in order to avoid name clashes). Packagers should also consider to do a larger separation by creating a subdirectory per binary package (in order to avoid META name clash). A suggested rule to choose name for this subdirectory is to use either the package name provided by the META of the upstream, or the name of the library itself.
- </para>
-</section>
-
-<section>
- <title>Handling dependencies on OCaml</title>
- <para>
- Some parts of the package need to know the current version of OCaml. For example, libraries should be installed <filename>&ocaml-sys-dir;/</filename>. However, <emphasis>the current version of OCaml should never be hardcoded in the package</emphasis> (&ocaml-version; here). This would make a binNMU impossible when the version of OCaml changes. Instead <filename>.in</filename> files should be used where <varname>@OCamlABI@</varname> is replaced at <emphasis>build-time</emphasis> by the current OCaml version.
- </para>
-
- <para>
- For example, the package <filename>ocaml-mad</filename> would normally contain a file <filename>libmad-ocaml-dev.install</filename> for installing files with <filename>dh_install</filename>, containing:
- <programlisting>
- usr/lib/ocaml/&ocaml-version;/mad/META
- usr/lib/ocaml/&ocaml-version;/mad/*.a
- usr/lib/ocaml/&ocaml-version;/mad/*.cm*
- usr/lib/ocaml/&ocaml-version;/mad/*.ml*
- </programlisting>
- In order to avoid the explicit mention of the version of OCaml (&ocaml-version;), the package actually contains instead a file <filename>libmad-ocaml-dev.install.in</filename> which contains:
- <programlisting>
- usr/lib/ocaml/@OCamlABI@/mad/META
- usr/lib/ocaml/@OCamlABI@/mad/*.a
- usr/lib/ocaml/@OCamlABI@/mad/*.cm*
- usr/lib/ocaml/@OCamlABI@/mad/*.ml*
- </programlisting>
- The string <varname>@OCamlABI@</varname> is substituted at build-time by the version of OCaml. Here are the relevant parts of the <filename>debian/rules</filename> file:
- <programlisting>
- OCAMLABI := $(shell ocamlc -version)
- OFILES := $(filter-out debian/control,$(patsubst %.in,%,$(wildcard debian/*.in)))
-
- ocamlinit:
- for f in $(OFILES); do sed -e 's/@OCamlABI@/$(OCAMLABI)/g' $$f.in > $$f; done
-
- config.status: ocamlinit configure
- [...]
-
- .PHONY: build clean binary-indep binary-arch binary install ocamlinit
- </programlisting>
- </para>
-
- <para>
- The only exception to this rule (properly handled by the example above) is the <filename>debian/control</filename> file, which should never be generated at build-time. As explained in <xref linkend='bytecode-native-prog'/>, the dependency should nevertheless not hardcode the version of OCaml: the <filename>debian/control</filename> file should have a <varname>Depends: ocaml-base-nox-${F:OCamlABI}</varname> which is filled by a <code>dh_gencontrol -s -- -VF:OCamlABI="$(OCAMLABI)"</code> in the <filename>debian/rules</filename> file.
- </para>
-</section>
-
-<section id="META">
- <title>Providing <filename>META</filename> files</title>
-
- <para>
- The <filename>ocaml-findlib</filename> provides a tool (named <filename>ocamlfind</filename>) to handle OCaml libraries and store information about libraries dependencies, compiler flags, linking options, etc. Meta informations regarding a library are contained in files (usually one for each library), named <filename>META</filename> files, contained in the library directory. The distribution of <filename>META</filename> files is the best way to make more easy to use the Debian-specific oragnization of libraries. Packages distributing <filename>META</filename> files should suggest the use of &ocamlfind;, that is have a <varname>Suggest: ocaml-findlib</varname>.
- </para>
-
- <para>
- By default, &ocamlfind; will look for <filename>META</filename> in this order:
- <itemizedlist>
- <listitem><para><filename>&ocaml-metas-dir;/</filename></para></listitem>
- <listitem><para><filename>&ocaml-sys-dir;/package/</filename></para></listitem>
- </itemizedlist>
- </para>
-
- <para>
- The naming scheme of <filename>META</filename> is pretty simple.
- <itemizedlist>
- <listitem>
- <para>
- If the <filename>META</filename> file is placed in the subdirectory
- of the package, it should be called <filename>META</filename>.
- </para>
- </listitem>
- <listitem>
- <para>
- If the <filename>META</filename> file is placed in <filename>&ocaml-metas-dir;/</filename>, it should be called <filename>META.packagename</filename>, where <filename>packagename</filename> is the name of the subdirectory where the library is stored.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- For example, the <filename>META</filename> file for the lablgtk library is named <filename>META</filename> and has path <filename>&ocaml-sys-dir;/lablgtk/META</filename>, where <filename>&ocaml-sys-dir;</filename> is the main OCaml installation directory and <filename>lablgtk</filename> is the lablgtk library directory.
- </para>
-
- <para>
- If upstream doesn't provide a <filename>META</filename>, packagers are encouraged to create one. In this case, the <filename>META</filename> should be sent to upstream authors, in order to have it included in the next version of the upstream source. For more information about <filename>META</filename> files, have a look at the <ulink url="http://www.ocaml-programming.de/packages/documentation/findlib/">Findlib manual</ulink>, at the several META files provided by other packages (e.g. <filename>lablgtk</filename>, <filename>pxp</filename>, <filename>pcre</filename>, <filename>netstring</filename>, <filename>lablgl</filename>, ...) or ask on the debian-ocaml-maint mailing list for help.
- </para>
-</section>
-
-<!--
-<section id="ocamldoc-base-path">
- <title>&ocamldoc; specific generated documentation</title>
-
- <para>
- Even if this way of producing documentation is not mandatory, packagers are
- encouraged to use it, in order to ship lighter documentation, which could
- be processed by &ocaml-name; tools.
- </para>
-
- <para>
- By default, &ocamldoc-base; will look for <filename>*.odoc</filename> in this order :
- <variablelist>
- <varlistentry>
- <term><varname>local</varname></term>
- <listitem><para><filename>/usr/local/share/ocamldoc/&ocaml-version;/</filename></para></listitem>
- </varlistentry>
- <varlistentry>
- <term><varname>core</varname></term>
- <listitem><para><filename>/usr/share/ocamldoc/&ocaml-version;/</filename></para></listitem>
- </varlistentry>
- </variablelist>
- </para>
-
- <para>
- As for library, the naming scheme of the <filename>*.odoc</filename> should be
- at least the name of the source package from which the documentation was
- generated. If a source package is split in many binary package and the
- documentation comes only in one <filename>*.odoc</filename>, packagers are
- encouraged to create a separate package and to <varname>Suggest:</varname> it
- in each binary package which he described. If this could not be met, it is at
- least a good practice to <varname>Suggest:</varname> the package containing
- the documentation.
- The packager should consider to ship one <filename>*.odoc</filename> per
- library package.
- </para>
-
- <para>
- By doing this, &ocaml-force; is trying to build a clear way of distributing
- documentation. It should help user to find and exploit the documentation
- coming from the source. Generating &ocamldoc; documentation is not so hard,
- and should take a one line call. Commenting the code in order to generate
- fully functional documentation is however an upstream task. Packager are encouraged
- to patch <filename>Makefile</filename> in order to have a target
- <varname>odoc</varname>, generating this documentation and to contact upstream
- author to have a well commented source.
- </para>
-</section>
--->
-
-<section id="camlp4-path">
- <title>&camlp4;/&camlp5;</title>
-
- <para> Actually, &camlp4; extensions should be processed just as standard
- OCaml library. The META file distributed with this syntax extension
- should follow the
- <ulink url="http://cocan.org/osr/meta_files_for_packages_containing_syntax_extensions">
- OSR: META files for packages containing syntax extensions</ulink>. In
- particular, the syntax extension should be contained in a <varname>syntax</varname> sub
- packages.
- </para>
-
- <para>
- The naming convention of the package is to use the same naming as with
- standard package, replacing <varname>-ocaml-</varname> by the syntax
- extension name, <varname>-camlp4-</varname>.
- </para>
-
- <para>
- If a package contains at the same time syntax extension and library, it
- is up to the maintainer to choose the most relevant name for the package.
- Whatever the name chosen for the package, the other name should be a
- <varname>Provide</varname> of the package.
- </para>
-
- <para>
- For example, consider the package <application>sexplib310</application>.
- It provides a syntax extension and a library, which is the runtime support
- of the additional function generated by the syntax extension. Since the most
- common use of <application>sexplib310</application> is through its syntax
- extension, the package is name
- <application>libsexplib-camlp4-dev</application> and it also provide
- <application>libsexplib-ocaml-dev</application>.
- </para>
-
- <para>
- &camlp5; is an alternate pretty-printer and preprocessor for OCaml
- (which is compatible with pre-3.10.0 version). Syntax extension are
- handled through exactly the same scheme as for &camlp4; except that
- package name use <varname>-camlp5-</varname> rather than
- <varname>-camlp4-</varname>.
- </para>
-</section>
-
-<section id="documentation">
- <title>Documentation</title>
- <para>
- The documentation is a joint effort of &ocaml-force; and usptream.
- There are many ways to have documentation:
- <itemizedlist>
- <listitem><para>header files (<filename>*.mli</filename>),</para></listitem>
- <listitem><para>source files (<filename>*.ml</filename>),</para></listitem>
- <listitem><para>specific documentation provided by the upstream,</para></listitem>
- <listitem><para>OCamldoc generated documentation.</para></listitem>
- </itemizedlist>
- </para>
-
- <para>
- This documentation should be browsable by different mean, from the
- most simple to the most complex. At least, they should all be readable with
- simple text editor. Specific and &ocamldoc; generated documentations should be provided in HTML format.
- There are also at least two
- specific &ocaml-name; browser : <application>docbrowse</application> shipped
- with <application>cameleon</application> and <application>ocamlbrowser</application>
- shipped with &ocaml-name; itself. The first one, needs specific
- &ocamldoc; generated documentation. The second one enables
- the user to browse directly the prototype of each function shipped in the <filename>cmi</filename> gives
- to the application.
- </para>
-
- <para>
- You can generate &ocamldoc;-specific documentation by using
- the <option>-dump</option> of this application. By using this, you dump the
- intermediary representation of the document that will be generated by ocamldoc.
- This can be used to generate HTML documentation and manpages, by reloading this
- file (using <option>-load</option>).
- </para>
-
- <para>
- As of today, there is no way to post-process &ocamldoc;
- specific documentation. A &debian-name; package is under construction to do this
- task. It will be referred as &ocamldoc-base;.
- </para>
-</section>
+++ /dev/null
-<section>
- <title>Creating Packages for OCaml Programs</title>
- <para>
- Any package providing executables built from OCaml source should conform to the following guidelines.
- </para>
-
- <para>
- The source package should, if possible, use the name of the upstream
- package without modifications.
- </para>
-
- <para>
- Programs which are not particularly CPU hungry should be
- compiled into bytecode form, and the corresponding binary packages
- should be <code>Architecture: all</code> in order to minimize
- archive usage and avoid the need of rebuilding them on all
- architectures. See <xref linkend="bytecode-prog" /> for details on
- this kind of packages.
- </para>
-
- <para>
- Other programs
- should be compiled into native form on architectures where the native
- compiler is available, and into bytecode on other architectures.
- See <xref linkend="bytecode-native-prog" /> for details on how to achieve
- this. The corresponding binary packages should be <code>Architecture:
- any</code> and will need to be built on any architecture.
- </para>
-
- <para>
- All bytecode executables should be linked dynamically against the shared libraries for C bindings, so as to not bloat the archive.
- <!-- ZACK: which cases? -->
- <!--However, there may be special cases, were using statically linked bytecode is necessary, in these cases, it is naturally ok to link statically.-->
- That said, often the upstream authors will favor statically linked bytecode executables, because so they don't need to worry about the presence of the dll stub libraries and such. This is not a valid reason to use statically linked bytecode in a Debian package.
- <!-- ZACK: related to the commented stuff above -->
- <!--If statically linked bytecode is provided, a justification of this use should be provided in the <filename>README.Debian</filename> file.-->
- </para>
-</section>
-
-<section id="bytecode-prog">
-<title>Bytecode Packages</title>
-<para>
-A bytecode package has all
-its binaries compiled into bytecode. It depends on a package
-containing the OCaml runtime system. By consequence, such a package
-has its architecture field set to <code>all</code>.
-</para>
-
-<para>
-A bytecode package must depend on
-<filename>ocaml-base-nox-&ocaml-version;</filename> (or
-<filename>ocaml-base-&ocaml-version;</filename> if the program either
-uses the <code>Graphics</code> or the <code>LablTk</code> module). In
-order for the package to be able to be rebuilt or even binNMUed
-without a change in the packaging, <emphasis>this version should not
-be hardcoded in the <filename>debian/control</filename>
-file.</emphasis> Instead, the package should depend on
-<varname>ocaml-base-nox-${F:OCamlABI}</varname> and use <code>OCAMLABI
-:= $(shell ocamlc -version)</code> and <code>dh_gencontrol --
--VF:OCamlABI="$(OCAMLABI)"</code> in the
-<filename>debian/rules</filename> file.
-</para>
-
-<para>
-A bytecode package must build-depend-indep on
-<filename>ocaml-nox-&ocaml-version;</filename> (or
-<filename>ocaml-&ocaml-version;</filename> if the program either uses
-the <code>Graphics</code> or the <code>LablTk</code> module). The
-current version number of OCaml should <emphasis>not</emphasis> be hardcoded
-into the build-dependency (this is a deviation from a practice which
-used be recommended but is depreciated now). Of course, if it is
-necessary to ensure that the version of OCaml has a certain value then
-version constraints can be used. However, this should be justified by
-the requirements of the compilation of the program.
-</para>
-
-<para>
- Bytecode programs which are compiled by <userinput>ocamlc -custom</userinput> must not be stripped. In particular, their package should be excluded from the <command>dh_strip</command> script. When compiled this way, an elf executable is generated containing the ocaml interpreter, and the bytecode of the program in a section which is removed when the program is stripped. For more information, see the bug <ulink url="http://bugs.debian.org/256900">256900</ulink>. An override for the lintian warning is considered as acceptable in this situation.
-</para>
-
-<para>
- Bytecode programs should not be compiled for debugging, i.e. they should not
- be compiled passing the <option>-g</option> option to
- <command>ocamlc</command> (or <command>ocamlc.opt</command>).
-</para>
-
-</section>
-
-<section id="bytecode-native-prog">
- <title>Bytecode and native versions of programs</title>
- <para>
- As explained in <xref linkend='bytecode-native' />, native OCaml compilers are not available everywhere. For architectures missing native compiler, a bytecode version of the program should be provided.
- </para>
-
- <para>
- The package's <filename>debian/rules</filename> should build the native code executable if supported on the architecture it is built on, and fall back to building the bytecode version if no working native code compiler is available. Exceptions to this are the executables who are small or not time critical, which may be built only as bytecode. It is the decision of the individual maintainers to choose this, maybe guided by the practice of the upstream author.
- </para>
-
- <para>
- The availability of the native compiler can be tested in the <filename>debian/rules</filename> file by testing the possibility of executing <filename>/usr/bin/ocamlopt</filename>, and build the bytecode version or the native version of the program according to the result of the test. This is a sample snippet of <filename>debian/rules</filename> doing so:
- <programlisting>
- build-stamp:
- dh_testdir
-
- if [ -x /usr/bin/ocamlopt ]; then \
- $(MAKE) opt; \
- else \
- $(MAKE) all; \
- fi
- </programlisting>
- </para>
-
- <para>
- The bytecode versions are portable. In order to spare the buildds and the Debian archive, bytecode versions should be compiled once for all for big packages (which either take a lot of place on disks or take a lot of time to build). For example, the <filename>spamoracle</filename> package provides the <filename>spamoracle-byte</filename> package which is <varname>Architecture: all</varname> and contains the bytecode version of spamoracle, and the <filename>spamoracle</filename> package which contains the native version of spamoracle and is available only where a native OCaml compiler is available (<varname>Architecture: amd64 i386 kfreebsd-i386 powerpc sparc</varname>).
- </para>
-
- <para>
- Bytecode versions of the programs should depend on <filename>ocaml-base-nox-&ocaml-version;</filename> (or <filename>ocaml-base-&ocaml-version;</filename> the program either uses the <code>Graphics</code> or the <code>LablTk</code> module). In order for the package to be able to be rebuilt or even binNMUed without a change in the packaging, <emphasis>this version should not be hardcoded in the <filename>debian/control</filename> file.</emphasis> Instead, the package should depend on <varname>ocaml-base-nox-${F:OCamlABI}</varname> and use <code>OCAMLABI := $(shell ocamlc -version)</code> and <code>dh_gencontrol -- -VF:OCamlABI="$(OCAMLABI)"</code> in the <filename>debian/rules</filename> file.
- </para>
-
- <para>The following is a snippet of a sample <filename>debian/control</filename>:
- <programlisting>
- Package: spamoracle-byte
- Architecture: all
- Depends: ocaml-base-nox-${F:OCamlABI}
- Provides: spamoracle
- Conflicts: spamoracle
- Replaces: spamoracle
- </programlisting>
- </para>
- <para>The following its pairing <filename>debian/rules</filename> snippet:
- <programlisting>
- OCAMLABI := $(shell ocamlc -version)
- ...
- binary-indep: build install
- dh_gencontrol -i -- -VF:OCamlABI="$(OCAMLABI)"
- </programlisting>
- </para>
-
- <para>
- In the case where there is only one package, which provides either a native version where available or a bytecode version otherwise, the dependency on <varname>ocaml-base-nox-&ocaml-version;</varname> should be added only when the package is built in native mode. For example, the <filename>debian/control</filename> of <filename>approx</filename> contains:
- <programlisting>
- Package: approx
- Architecture: any
- Depends: ${shlibs:Depends}, ${F:OCamlRun}, adduser, bzip2, curl
- </programlisting>
- and the corresponding <filename>debian/rules</filename> contains:
- <programlisting>
- OCAMLABI = $(shell ocamlc -version)
- BYTECODE = $(shell [ -x /usr/bin/ocamlopt ] || echo yes)
- OCAMLRUN = $(if $(BYTECODE),ocaml-base-nox-$(OCAMLABI))
- ...
- binary-arch:
- ...
- dh_gencontrol -- -VF:OCamlRun="$(OCAMLRUN)"
- </programlisting>
- </para>
-
-</section>
+++ /dev/null
-<copyright>
- <year>2002</year><year>2003</year><year>2004</year><year>2005</year><year>2006</year><year>2007</year>
- <holder>Sylvain LE GALL, Sven LUTHER, Samuel MIMRAM, Ralf TREINEN,
- and Stefano ZACCHIROLI</holder>
-</copyright>
-<legalnotice>
- <para>
- This manual is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version
- 2 of the License, or (at your option) any later version.
- </para>
- <para>
- This is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU General Public License for more details.
- </para>
- <para>
- A copy of the GNU General Public License is available as
- <filename>/usr/share/common-licenses/GPL</filename> in the Debian GNU/Linux
- distribution or on the World Wide Web at
- <ulink url="http://www.gnu.org/copyleft/gpl.html">The GNU Public Licence</ulink>.
- </para>
- <para>
- You can also obtain it by writing to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
- </para>
-</legalnotice>
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
-"/usr/share/sgml/docbook/dtd/xml/4.3/docbookx.dtd" [
-<!ENTITY ocaml-version "3.10.2">
-<!ENTITY ocaml-sys-dir-base "/usr/lib/ocaml">
-<!ENTITY ocaml-sys-dir "&ocaml-sys-dir-base;/&ocaml-version;">
-<!ENTITY ocaml-metas-dir "&ocaml-sys-dir;/METAS">
-<!ENTITY supported-archs "amd64, i386, kfreebsd-i386, powerpc, sparc">
-<!ENTITY ocaml-compat "1">
-<!ENTITY ocaml-pkg "<application>ocaml</application>">
-<!ENTITY ocaml-vpkg "<application>ocaml-&ocaml-version;</application>">
-<!ENTITY ocaml-base-vpkg "<application>ocaml-base-&ocaml-version;</application>">
-<!ENTITY ocamlfind-pkg "<application>ocaml-findlib</application>">
-<!ENTITY ocamldoc-base "<application>ocamldoc-base</application>">
-<!ENTITY ocaml-name "<application>OCaml</application>">
-<!ENTITY ocaml-force "The Debian OCaml Task Force">
-<!ENTITY ocamlc "<application>ocamlc</application>">
-<!ENTITY ocamlopt "<application>ocamlopt</application>">
-<!ENTITY ocamldoc "<application>ocamldoc</application>">
-<!ENTITY ocamlfind "<application>ocamlfind</application>">
-<!ENTITY camlp4 "<application>Camlp4</application>">
-<!ENTITY camlp5 "<application>Camlp5</application>">
-<!ENTITY debian-name "Debian">
-<!ENTITY authors SYSTEM "authors.xml">
-<!ENTITY legal SYSTEM "legal.xml">
-<!ENTITY chapter-generalities SYSTEM "chapter-generalities.xml">
-<!ENTITY chapter-packaging SYSTEM "chapter-packaging.xml">
-<!ENTITY chapter-libpack SYSTEM "chapter-libpack.xml">
-<!ENTITY chapter-progpack SYSTEM "chapter-progpack.xml">
-<!ENTITY chapter-liblocal SYSTEM "chapter-liblocal.xml">
-<!ENTITY appendix-cdbs SYSTEM "appendix-cdbs.xml">
-<!ENTITY appendix-resources SYSTEM "appendix-resources.xml">
-<!ENTITY appendix-svn SYSTEM "appendix-svn.xml">
-]>
-<book>
- <bookinfo>
- <title>&debian-name; &ocaml-name; Packaging Policy for OCaml &ocaml-version;</title>
- <releaseinfo>Revision 0.7.2</releaseinfo>
- &authors;
- &legal;
- </bookinfo>
-
- <chapter id="generalities">
- <title>Generalities about &ocaml-name; packages in Debian</title>
- &chapter-generalities;
- </chapter>
-
- <chapter id="progpack">
- <title>Packaging OCaml Programs</title>
- &chapter-progpack;
- </chapter>
-
- <chapter id="libpack">
- <title>Packaging OCaml libraries</title>
- &chapter-libpack;
- </chapter>
-
- <appendix id="cdbs">
- <title>The OCaml CDBS class</title>
- &appendix-cdbs;
- </appendix>
-
- <appendix id="resources">
- <title>&ocaml-force; resources</title>
- &appendix-resources;
- </appendix>
-
- <appendix>
- <title>Using the SVN repository</title>
- &appendix-svn;
- </appendix>
-</book>
$(MAKE) -C debian/ocaml-md5sums all; \
fi
$(MAKE) -C debian/dh-ocaml
- $(MAKE) -C debian/policy
touch build-arch-stamp
build-indep: build-indep-stamp config-stamp
[ ! -f "$(CURDIR)/config/Makefile" ] || $(MAKE) -C emacs clean
$(MAKE) -C debian/ocaml-md5sums clean
$(MAKE) -C debian/dh-ocaml clean
- $(MAKE) -C debian/policy clean
# Restore files altered by debian/rules
for ext in sub guess; do \
if [ -f debian/config.orig.$$ext ] ; then \
cd debian/ocaml/usr/share/doc/ocaml; \
ln -sf ../ocaml-base-nox/Changes.gz .; \
ln -sf ../ocaml-base-nox/README.gz .; \
- ln -sf ../ocaml-base-nox/README.Debian .; \
- ln -sf ../ocaml-base-nox/ocaml_packaging_policy.txt.gz .; \
- ln -sf ../ocaml-base-nox/ocaml_packaging_policy.html .
+ ln -sf ../ocaml-base-nox/README.Debian .
cd debian/ocaml-nox/usr/share/doc/ocaml-nox; \
ln -sf ../ocaml-base-nox/Changes.gz .; \
ln -sf ../ocaml-base-nox/README.gz .; \
- ln -sf ../ocaml-base-nox/README.Debian .; \
- ln -sf ../ocaml-base-nox/ocaml_packaging_policy.txt.gz .; \
- ln -sf ../ocaml-base-nox/ocaml_packaging_policy.html .
+ ln -sf ../ocaml-base-nox/README.Debian .
cd debian/ocaml-base/usr/share/doc/ocaml-base; \
ln -sf ../ocaml-base-nox/Changes.gz .; \
ln -sf ../ocaml-base-nox/README.gz .; \
- ln -sf ../ocaml-base-nox/README.Debian .; \
- ln -sf ../ocaml-base-nox/ocaml_packaging_policy.txt.gz .; \
- ln -sf ../ocaml-base-nox/ocaml_packaging_policy.html .
+ ln -sf ../ocaml-base-nox/README.Debian .
# Remove empty directory
for i in `cat debian/ocaml-nox.empty-dirs`; do \