Reorganize binary packages
authorStéphane Glondu <glondu@debian.org>
Sat, 19 Aug 2023 01:16:21 +0000 (03:16 +0200)
committerStéphane Glondu <glondu@debian.org>
Sat, 19 Aug 2023 04:00:23 +0000 (06:00 +0200)
debian/control
debian/dispatch.ml
debian/libcompiler-libs-ocaml-dev.lintian-overrides.in [new file with mode: 0644]
debian/ocaml.lintian-overrides.in
debian/ocamlinit.mk
debian/rules

index 54f0e6bba7946238e8f3af6cd71889492a2dde39..c6d03b1f5672ff73cdcd67e1981bf5ff7b39ff5b 100644 (file)
@@ -14,7 +14,7 @@ Build-Depends:
  libiberty-dev,
  libncurses-dev,
  zlib1g-dev,
- dh-ocaml (>= 1.3)
+ dh-ocaml
 Standards-Version: 4.6.2
 Rules-Requires-Root: no
 Vcs-Git: https://salsa.debian.org/ocaml-team/ocaml.git
@@ -26,14 +26,12 @@ Homepage: https://ocaml.org/
 Package: ocaml-base
 Architecture: any
 Depends:
+ libstdlib-ocaml (= ${binary:Version}),
  ${shlibs:Depends},
  ${misc:Depends},
  ${ocaml:Depends}
 Provides:
- libseq-ocaml,
- libuchar-ocaml,
- libstdlib-shims-ocaml,
- ${ocaml:Provides}
+ ocaml-base-${F:OCamlABI}
 Breaks: ocaml-base-nox (<< 4.13)
 Replaces: ocaml-base-nox (<< 4.13)
 Description: Runtime system for OCaml bytecode executables
@@ -56,10 +54,7 @@ Depends:
  ${misc:Depends},
  ${ocaml:Depends}
 Provides:
- libseq-ocaml-dev,
- libuchar-ocaml-dev,
- libstdlib-shims-ocaml-dev,
- ${ocaml:Provides},
+ ocaml-${F:OCamlABI},
  ocaml-best-compilers (= ${binary:Version}),
  ${F:NativeProvides}
 Suggests:
@@ -92,6 +87,65 @@ Description: ML language implementation with a class-based object system
  .
  This package contains everything needed to develop OCaml applications.
 
+Package: libstdlib-ocaml-dev
+Architecture: any
+Depends:
+ ${shlibs:Depends},
+ ${misc:Depends},
+ ${ocaml:Depends}
+Provides:
+ libseq-ocaml-dev,
+ libuchar-ocaml-dev,
+ libstdlib-shims-ocaml-dev,
+ ${ocaml:Provides}
+Recommends:
+ ocaml-man
+Breaks: ocaml (<< 4.13.1-5~), ocaml-base (<< 4.13.1-5~), ocaml-compiler-libs (<< 4.13.1-5~)
+Replaces: ocaml (<< 4.13.1-5~), ocaml-base (<< 4.13.1-5~), ocaml-compiler-libs (<< 4.13.1-5~)
+Description: OCaml standard library (development files)
+ 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 the development files of the standard library.
+
+Package: libstdlib-ocaml
+Architecture: any
+Depends:
+ ${shlibs:Depends},
+ ${misc:Depends},
+ ${ocaml:Depends}
+Provides:
+ libseq-ocaml,
+ libuchar-ocaml,
+ libstdlib-shims-ocaml,
+ ${ocaml:Provides}
+Breaks: ocaml (<< 4.13.1-5~), ocaml-base (<< 4.13.1-5~), ocaml-compiler-libs (<< 4.13.1-5~)
+Replaces: ocaml (<< 4.13.1-5~), ocaml-base (<< 4.13.1-5~), ocaml-compiler-libs (<< 4.13.1-5~)
+Description: OCaml standard library (runtime files)
+ 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 the runtime files of the standard library.
+
+Package: libcompiler-libs-ocaml-dev
+Architecture: any
+Depends:
+ ${shlibs:Depends},
+ ${misc:Depends},
+ ${ocaml:Depends}
+Provides:
+ ${ocaml:Provides}
+Breaks: ocaml (<< 4.13.1-5~), ocaml-base (<< 4.13.1-5~), ocaml-compiler-libs (<< 4.13.1-5~)
+Replaces: ocaml (<< 4.13.1-5~), ocaml-base (<< 4.13.1-5~), ocaml-compiler-libs (<< 4.13.1-5~)
+Description: OCaml compiler library (development files)
+ 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 the development files of the compiler library.
+
 Package: ocaml-source
 Architecture: all
 Depends: ${misc:Depends}
@@ -108,7 +162,8 @@ Description: Sources for Objective Caml
 Package: ocaml-interp
 Architecture: any
 Depends:
- ocaml-compiler-libs (= ${binary:Version}),
+ ocaml-base (= ${binary:Version}),
+ libcompiler-libs-ocaml-dev (= ${binary:Version}),
  ${ocaml:Depends},
  ${misc:Depends}
 Provides:
@@ -122,27 +177,6 @@ Description: OCaml interactive interpreter and standard libraries
  This package contains the files required to run an OCaml shell from the
  command line.
 
-Package: ocaml-compiler-libs
-Architecture: any
-Depends:
- ${shlibs:Depends},
- ${misc:Depends},
- ${ocaml:Depends}
-Provides:
- ${ocaml:Provides}
-Recommends:
- ocaml-man
-Replaces: ocaml-base-nox (<< 4)
-Breaks: ocaml-base-nox (<< 4)
-Description: OCaml interpreter and standard libraries
- 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 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:
@@ -192,3 +226,18 @@ Description: transitional package for ocaml
  and a powerful module system in the style of Standard ML.
  .
  This is a transitional package and can be safely removed.
+
+Package: ocaml-compiler-libs
+Section: oldlibs
+Architecture: all
+Depends:
+ libcompiler-libs-ocaml-dev,
+ ${misc:Depends}
+Replaces: ocaml-base-nox (<< 4)
+Breaks: ocaml-base-nox (<< 4)
+Description: transitional package for libcompiler-libs-ocaml-dev
+ 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 is a transitional package and can be safely removed.
index 3bb432a8c9fb6752f506d3df581658187ae4478f..c9a31e1bb4a98de3f7477addcca6e9990db09778 100644 (file)
@@ -47,12 +47,15 @@ let get_base str =
 module SMap = Map.Make (String)
 module SSet = Set.Make (String)
 
+let dev_stdlib = ref []
+let run_stdlib = ref []
+let dev_compiler_libs = ref []
+
 let ocaml_base = ref [ "debian/ld.conf usr/lib/ocaml" ]
 let ocaml =
   ref [
       "debian/native-archs usr/lib/ocaml";
     ]
-let ocaml_compiler_libs = ref []
 let ocaml_interp =
   ref [
       "debian/ocaml.desktop usr/share/applications";
@@ -61,9 +64,11 @@ let ocaml_interp =
 let ocaml_man = ref []
 
 let pkgs = [
+    run_stdlib, "libstdlib-ocaml";
+    dev_stdlib, "libstdlib-ocaml-dev";
+    dev_compiler_libs, "libcompiler-libs-ocaml-dev";
     ocaml_base, "ocaml-base";
     ocaml, "ocaml";
-    ocaml_compiler_libs, "ocaml-compiler-libs";
     ocaml_interp, "ocaml-interp";
     ocaml_man, "ocaml-man";
   ]
@@ -202,22 +207,22 @@ let process_file x =
   match find_base base with
   | true ->
      if List.exists (fun y -> endswith y x) exts_dev then (
-       push ocaml x
+       push dev_stdlib x
      ) else if List.exists (fun y -> endswith y x) exts_run then (
-       push ocaml_base x
+       push run_stdlib x
      ) else Some x
   | false -> Some x
 
 let remaining =
   installed_files
   |> move_all_to ocaml (startswith "usr/lib/ocaml/caml/")
-  |> move_all_to ocaml (startswith "usr/lib/ocaml/ocamldoc/")
-  |> move_all_to ocaml (startswith "usr/lib/ocaml/vmthreads/")
-  |> move_all_to ocaml (startswith "usr/lib/ocaml/threads/")
-  |> move_all_to ocaml (startswith "usr/lib/ocaml/std_exit.")
-  |> move_all_to ocaml (startswith "usr/lib/ocaml/stdlib.")
-  |> move_all_to ocaml (startswith "usr/lib/ocaml/dynlink")
-  |> move_all_to ocaml_compiler_libs (startswith "usr/lib/ocaml/compiler-libs/")
+  |> move_all_to dev_stdlib (startswith "usr/lib/ocaml/threads/")
+  |> move_all_to dev_stdlib (startswith "usr/lib/ocaml/std_exit.")
+  |> move_all_to dev_stdlib (startswith "usr/lib/ocaml/stdlib.")
+  |> move_all_to dev_stdlib (startswith "usr/lib/ocaml/dynlink")
+  |> move_all_to dev_compiler_libs (startswith "usr/lib/ocaml/topdirs.")
+  |> move_all_to dev_compiler_libs (startswith "usr/lib/ocaml/compiler-libs/")
+  |> move_all_to dev_compiler_libs (startswith "usr/lib/ocaml/ocamldoc/")
   |> move_all_to ocaml_man (endswith ".3o")
   |> rev_filter_map process_static
   |> rev_filter_map process_file
diff --git a/debian/libcompiler-libs-ocaml-dev.lintian-overrides.in b/debian/libcompiler-libs-ocaml-dev.lintian-overrides.in
new file mode 100644 (file)
index 0000000..f5b56cc
--- /dev/null
@@ -0,0 +1 @@
+libcompiler-libs-ocaml-dev: ocaml-dangling-cmx [.@OCamlStdlibDir@/ocamldoc/odoc*.cmx]
index 83eaced481a0254b26fc7af9662e35ffb9582838..b55e241977d3955a8f0ce98f4f739a6fca3ac7fa 100644 (file)
@@ -5,4 +5,3 @@ ocaml: unusual-interpreter /usr/bin/ocamlrund [.@OCamlStdlibDir@/camlheaderd]
 ocaml: unusual-interpreter /usr/bin/ocamlruni [.@OCamlStdlibDir@/camlheaderi]
 ocaml: no-manual-page [usr/bin/ocaml*.byte]
 ocaml: no-manual-page [usr/bin/ocaml*.opt]
-ocaml: ocaml-dangling-cmx [.@OCamlStdlibDir@/ocamldoc/odoc*.cmx]
index 22b7d69b2e0958dc204314d809af289a463c5322..022cd7292530086fda797921533db0f3739bc54e 100644 (file)
@@ -75,7 +75,7 @@ ocamlinit-stamp: Makefile.config
        for t in $(OCAML_IN_FILES); do \
          sed $(OCAMLINIT_SED) $$t.in > $$t; \
        done
-       sed -i 's@\./@@' debian/ocaml.lintian-overrides
+       sed -i 's@\./@@' debian/*.lintian-overrides
        touch $@
 
 ocamlinit-clean:
index 2ace08df68a5c0f459841fde9e4fddeb2701c500..f3974c746806e8d845a89d90a824966ff1784bcf 100755 (executable)
@@ -197,14 +197,14 @@ install-stamp-arch: install-stamp
          fi \
        done
 # Install the seq compatibility package (OCaml >= 4.07)
-       mkdir -p debian/ocaml-base$(OCAML_STDLIB_DIR)/seq
-       cp debian/META.seq debian/ocaml-base$(OCAML_STDLIB_DIR)/seq/META
+       mkdir -p debian/libstdlib-ocaml-dev$(OCAML_STDLIB_DIR)/seq
+       cp debian/META.seq debian/libstdlib-ocaml-dev$(OCAML_STDLIB_DIR)/seq/META
 # Install the uchar compatibility package (OCaml >= 4.03)
-       mkdir -p debian/ocaml-base$(OCAML_STDLIB_DIR)/uchar
-       cp debian/META.uchar debian/ocaml-base$(OCAML_STDLIB_DIR)/uchar/META
+       mkdir -p debian/libstdlib-ocaml-dev$(OCAML_STDLIB_DIR)/uchar
+       cp debian/META.uchar debian/libstdlib-ocaml-dev$(OCAML_STDLIB_DIR)/uchar/META
 # Install the stdlib-shims compatibility package (OCaml >= 4.07)
-       mkdir -p debian/ocaml-base$(OCAML_STDLIB_DIR)/stdlib-shims
-       cp debian/META.stdlib-shims debian/ocaml-base$(OCAML_STDLIB_DIR)/stdlib-shims/META
+       mkdir -p debian/libstdlib-ocaml-dev$(OCAML_STDLIB_DIR)/stdlib-shims
+       cp debian/META.stdlib-shims debian/libstdlib-ocaml-dev$(OCAML_STDLIB_DIR)/stdlib-shims/META
 # Remaining stuff
        touch $@
 
@@ -235,7 +235,7 @@ endif
 
 .PHONY: override_dh_gencontrol
 override_dh_gencontrol:
-       set -e; for u in ocaml-source ocaml-interp ocaml-compiler-libs; do \
+       set -e; for u in ocaml-source ocaml-interp ocaml-base ocaml; do \
          echo 'F:OCamlABI=$(OCAML_ABI)' >> debian/$$u.substvars; \
        done
 ifeq (,$(OCAML_OPT_ARCH))
@@ -243,12 +243,8 @@ ifeq (,$(OCAML_OPT_ARCH))
 else
        echo 'F:NativeProvides=ocaml-native-compilers (= $${binary:Version})' >> debian/ocaml.substvars
 endif
-# Create .md5sums files and compute dependencies. Use $(OCAML_ABI)
-# because we know that OCaml ABI represents best dependencies for
-# OCaml package.
-       dh_ocaml \
-        --nodefined-map ocaml:Topdirs \
-        --runtime-map ocaml:ocaml-base:$(OCAML_ABI),ocaml-compiler-libs
+# Create .md5sums files and compute dependencies.
+       dh_ocaml
        dh_gencontrol
 # Check that OCAML_ABI is correct
        if [ "$(OCAML_ABI)" != "$(shell boot/ocamlrun ./ocamlc -version | { read a && echo $${a%%_*}; })" ]; then \