Fix file dispatch and add binary package ocaml-man
authorStephane Glondu <steph@glondu.net>
Thu, 11 Jul 2019 05:56:27 +0000 (07:56 +0200)
committerStephane Glondu <steph@glondu.net>
Thu, 11 Jul 2019 10:45:28 +0000 (12:45 +0200)
debian/control
debian/dispatch.ml [new file with mode: 0644]
debian/gen_modules.pl [deleted file]
debian/ocaml-base-nox.install.in [deleted file]
debian/ocaml-base.install.in [deleted file]
debian/ocaml-compiler-libs.install.in [deleted file]
debian/ocaml-interp.install.in [deleted file]
debian/ocaml-nox.install.in [deleted file]
debian/ocaml.install.in [deleted file]
debian/rules

index 8e8c504d476b6e94a402b28f951e562e14d489d3..88803001550f15bd60b8b375075eefc18a6bb197 100644 (file)
@@ -83,6 +83,7 @@ Suggests:
  ocaml-doc,
  tuareg-mode
 Recommends:
+ ocaml-man,
  file
 Replaces: ocaml-interp (<< 3.11.1-3), ocaml-native-compilers (<< 4.04.0-1)
 Breaks:
@@ -183,6 +184,8 @@ Depends:
  ocaml-nox-${F:OCamlABI}
 Provides:
  ocaml-compiler-libs-${F:OCamlABI}
+Recommends:
+ ocaml-man
 Replaces: ocaml-base-nox (<< 4)
 Breaks: ocaml-base-nox (<< 4)
 Description: OCaml interpreter and standard libraries
@@ -193,3 +196,23 @@ Description: OCaml interpreter and standard libraries
  This package contains several modules used internally by the OCaml
  compilers.  They are not needed for normal OCaml development, but may
  be helpful in the development of certain applications.
+
+Package: ocaml-man
+Architecture: all
+Depends:
+ ${misc:Depends}
+Breaks:
+ ocaml (<< 4.08),
+ ocaml-nox (<< 4.08),
+ ocaml-compiler-libs (<< 4.08)
+Replaces:
+ ocaml (<< 4.08),
+ ocaml-nox (<< 4.08),
+ ocaml-compiler-libs (<< 4.08)
+Description: OCaml interpreter and standard libraries (lib manpages)
+ Objective (OCaml) is an implementation of the ML language, based on
+ the Caml Light dialect extended with a complete class-based object system
+ and a powerful module system in the style of Standard ML.
+ .
+ This package contains ocamldoc-generated documentation about libraries
+ provided by OCaml.
diff --git a/debian/dispatch.ml b/debian/dispatch.ml
new file mode 100644 (file)
index 0000000..8c252bb
--- /dev/null
@@ -0,0 +1,235 @@
+(*
+  Description: called from debian/rules, generates debhelper's .install files
+  Copyright © 2019 Stéphane Glondu <glondu@debian.org>
+*)
+
+let rev_filter_map f xs =
+  let rec loop accu = function
+    | [] -> accu
+    | x :: xs ->
+       match f x with
+       | None -> loop accu xs
+       | Some y -> loop (y :: accu) xs
+  in loop [] xs
+
+let rev_read_lines fn =
+  let ic = open_in fn and res = ref [] in
+  try
+    while true do res := input_line ic :: !res done;
+    assert false
+  with End_of_file -> !res
+
+let startswith prefix str =
+  let p = String.length prefix and n = String.length str in
+  n >= p && String.sub str 0 p = prefix
+
+let endswith suffix str =
+  let p = String.length suffix and n = String.length str in
+  n >= p && String.sub str (n-p) p = suffix
+
+let chop_prefix prefix str =
+  let p = String.length prefix and n = String.length str in
+  if n >= p && String.sub str 0 p = prefix then
+    String.sub str p (n-p)
+  else
+    invalid_arg "chop_prefix"
+
+let get_base str =
+  let n = String.length str in
+  let last_slash = String.rindex_from str (n - 1) '/' in
+  let first_dot = try String.index_from str last_slash '.' with Not_found -> n in
+  let try_prefix prefix x = if startswith prefix x then chop_prefix prefix x else x in
+  String.sub str (last_slash + 1) (first_dot - last_slash - 1)
+  |> try_prefix "dll"
+  |> try_prefix "lib"
+  |> try_prefix "stdlib__"
+
+module SMap = Map.Make (String)
+
+let ocaml_base_nox = ref [ "debian/ld.conf usr/lib/ocaml" ]
+let ocaml_base = ref []
+let ocaml_nox =
+  ref [
+      "debian/ocamlfind/ocaml-native-compilers.conf usr/share/ocaml-findlib/";
+      "debian/native-archs usr/lib/ocaml";
+    ]
+let ocaml = ref []
+let ocaml_compiler_libs = ref []
+let ocaml_interp =
+  ref [
+      "debian/ocaml.desktop usr/share/applications";
+      "debian/ocaml.xpm usr/share/pixmaps";
+    ]
+let ocaml_man = ref []
+
+let pkgs = [
+    ocaml_base_nox, "ocaml-base-nox";
+    ocaml_base, "ocaml-base";
+    ocaml_nox, "ocaml-nox";
+    ocaml, "ocaml";
+    ocaml_compiler_libs, "ocaml-compiler-libs";
+    ocaml_interp, "ocaml-interp";
+    ocaml_man, "ocaml-man";
+  ]
+
+let set_nox = ocaml_base_nox, ocaml_nox
+let set_x = ocaml_base, ocaml
+
+let installed_files = rev_read_lines "debian/installed-files"
+
+let move_all_to pkg pred xs =
+  let rec loop accu = function
+    | [] -> accu
+    | x :: xs ->
+       if pred x then (
+         pkg := x :: !pkg;
+         loop accu xs
+       ) else (
+         loop (x :: accu) xs
+       )
+  in loop [] xs
+
+let static_map = ref SMap.empty
+
+let () =
+  List.iter (fun (file, pkg) -> static_map := SMap.add file pkg !static_map)
+    [
+      "usr/bin/ocamllex", ocaml_nox;
+      "usr/bin/ocamlopt", ocaml_nox;
+      "usr/bin/ocamloptp", ocaml_nox;
+      "usr/bin/ocamlcp", ocaml_nox;
+      "usr/bin/ocamlc", ocaml_nox;
+      "usr/bin/ocamldep", ocaml_nox;
+      "usr/bin/ocamlobjinfo", ocaml_nox;
+      "usr/bin/ocamlmklib", ocaml_nox;
+      "usr/bin/ocamlprof", ocaml_nox;
+      "usr/bin/ocamlmktop", ocaml_nox;
+      "usr/lib/ocaml/camlheader", ocaml_nox;
+      "usr/lib/ocaml/Makefile.config", ocaml_nox;
+      "usr/lib/ocaml/extract_crc", ocaml_nox;
+      "usr/lib/ocaml/camlheader_ur", ocaml_nox;
+      "usr/lib/ocaml/expunge", ocaml_nox;
+      "usr/lib/ocaml/VERSION", ocaml_nox;
+      "usr/lib/ocaml/target_camlheaderd", ocaml_nox;
+      "usr/lib/ocaml/objinfo_helper", ocaml_nox;
+      "usr/lib/ocaml/target_camlheaderi", ocaml_nox;
+      "usr/bin/ocamlmklib.opt", ocaml_nox;
+      "usr/bin/ocamllex.byte", ocaml_nox;
+      "usr/bin/ocamldebug", ocaml_nox;
+      "usr/bin/ocamlobjinfo.byte", ocaml_nox;
+      "usr/bin/ocamlprof.byte", ocaml_nox;
+      "usr/bin/ocamloptp.opt", ocaml_nox;
+      "usr/bin/ocamlmklib.byte", ocaml_nox;
+      "usr/bin/ocamlrund", ocaml_base_nox;
+      "usr/bin/ocamlcp.byte", ocaml_nox;
+      "usr/bin/ocamldep.opt", ocaml_nox;
+      "usr/bin/ocamldoc.opt", ocaml_nox;
+      "usr/bin/ocamlobjinfo.opt", ocaml_nox;
+      "usr/bin/ocamlyacc", ocaml_nox;
+      "usr/bin/ocaml-instr-graph", ocaml_nox;
+      "usr/bin/ocamlcmt", ocaml_nox;
+      "usr/bin/ocamlmktop.byte", ocaml_nox;
+      "usr/bin/ocamldoc", ocaml_nox;
+      "usr/bin/ocaml", ocaml_interp;
+      "usr/bin/ocamlcp.opt", ocaml_nox;
+      "usr/bin/ocaml-instr-report", ocaml_nox;
+      "usr/bin/ocamldep.byte", ocaml_nox;
+      "usr/bin/ocamloptp.byte", ocaml_nox;
+      "usr/bin/ocamlprof.opt", ocaml_nox;
+      "usr/bin/ocamlc.byte", ocaml_nox;
+      "usr/bin/ocamlruni", ocaml_base_nox;
+      "usr/bin/ocamllex.opt", ocaml_nox;
+      "usr/bin/ocamlopt.opt", ocaml_nox;
+      "usr/bin/ocamlmktop.opt", ocaml_nox;
+      "usr/bin/ocamlopt.byte", ocaml_nox;
+      "usr/bin/ocamlrun", ocaml_base_nox;
+      "usr/bin/ocamlc.opt", ocaml_nox;
+      "usr/share/man/man1/ocaml.1", ocaml_interp;
+      "usr/share/man/man1/ocamllex.1", ocaml_nox;
+      "usr/share/man/man1/ocamlyacc.1", ocaml_nox;
+      "usr/share/man/man1/ocamlrun.1", ocaml_base_nox;
+      "usr/share/man/man1/ocamldoc.1", ocaml_nox;
+      "usr/share/man/man1/ocamlcp.1", ocaml_nox;
+      "usr/share/man/man1/ocamloptp.1", ocaml_nox;
+      "usr/share/man/man1/ocamlc.1", ocaml_nox;
+      "usr/share/man/man1/ocamldep.1", ocaml_nox;
+      "usr/share/man/man1/ocamlmktop.1", ocaml_nox;
+      "usr/share/man/man1/ocamlopt.1", ocaml_nox;
+      "usr/share/man/man1/ocamlprof.1", ocaml_nox;
+      "usr/share/man/man1/ocamldebug.1", ocaml_nox;
+    ]
+
+let base_map = ref SMap.empty
+
+let () =
+  List.iter (fun x ->
+      try
+        let x = chop_prefix "usr/lib/ocaml/stdlib__" x in
+        let i = String.index x '.' in
+        base_map := SMap.add (String.sub x 0 i) set_nox !base_map
+      with _ -> ()
+    ) installed_files
+
+let () =
+  List.iter (fun x -> base_map := SMap.add x set_nox !base_map)
+    [
+      "camlinternalOO"; "camlinternalMod"; "camlinternalLazy";
+      "camlinternalFormatBasics"; "camlinternalFormat";
+      "topdirs";
+      "unix"; "unixLabels";
+      "str"; "camlstr";
+      "threads"; "vmthreads"; "threadsnat";
+      "profiling";
+      "camlrun"; "camlrund"; "camlruni"; "camlrun_pic"; "camlrun_shared";
+      "asmrun"; "asmrund"; "asmruni"; "asmrunp"; "asmrun_shared"; "asmrun_pic";
+      "raw_spacetime_lib";
+    ]
+
+let () =
+  List.iter (fun x -> base_map := SMap.add x set_x !base_map)
+    [ "graphics"; "graphicsX11" ]
+
+
+let exts_dev = [ ".ml"; ".mli"; ".cmi"; ".cmt"; ".cmti"; ".cmx"; ".cmxa"; ".a"; ".cmo"; ".o" ]
+let exts_run = [ ".cma"; ".cmxs"; ".so" ]
+
+let push xs x = xs := x :: !xs; None
+
+let process_static x =
+  match SMap.find_opt x !static_map with
+  | Some pkg -> push pkg x
+  | None -> Some x
+
+let process_file x =
+  let base = get_base x in
+  match SMap.find_opt base !base_map with
+  | Some set ->
+     if List.exists (fun y -> endswith y x) exts_dev then (
+       push (snd set) x
+     ) else if List.exists (fun y -> endswith y x) exts_run then (
+       push (fst set) x
+     ) else Some x
+  | None -> Some x
+
+let remaining =
+  installed_files
+  |> move_all_to ocaml_nox (startswith "usr/lib/ocaml/caml/")
+  |> move_all_to ocaml_nox (startswith "usr/lib/ocaml/ocamldoc/")
+  |> move_all_to ocaml_nox (startswith "usr/lib/ocaml/vmthreads/")
+  |> move_all_to ocaml_nox (startswith "usr/lib/ocaml/threads/")
+  |> move_all_to ocaml_nox (startswith "usr/lib/ocaml/std_exit.")
+  |> move_all_to ocaml_nox (startswith "usr/lib/ocaml/stdlib.")
+  |> move_all_to ocaml_nox (startswith "usr/lib/ocaml/dynlink")
+  |> move_all_to ocaml_compiler_libs (startswith "usr/lib/ocaml/compiler-libs/")
+  |> move_all_to ocaml_man (endswith ".3o")
+  |> rev_filter_map process_static
+  |> rev_filter_map process_file
+
+let () = assert (remaining = [])
+
+let () =
+  List.iter (fun (pkg, name) ->
+      let oc = Printf.ksprintf open_out "debian/%s.install" name in
+      List.iter (Printf.fprintf oc "%s\n") !pkg;
+      close_out oc
+    ) pkgs
diff --git a/debian/gen_modules.pl b/debian/gen_modules.pl
deleted file mode 100755 (executable)
index 9706ae3..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Description: generating .install files for ocaml binary packages
-#
-# Copyright © 2009 Stéphane Glondu <steph@glondu.net>
-#
-# This program 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, or (at your option)
-# any later version.
-#
-# This program 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-#
-
-#
-# This script takes on its standard input a .install file with
-# additional lines starting with "STD: ", which denote files that are
-# installed in OCaml library directory, and outputs the same file with
-# the special lines replaced. Special care is taken with native files:
-#
-#  - they are not in the output on bytecode-only architectures
-#  - for each .cmx, .{o,p.cmx,p.o} is added if it exists
-#  - for each .cmxa, .{a,p.cmxa,p.a} is added if it exists
-#
-
-my $opt_arch = $ENV{OCAML_OPT_ARCH};
-my $ocaml_stdlib_dir = $ENV{OCAML_STDLIB_DIR};
-my $destdir = $ENV{DESTDIR};
-
-sub print_if_existing {
-    my $name = shift;
-    if (-f "${destdir}/${name}") {
-        print "${name}\n";
-    }
-}
-
-while (<>) {
-    if (s/^STD: //) {
-        my $base;
-        my $ext;
-        s/\n$//;
-        ($base, $ext) = /^(.*)\.([^.]+)$/;
-        $prefix = "${ocaml_stdlib_dir}/${base}";
-        if ($ext eq "cmx") {
-            if ($opt_arch) {
-                print "${prefix}.cmx\n";
-                print_if_existing("${prefix}.o");
-                print_if_existing("${prefix}.p.cmx");
-                print_if_existing("${prefix}.p.o");
-                print_if_existing("${prefix}.p.cmt");
-            }
-        } elsif ($ext eq "cmxa") {
-            if ($opt_arch) {
-                print "${prefix}.cmxa\n";
-                print_if_existing("${prefix}.a");
-                print_if_existing("${prefix}.p.cmxa");
-                print_if_existing("${prefix}.p.a");
-            }
-        } elsif ($ext eq "ml") {
-          print "${prefix}.ml\n";
-          print_if_existing("${prefix}.cmt");
-          print_if_existing("${prefix}.cmti");
-        } else {
-            print "${prefix}.${ext}\n";
-        }
-    } else {
-        print;
-    }
-}
diff --git a/debian/ocaml-base-nox.install.in b/debian/ocaml-base-nox.install.in
deleted file mode 100644 (file)
index 08c886b..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-     usr/bin/ocamlrun
-     usr/share/man/man1/ocamlrun.1
-     toplevel/*.mli @OCamlStdlibDir@
-     @OCamlStdlibDir@/topdirs.mli
-     @OCamlStdlibDir@/VERSION
-     @OCamlDllDir@/dllunix.so
-     @OCamlDllDir@/dllcamlstr.so
-     @OCamlDllDir@/dllbigarray.so
-     @OCamlDllDir@/dllthreads.so
-     @OCamlDllDir@/dllvmthreads.so
-     @OCamlDllDir@/dllnums.so
-     @OCamlStdlibDir@/ld.conf
-     debian/ld.conf @OCamlStdlibDir@
-     @OCamlStdlibDir@/unix.cma
-     @OCamlStdlibDir@/unix.cmxs
-     @OCamlStdlibDir@/str.cma
-     @OCamlStdlibDir@/str.cmxs
-     @OCamlStdlibDir@/bigarray.cma
-     @OCamlStdlibDir@/bigarray.cmxs
-     @OCamlStdlibDir@/nums.cma
-     @OCamlStdlibDir@/nums.cmxs
-     @OCamlStdlibDir@/arg.cmi
-     @OCamlStdlibDir@/array.cmi
-     @OCamlStdlibDir@/arrayLabels.cmi
-     @OCamlStdlibDir@/buffer.cmi
-     @OCamlStdlibDir@/callback.cmi
-     @OCamlStdlibDir@/camlinternalOO.cmi
-     @OCamlStdlibDir@/char.cmi
-     @OCamlStdlibDir@/complex.cmi
-     @OCamlStdlibDir@/digest.cmi
-     @OCamlStdlibDir@/filename.cmi
-     @OCamlStdlibDir@/format.cmi
-     @OCamlStdlibDir@/gc.cmi
-     @OCamlStdlibDir@/genlex.cmi
-     @OCamlStdlibDir@/hashtbl.cmi
-     @OCamlStdlibDir@/int32.cmi
-     @OCamlStdlibDir@/int64.cmi
-     @OCamlStdlibDir@/lazy.cmi
-     @OCamlStdlibDir@/lexing.cmi
-     @OCamlStdlibDir@/list.cmi
-     @OCamlStdlibDir@/listLabels.cmi
-     @OCamlStdlibDir@/map.cmi
-     @OCamlStdlibDir@/marshal.cmi
-     @OCamlStdlibDir@/moreLabels.cmi
-     @OCamlStdlibDir@/nativeint.cmi
-     @OCamlStdlibDir@/obj.cmi
-     @OCamlStdlibDir@/oo.cmi
-     @OCamlStdlibDir@/parsing.cmi
-     @OCamlStdlibDir@/pervasives.cmi
-     @OCamlStdlibDir@/printexc.cmi
-     @OCamlStdlibDir@/printf.cmi
-     @OCamlStdlibDir@/queue.cmi
-     @OCamlStdlibDir@/random.cmi
-OTH: @OCamlStdlibDir@/raw_spacetime_lib.cmi
-OTH: @OCamlStdlibDir@/raw_spacetime_lib.cma
-OTH: @OCamlStdlibDir@/raw_spacetime_lib.cmxs
-     @OCamlStdlibDir@/scanf.cmi
-     @OCamlStdlibDir@/set.cmi
-     @OCamlStdlibDir@/sort.cmi
-     @OCamlStdlibDir@/stack.cmi
-     @OCamlStdlibDir@/stdLabels.cmi
-     @OCamlStdlibDir@/std_exit.cmi
-     @OCamlStdlibDir@/stream.cmi
-     @OCamlStdlibDir@/string.cmi
-     @OCamlStdlibDir@/stringLabels.cmi
-     @OCamlStdlibDir@/sys.cmi
-     @OCamlStdlibDir@/weak.cmi
-     @OCamlStdlibDir@/unix.cmi
-     @OCamlStdlibDir@/unixLabels.cmi
-     @OCamlStdlibDir@/str.cmi
-     @OCamlStdlibDir@/dynlink.cmi
-     @OCamlStdlibDir@/bigarray.cmi
-     @OCamlStdlibDir@/big_int.cmi
-     @OCamlStdlibDir@/nat.cmi
-     @OCamlStdlibDir@/num.cmi
-     @OCamlStdlibDir@/ratio.cmi
-     @OCamlStdlibDir@/arith_status.cmi
diff --git a/debian/ocaml-base.install.in b/debian/ocaml-base.install.in
deleted file mode 100644 (file)
index 6f5077b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-     @OCamlDllDir@/dllgraphics.so
-     @OCamlStdlibDir@/graphics.cma
-     @OCamlStdlibDir@/graphics.cmxs
diff --git a/debian/ocaml-compiler-libs.install.in b/debian/ocaml-compiler-libs.install.in
deleted file mode 100644 (file)
index 1f94da1..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-@OCamlStdlibDir@/compiler-libs
-@OCamlStdlibDir@/topdirs.cmi
-@OCamlStdlibDir@/topdirs.cmt
-@OCamlStdlibDir@/topdirs.cmti
-usr/share/man/man3/Ast_helper.3o
-usr/share/man/man3/Ast_helper.Cf.3o
-usr/share/man/man3/Ast_helper.Ci.3o
-usr/share/man/man3/Ast_helper.Cl.3o
-usr/share/man/man3/Ast_helper.Const.3o
-usr/share/man/man3/Ast_helper.Csig.3o
-usr/share/man/man3/Ast_helper.Cstr.3o
-usr/share/man/man3/Ast_helper.Ctf.3o
-usr/share/man/man3/Ast_helper.Cty.3o
-usr/share/man/man3/Ast_helper.Exp.3o
-usr/share/man/man3/Ast_helper.Incl.3o
-usr/share/man/man3/Ast_helper.Mb.3o
-usr/share/man/man3/Ast_helper.Md.3o
-usr/share/man/man3/Ast_helper.Mod.3o
-usr/share/man/man3/Ast_helper.Mtd.3o
-usr/share/man/man3/Ast_helper.Mty.3o
-usr/share/man/man3/Ast_helper.Opn.3o
-usr/share/man/man3/Ast_helper.Pat.3o
-usr/share/man/man3/Ast_helper.Sig.3o
-usr/share/man/man3/Ast_helper.Str.3o
-usr/share/man/man3/Ast_helper.Te.3o
-usr/share/man/man3/Ast_helper.Typ.3o
-usr/share/man/man3/Ast_helper.Type.3o
-usr/share/man/man3/Ast_helper.Val.3o
-usr/share/man/man3/Ast_helper.Vb.3o
-usr/share/man/man3/Ast_invariants.3o
-usr/share/man/man3/Ast_iterator.3o
-usr/share/man/man3/Ast_mapper.3o
-usr/share/man/man3/Asttypes.3o
-usr/share/man/man3/Attr_helper.3o
-usr/share/man/man3/Builtin_attributes.3o
-usr/share/man/man3/Depend.3o
-usr/share/man/man3/Depend.StringMap.3o
-usr/share/man/man3/Depend.StringSet.3o
-usr/share/man/man3/Lexer.3o
-usr/share/man/man3/Location.3o
-usr/share/man/man3/Longident.3o
-usr/share/man/man3/Parse.3o
-usr/share/man/man3/Parser.3o
-usr/share/man/man3/Parsetree.3o
-usr/share/man/man3/Pprintast.3o
-usr/share/man/man3/Printast.3o
-usr/share/man/man3/Syntaxerr.3o
diff --git a/debian/ocaml-interp.install.in b/debian/ocaml-interp.install.in
deleted file mode 100644 (file)
index 4da0808..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/bin/ocaml
-usr/share/man/man1/ocaml.1
-debian/ocaml.desktop /usr/share/applications
-debian/ocaml.xpm /usr/share/pixmaps
diff --git a/debian/ocaml-nox.install.in b/debian/ocaml-nox.install.in
deleted file mode 100644 (file)
index 0fa994d..0000000
+++ /dev/null
@@ -1,394 +0,0 @@
-     usr/bin/ocamlc
-     usr/bin/ocamlcp
-     usr/bin/ocamldebug
-     usr/bin/ocamldep
-     usr/bin/ocamldoc
-     usr/bin/ocamllex
-     usr/bin/ocamlmklib
-     usr/bin/ocamlmktop
-     usr/bin/ocamlobjinfo
-     usr/bin/ocamlprof
-     usr/bin/ocamlyacc
-     usr/bin/ocamlc.*
-     usr/bin/ocamlcp.*
-     usr/bin/ocamldep.*
-OPT: usr/bin/ocamldoc.opt
-     usr/bin/ocamllex.*
-     usr/bin/ocamlmklib.*
-     usr/bin/ocamlmktop.*
-     usr/bin/ocamlobjinfo.*
-     usr/bin/ocamlprof.*
-OPT: debian/ocamlfind/ocaml-native-compilers.conf usr/share/ocaml-findlib/
-     @OCamlStdlibDir@/objinfo_helper
-     debian/native-archs @OCamlStdlibDir@
-OPT: usr/bin/ocamlopt
-OPT: usr/bin/ocamloptp
-OPT: usr/bin/ocamlopt.*
-OPT: usr/bin/ocamloptp.*
-     @OCamlStdlibDir@/stdlib.cma
-     @OCamlStdlibDir@/dynlink.cma
-DYN: @OCamlStdlibDir@/dynlink.cmx
-DYN: @OCamlStdlibDir@/dynlink.cmxa
-DYN: @OCamlStdlibDir@/dynlink.a
-     @OCamlStdlibDir@/caml
-     @OCamlStdlibDir@/camlheader
-     @OCamlStdlibDir@/camlheader_ur
-     @OCamlStdlibDir@/Makefile.config
-     @OCamlStdlibDir@/expunge
-     @OCamlStdlibDir@/extract_crc
-     @OCamlStdlibDir@/ocamldoc
-     @OCamlStdlibDir@/threads
-     @OCamlStdlibDir@/vmthreads
-     @OCamlStdlibDir@/libbigarray.a
-OPT: @OCamlStdlibDir@/libasmrun.a
-OPT: @OCamlStdlibDir@/libasmrun_pic.a
-OPT: @OCamlStdlibDir@/libasmrun_shared.so
-OPT: PROFILING: @OCamlStdlibDir@/libasmrunp.a
-     @OCamlStdlibDir@/libcamlrun.a
-     @OCamlStdlibDir@/libcamlrun_pic.a
-     @OCamlStdlibDir@/libcamlrun_shared.so
-     @OCamlStdlibDir@/libnums.a
-     @OCamlStdlibDir@/libcamlstr.a
-     @OCamlStdlibDir@/libthreads.a
-OPT: @OCamlStdlibDir@/libthreadsnat.a
-     @OCamlStdlibDir@/libunix.a
-     usr/share/man/man3/Arg.3o
-     usr/share/man/man3/Array.3o
-     usr/share/man/man3/ArrayLabels.3o
-     usr/share/man/man3/Bigarray.3o
-     usr/share/man/man3/Bigarray.Array0.3o
-     usr/share/man/man3/Bigarray.Array1.3o
-     usr/share/man/man3/Bigarray.Array2.3o
-     usr/share/man/man3/Bigarray.Array3.3o
-     usr/share/man/man3/Bigarray.Genarray.3o
-     usr/share/man/man3/Buffer.3o
-     usr/share/man/man3/Bytes.3o
-     usr/share/man/man3/BytesLabels.3o
-     usr/share/man/man3/Callback.3o
-     usr/share/man/man3/CamlinternalFormat.3o
-     usr/share/man/man3/CamlinternalFormatBasics.3o
-     usr/share/man/man3/CamlinternalLazy.3o
-     usr/share/man/man3/CamlinternalMod.3o
-     usr/share/man/man3/CamlinternalOO.3o
-     usr/share/man/man3/Char.3o
-     usr/share/man/man3/Complex.3o
-     usr/share/man/man3/Digest.3o
-     usr/share/man/man3/Docstrings.3o
-     usr/share/man/man3/Ephemeron.3o
-     usr/share/man/man3/Ephemeron.GenHashTable.3o
-     usr/share/man/man3/Ephemeron.GenHashTable.MakeSeeded.3o
-     usr/share/man/man3/Ephemeron.K1.3o
-     usr/share/man/man3/Ephemeron.K1.Make.3o
-     usr/share/man/man3/Ephemeron.K1.MakeSeeded.3o
-     usr/share/man/man3/Ephemeron.K2.3o
-     usr/share/man/man3/Ephemeron.K2.Make.3o
-     usr/share/man/man3/Ephemeron.K2.MakeSeeded.3o
-     usr/share/man/man3/Ephemeron.Kn.3o
-     usr/share/man/man3/Ephemeron.Kn.Make.3o
-     usr/share/man/man3/Ephemeron.Kn.MakeSeeded.3o
-     usr/share/man/man3/Ephemeron.S.3o
-     usr/share/man/man3/Ephemeron.SeededS.3o
-     usr/share/man/man3/Filename.3o
-     usr/share/man/man3/Format.3o
-     usr/share/man/man3/Gc.3o
-     usr/share/man/man3/Genlex.3o
-     usr/share/man/man3/Hashtbl.3o
-     usr/share/man/man3/Hashtbl.HashedType.3o
-     usr/share/man/man3/Hashtbl.Make.3o
-     usr/share/man/man3/Hashtbl.MakeSeeded.3o
-     usr/share/man/man3/Hashtbl.S.3o
-     usr/share/man/man3/Hashtbl.SeededHashedType.3o
-     usr/share/man/man3/Hashtbl.SeededS.3o
-     usr/share/man/man3/Int32.3o
-     usr/share/man/man3/Int64.3o
-     usr/share/man/man3/Lazy.3o
-     usr/share/man/man3/Lexing.3o
-     usr/share/man/man3/List.3o
-     usr/share/man/man3/ListLabels.3o
-     usr/share/man/man3/Map.3o
-     usr/share/man/man3/Map.Make.3o
-     usr/share/man/man3/Map.OrderedType.3o
-     usr/share/man/man3/Map.S.3o
-     usr/share/man/man3/Marshal.3o
-     usr/share/man/man3/MoreLabels.3o
-     usr/share/man/man3/MoreLabels.Hashtbl.3o
-     usr/share/man/man3/MoreLabels.Hashtbl.HashedType.3o
-     usr/share/man/man3/MoreLabels.Hashtbl.Make.3o
-     usr/share/man/man3/MoreLabels.Hashtbl.MakeSeeded.3o
-     usr/share/man/man3/MoreLabels.Hashtbl.S.3o
-     usr/share/man/man3/MoreLabels.Hashtbl.SeededHashedType.3o
-     usr/share/man/man3/MoreLabels.Hashtbl.SeededS.3o
-     usr/share/man/man3/MoreLabels.Map.3o
-     usr/share/man/man3/MoreLabels.Map.Make.3o
-     usr/share/man/man3/MoreLabels.Map.OrderedType.3o
-     usr/share/man/man3/MoreLabels.Map.S.3o
-     usr/share/man/man3/MoreLabels.Set.3o
-     usr/share/man/man3/MoreLabels.Set.Make.3o
-     usr/share/man/man3/MoreLabels.Set.OrderedType.3o
-     usr/share/man/man3/MoreLabels.Set.S.3o
-     usr/share/man/man3/Nativeint.3o
-     usr/share/man/man3/Num.3o
-     usr/share/man/man3/Obj.3o
-     usr/share/man/man3/Obj.Ephemeron.3o
-     usr/share/man/man3/Oo.3o
-     usr/share/man/man3/Parsing.3o
-     usr/share/man/man3/Pervasives.3o
-     usr/share/man/man3/Pervasives.LargeFile.3o
-     usr/share/man/man3/Printexc.3o
-     usr/share/man/man3/Printexc.Slot.3o
-     usr/share/man/man3/Printf.3o
-     usr/share/man/man3/Queue.3o
-     usr/share/man/man3/Random.3o
-     usr/share/man/man3/Random.State.3o
-     usr/share/man/man3/Scanf.3o
-     usr/share/man/man3/Scanf.Scanning.3o
-     usr/share/man/man3/Set.3o
-     usr/share/man/man3/Set.Make.3o
-     usr/share/man/man3/Set.OrderedType.3o
-     usr/share/man/man3/Set.S.3o
-     usr/share/man/man3/Sort.3o
-     usr/share/man/man3/Spacetime.3o
-     usr/share/man/man3/Spacetime.Series.3o
-     usr/share/man/man3/Spacetime.Snapshot.3o
-     usr/share/man/man3/Stack.3o
-     usr/share/man/man3/StdLabels.3o
-     usr/share/man/man3/StdLabels.Array.3o
-     usr/share/man/man3/StdLabels.Bytes.3o
-     usr/share/man/man3/StdLabels.List.3o
-     usr/share/man/man3/StdLabels.String.3o
-     usr/share/man/man3/Str.3o
-     usr/share/man/man3/Stream.3o
-     usr/share/man/man3/String.3o
-     usr/share/man/man3/StringLabels.3o
-     usr/share/man/man3/Sys.3o
-     usr/share/man/man3/Uchar.3o
-     usr/share/man/man3/Unix.3o
-     usr/share/man/man3/Unix.LargeFile.3o
-     usr/share/man/man3/Weak.3o
-     usr/share/man/man3/Weak.Make.3o
-     usr/share/man/man3/Weak.S.3o
-OPT: usr/share/man/man1/ocamlopt.1
-OPT: usr/share/man/man1/ocamloptp.1
-     usr/share/man/man1/ocamlprof.1
-     usr/share/man/man1/ocamlc.1
-     usr/share/man/man1/ocamldep.1
-     usr/share/man/man1/ocamlcp.1
-     usr/share/man/man1/ocamlmktop.1
-     usr/share/man/man1/ocamldoc.1
-     usr/share/man/man1/ocamlyacc.1
-     usr/share/man/man1/ocamldebug.1
-     usr/share/man/man1/ocamllex.1
-STD: arg.ml
-STD: arg.mli
-STD: arg.cmx
-STD: arith_flags.cmx
-STD: arith_status.cmti
-STD: arith_status.cmx
-STD: arith_status.mli
-STD: arrayLabels.ml
-STD: arrayLabels.mli
-STD: arrayLabels.cmx
-STD: array.ml
-STD: array.mli
-STD: array.cmx
-STD: big_int.cmti
-STD: big_int.cmx
-STD: big_int.mli
-STD: bigarray.cmti
-STD: bigarray.cmx
-STD: bigarray.cmxa
-STD: bigarray.mli
-STD: buffer.ml
-STD: buffer.mli
-STD: buffer.cmx
-STD: bytes.cmi
-STD: bytes.cmx
-STD: bytes.ml
-STD: bytes.mli
-STD: bytesLabels.cmi
-STD: bytesLabels.cmx
-STD: bytesLabels.ml
-STD: bytesLabels.mli
-STD: callback.ml
-STD: callback.mli
-STD: callback.cmx
-STD: camlinternalFormat.cmi
-STD: camlinternalFormat.cmx
-STD: camlinternalFormat.ml
-STD: camlinternalFormat.mli
-STD: camlinternalFormatBasics.cmi
-STD: camlinternalFormatBasics.cmx
-STD: camlinternalFormatBasics.ml
-STD: camlinternalFormatBasics.mli
-STD: camlinternalLazy.cmi
-STD: camlinternalLazy.cmx
-STD: camlinternalLazy.ml
-STD: camlinternalLazy.mli
-STD: camlinternalMod.cmi
-STD: camlinternalMod.cmx
-STD: camlinternalMod.ml
-STD: camlinternalMod.mli
-STD: camlinternalOO.ml
-STD: camlinternalOO.mli
-STD: camlinternalOO.cmx
-STD: char.ml
-STD: char.mli
-STD: char.cmx
-STD: complex.ml
-STD: complex.mli
-STD: complex.cmx
-STD: condition.mli
-STD: digest.ml
-STD: digest.mli
-STD: digest.cmx
-STD: dynlink.cmti
-STD: dynlink.mli
-STD: event.mli
-STD: ephemeron.ml
-STD: ephemeron.mli
-STD: ephemeron.cmi
-STD: ephemeron.cmx
-STD: filename.ml
-STD: filename.mli
-STD: filename.cmx
-STD: format.ml
-STD: format.mli
-STD: format.cmx
-STD: gc.ml
-STD: gc.mli
-STD: gc.cmx
-STD: genlex.ml
-STD: genlex.mli
-STD: genlex.cmx
-STD: hashtbl.ml
-STD: hashtbl.mli
-STD: hashtbl.cmx
-STD: int32.ml
-STD: int32.mli
-STD: int32.cmx
-STD: int64.ml
-STD: int64.mli
-STD: int64.cmx
-STD: int_misc.cmx
-STD: lazy.ml
-STD: lazy.mli
-STD: lazy.cmx
-STD: lexing.ml
-STD: lexing.mli
-STD: lexing.cmx
-STD: listLabels.ml
-STD: listLabels.mli
-STD: listLabels.cmx
-STD: list.ml
-STD: list.mli
-STD: list.cmx
-STD: map.ml
-STD: map.mli
-STD: map.cmx
-STD: marshal.ml
-STD: marshal.mli
-STD: marshal.cmx
-STD: moreLabels.ml
-STD: moreLabels.mli
-STD: moreLabels.cmx
-STD: mutex.mli
-STD: nat.cmti
-STD: nat.cmx
-STD: nat.mli
-STD: nativeint.ml
-STD: nativeint.mli
-STD: nativeint.cmx
-STD: num.cmti
-STD: num.cmx
-STD: num.mli
-STD: nums.cmxa
-STD: obj.ml
-STD: obj.mli
-STD: obj.cmx
-STD: oo.ml
-STD: oo.mli
-STD: oo.cmx
-STD: parsing.ml
-STD: parsing.mli
-STD: parsing.cmx
-STD: pervasives.ml
-STD: pervasives.mli
-STD: pervasives.cmx
-STD: printexc.ml
-STD: printexc.mli
-STD: printexc.cmx
-STD: printf.ml
-STD: printf.mli
-STD: printf.cmx
-STD: profiling.cmi
-STD: profiling.cmo
-STD: profiling.cmt
-STD: profiling.cmti
-STD: profiling.cmx
-STD: queue.ml
-STD: queue.mli
-STD: queue.cmx
-STD: random.ml
-STD: random.mli
-STD: random.cmx
-STD: ratio.cmti
-STD: ratio.cmx
-STD: ratio.mli
-OTH: STD: raw_spacetime_lib.cmx
-OTH: STD: raw_spacetime_lib.cmxa
-OTH: STD: raw_spacetime_lib.mli
-STD: scanf.ml
-STD: scanf.mli
-STD: scanf.cmx
-STD: set.ml
-STD: set.mli
-STD: set.cmx
-STD: sort.ml
-STD: sort.mli
-STD: sort.cmx
-STD: spacetime.ml
-STD: spacetime.mli
-STD: spacetime.cmi
-STD: spacetime.cmx
-STD: stack.ml
-STD: stack.mli
-STD: stack.cmx
-STD: stdlib.cmxa
-STD: std_exit.cmo
-STD: std_exit.cmx
-STD: std_exit.ml
-STD: stdLabels.cmx
-STD: stdLabels.ml
-STD: stdLabels.mli
-STD: str.cmti
-STD: str.cmx
-STD: str.cmxa
-STD: str.mli
-STD: stream.ml
-STD: stream.mli
-STD: stream.cmx
-STD: string.ml
-STD: string.mli
-STD: string.cmx
-STD: stringLabels.ml
-STD: stringLabels.mli
-STD: stringLabels.cmx
-STD: sys.ml
-STD: sys.mli
-STD: sys.cmx
-STD: thread.mli
-STD: threadUnix.mli
-STD: uchar.ml
-STD: uchar.mli
-STD: uchar.cmi
-STD: uchar.cmx
-STD: unix.cmti
-STD: unix.cmx
-STD: unix.cmxa
-STD: unix.mli
-STD: unixLabels.cmti
-STD: unixLabels.cmx
-STD: unixLabels.mli
-STD: weak.ml
-STD: weak.mli
-STD: weak.cmx
diff --git a/debian/ocaml.install.in b/debian/ocaml.install.in
deleted file mode 100644 (file)
index bc5b2b5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-     @OCamlStdlibDir@/libgraphics.a
-STD: graphics.cmi
-STD: graphics.cmti
-STD: graphics.cmx
-STD: graphics.cmxa
-STD: graphics.mli
-STD: graphicsX11.cmi
-STD: graphicsX11.cmti
-STD: graphicsX11.cmx
-STD: graphicsX11.mli
index a7c3d654198c47855959d12b9e44633173c0a227..b80f1005b6d394003b1fb967361c113f63bb8086 100755 (executable)
@@ -46,7 +46,7 @@ export OCAMLOBJINFO = OCAMLLIB=tools boot/ocamlrun tools/ocamlobjinfo
 
 export DH_OPTIONS
 
-# This has to be exported to make gen_modules work
+# This has to be exported to make dispatch work
 export OCAML_OPT_ARCH
 export OCAML_STDLIB_DIR
 
@@ -80,7 +80,6 @@ debian/control:
        sed -e 's/@OCamlNativeArchs@/$(OCAML_NATIVE_ARCHS)/g' debian/control.in > $@
 
 pre-config-stamp: $(TARBALL_TARGET)
-       chmod +x debian/gen_modules.pl
 # Backup upstream config.{sub,guess}, and use most up-to-date ones
        set -e; for ext in sub guess; do \
          if [ -f /usr/share/misc/config.$$ext ] && \
@@ -183,6 +182,8 @@ install-stamp-arch:
 # Install OCaml
        $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
 ifeq (,$(DEB_TEST_BUILD_PREFIX))
+# Remove Debian-specific file
+       rm -f $(INSTDIR)/lib/ocaml/ld.conf
 # Remove uninstalled files
        rm -f \
          $(INSTDIR)/share/man/man1/ocamlopt.opt.1 \
@@ -196,16 +197,9 @@ ifeq ($(OCAML_HAVE_OCAMLOPT),no)
          $(INSTDIR)/bin/ocamloptp
 endif
 # Dispatch files with dh_install
-       cd debian && \
-       set -e; for u in ocaml ocaml-nox; do \
-         DESTDIR=tmp ./gen_modules.pl $$u.install > $$u.install.new; \
-         mv $$u.install.new $$u.install; \
-       done
-       if ! dh_install --fail-missing; then \
-         echo "===> dh_install has failed <==="; \
-         find debian/tmp; \
-         exit 1; \
-       fi
+       find debian/tmp \( -type f -or -type l \) -printf '%P\n' > debian/installed-files
+       boot/ocamlrun ./ocaml -nostdlib -I debian/tmp/usr/lib/ocaml debian/dispatch.ml
+       dh_install
 # Install additional files not handled by dh_install
 # Beware: dh_install does not handle renamings, please pay attention
        set -e; for u in dumpobj; do \
@@ -277,3 +271,7 @@ endif
 .PHONY: override_dh_installdocs
 override_dh_installdocs:
        dh_installdocs --ignore debian/README.Debian
+
+.PHONY: override_dh_missing
+override_dh_missing:
+       dh_missing --fail-missing