The following commit has been merged in the master branch:
commit 770bafbfd9700fdd0907237f4634322a29255f54
Author: Stefano Zacchiroli <[EMAIL PROTECTED]>
Date:   Thu Apr 10 15:25:09 2008 +0200

    support for installing to a non-standard directory
    
    Setting externally the DESTDIR make varilable (as in
    "make install DESTDIR=/shome/where") now gives the ability to install
    somewhere else wrt the standard installation directory.

diff --git a/Makefile b/Makefile
index 7b30173..1052577 100644
--- a/Makefile
+++ b/Makefile
@@ -30,9 +30,10 @@ clean:
          $(DO) -C $$x clean ; \
        done
 
+DESTDIR =
 install:
        @for x in $(DIRS) ; do \
-         $(DO) -C $$x install ; \
+         $(DO) -C $$x install DESTDIR=$(DESTDIR) ; \
        done
 
 define EXEC_TEMPLATE
diff --git a/make/Makefile.common b/make/Makefile.common
index 026db69..7f367c4 100644
--- a/make/Makefile.common
+++ b/make/Makefile.common
@@ -19,10 +19,17 @@ OCAMLLEX   = ocamllex
 OCAMLMKLIB = ocamlmklib
 MENHIR     = menhir
 
+ifneq ($(DESTDIR),)
+DESTFLAG = -destdir $(DESTDIR)
+else
+DESTFLAG =
+endif
+
 .PHONY: install
 install: all
        { test ! -f $(XARCHIVE) || extra1="*.cmxa *.a"; }; \
-       $(OCAMLFIND) install $(NAME) *.mli *.cmi *.cma META $$extra1 $(extra2)
+       { test -z "$(DESTDIR)" || mkdir -p "$(DESTDIR)"; }; \
+       $(OCAMLFIND) install $(DESTFLAG) $(NAME) *.mli *.cmi *.cma META 
$$extra1 $(extra2)
 
 .PHONY: uninstall
 uninstall:

-- 
dose2 packaging

_______________________________________________
Pkg-ocaml-maint-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-ocaml-maint-commits

Reply via email to