Install ocamlbuild as a link on either .native or .byte
authorStefano Zacchiroli <zack@debian.org>
Tue, 19 May 2009 15:28:56 +0000 (17:28 +0200)
committerStéphane Glondu <glondu@debian.org>
Thu, 30 Oct 2014 08:28:06 +0000 (08:28 +0000)
Gbp-Pq: Name 0006-Install-ocamlbuild-as-a-link-on-either-.native-or-.b.patch

build/partial-install.sh

index 42c3558b35ad8790d4da76ef0a206af2acf991a2..96d21def901a262999fbe3c58c893bd28cba4643 100755 (executable)
@@ -58,6 +58,21 @@ installbestbin() {
   [ -x "$3" ] || chmod +x "$3"
 }
 
+installbestlink() {
+  if [ -f "$1" ]; then
+    echo "  linking binary $3 to `basename $1`"
+    ln -fs "$1" "$3"
+  else
+    if [ -f "$2" ]; then
+      echo "  linking binary $3 to `basename $2`"
+      ln -fs "$2" "$3"
+    else
+      echo "None of $1, $2 exists"
+      exit 3
+    fi
+  fi
+}
+
 installlib() {
   if [ -f "$1" ]; then
     dest="$2/`basename $1`"
@@ -156,7 +171,7 @@ echo "Installing ocamlbuild..."
 cd ocamlbuild
 installbin ocamlbuild.byte$EXE $BINDIR/ocamlbuild.byte$EXE
 installbin ocamlbuild.native$EXE $BINDIR/ocamlbuild.native$EXE
-installbestbin ocamlbuild.native$EXE ocamlbuild.byte$EXE $BINDIR/ocamlbuild$EXE
+installbestlink ocamlbuild.native$EXE ocamlbuild.byte$EXE $BINDIR/ocamlbuild$EXE
 
 installlibdir \
   ocamlbuildlib.$A \