Adapt maintainer scripts to new binary package structure
authorStephane Glondu <steph@glondu.net>
Tue, 28 Dec 2021 10:03:44 +0000 (11:03 +0100)
committerStéphane Glondu <glondu@debian.org>
Tue, 28 Dec 2021 10:03:44 +0000 (11:03 +0100)
debian/ocaml-base-nox.postinst.in [deleted file]
debian/ocaml-base-nox.prerm.in [deleted file]
debian/ocaml-base.postinst.in [new file with mode: 0644]
debian/ocaml-base.prerm.in [new file with mode: 0644]
debian/ocaml-nox.postinst.in [deleted file]
debian/ocaml-nox.postrm [deleted file]
debian/ocaml-nox.preinst [deleted file]
debian/ocaml.postinst.in [new file with mode: 0644]
debian/ocaml.postrm [new file with mode: 0644]
debian/ocaml.preinst [new file with mode: 0644]

diff --git a/debian/ocaml-base-nox.postinst.in b/debian/ocaml-base-nox.postinst.in
deleted file mode 100644 (file)
index 8cab429..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-set -e
-
-if [ ! -e /usr/local/lib/ocaml ]; then
-    if mkdir /usr/local/lib/ocaml 2>/dev/null; then
-       chown root:staff /usr/local/lib/ocaml
-       chmod 2775 /usr/local/lib/ocaml
-    fi
-fi
-if [ ! -e /usr/local/lib/ocaml/@OCamlABI@ ]; then
-    if mkdir /usr/local/lib/ocaml/@OCamlABI@ 2>/dev/null; then
-       chown root:staff /usr/local/lib/ocaml/@OCamlABI@
-       chmod 2775 /usr/local/lib/ocaml/@OCamlABI@
-    fi
-fi
-if [ ! -e /usr/local/lib/ocaml/@OCamlABI@/stublibs ]; then
-    if mkdir /usr/local/lib/ocaml/@OCamlABI@/stublibs 2>/dev/null; then
-       chown root:staff /usr/local/lib/ocaml/@OCamlABI@/stublibs
-       chmod 2775 /usr/local/lib/ocaml/@OCamlABI@/stublibs
-    fi
-fi
-
-for i in /usr/lib/ocaml/3.06 /etc/ocaml /var/lib/ocaml;                \
-do                                                                     \
-       if [ -e $i/ld.conf ]; then                                      \
-               echo "Removing leftover $i/ld.conf";                    \
-               rm -f $i/ld.conf;                                       \
-               rmdir --ignore-fail-on-non-empty $i;                    \
-       fi;                                                             \
-done
-
-#DEBHELPER#
diff --git a/debian/ocaml-base-nox.prerm.in b/debian/ocaml-base-nox.prerm.in
deleted file mode 100644 (file)
index 15a3aa7..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-set -e
-
-rmdir /usr/local/lib/ocaml/@OCamlABI@/stublibs 2>/dev/null || true
-rmdir /usr/local/lib/ocaml/@OCamlABI@ 2>/dev/null || true
-rmdir /usr/local/lib/ocaml 2>/dev/null || true
-
-#DEBHELPER#
diff --git a/debian/ocaml-base.postinst.in b/debian/ocaml-base.postinst.in
new file mode 100644 (file)
index 0000000..98ce5bb
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -e
+
+if [ ! -e /usr/local/lib/ocaml ]; then
+    if mkdir /usr/local/lib/ocaml 2>/dev/null; then
+       chown root:staff /usr/local/lib/ocaml
+       chmod 2775 /usr/local/lib/ocaml
+    fi
+fi
+if [ ! -e /usr/local/lib/ocaml/@OCamlABI@ ]; then
+    if mkdir /usr/local/lib/ocaml/@OCamlABI@ 2>/dev/null; then
+       chown root:staff /usr/local/lib/ocaml/@OCamlABI@
+       chmod 2775 /usr/local/lib/ocaml/@OCamlABI@
+    fi
+fi
+if [ ! -e /usr/local/lib/ocaml/@OCamlABI@/stublibs ]; then
+    if mkdir /usr/local/lib/ocaml/@OCamlABI@/stublibs 2>/dev/null; then
+       chown root:staff /usr/local/lib/ocaml/@OCamlABI@/stublibs
+       chmod 2775 /usr/local/lib/ocaml/@OCamlABI@/stublibs
+    fi
+fi
+
+#DEBHELPER#
diff --git a/debian/ocaml-base.prerm.in b/debian/ocaml-base.prerm.in
new file mode 100644 (file)
index 0000000..15a3aa7
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -e
+
+rmdir /usr/local/lib/ocaml/@OCamlABI@/stublibs 2>/dev/null || true
+rmdir /usr/local/lib/ocaml/@OCamlABI@ 2>/dev/null || true
+rmdir /usr/local/lib/ocaml 2>/dev/null || true
+
+#DEBHELPER#
diff --git a/debian/ocaml-nox.postinst.in b/debian/ocaml-nox.postinst.in
deleted file mode 100644 (file)
index 8e32f2f..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-set -e
-
-if [ "$1" = "configure" ]; then
-  ln -sf @OCamlStdlibDir@/caml /usr/include/
-
-  # Save Emacs conffiles from previous ocaml versions
-  for f in ocaml ocaml-nox ; do
-    file="/etc/emacs/site-start.d/50$f.el"
-    if [ -e "$file" ]; then
-      mv "$file" "$file.save"
-    fi
-  done
-fi
-
-#DEBHELPER#
diff --git a/debian/ocaml-nox.postrm b/debian/ocaml-nox.postrm
deleted file mode 100644 (file)
index 3dc4359..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-set -e
-
-rm -f /usr/include/caml
-
-#DEBHELPER#
diff --git a/debian/ocaml-nox.preinst b/debian/ocaml-nox.preinst
deleted file mode 100644 (file)
index c7e4af2..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-set -e
-
-if [ ! -h /usr/include/caml ] && [ -e /usr/include/caml ]; then
-       echo "WARNING, /usr/include/caml is not a symlink !!!!"
-fi
-
-#DEBHELPER#
diff --git a/debian/ocaml.postinst.in b/debian/ocaml.postinst.in
new file mode 100644 (file)
index 0000000..156f5d6
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -e
+
+if [ "$1" = "configure" ]; then
+  ln -sf @OCamlStdlibDir@/caml /usr/include/
+fi
+
+#DEBHELPER#
diff --git a/debian/ocaml.postrm b/debian/ocaml.postrm
new file mode 100644 (file)
index 0000000..3dc4359
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -e
+
+rm -f /usr/include/caml
+
+#DEBHELPER#
diff --git a/debian/ocaml.preinst b/debian/ocaml.preinst
new file mode 100644 (file)
index 0000000..c7e4af2
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -e
+
+if [ ! -h /usr/include/caml ] && [ -e /usr/include/caml ]; then
+       echo "WARNING, /usr/include/caml is not a symlink !!!!"
+fi
+
+#DEBHELPER#