libnbd/0011-ocaml-Add-make-install-rule.patch
Richard W.M. Jones f001a4af3f Add all upstream patches since 0.9.6 was released.
Package the ocaml bindings into a subpackage.
2019-08-03 15:35:41 +01:00

43 lines
1.2 KiB
Diff

From aa54c46d5fdd9a68ae2237713d5086ecb91235f9 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sat, 3 Aug 2019 15:20:50 +0100
Subject: [PATCH 11/11] ocaml: Add make install rule.
This installs the OCaml bindings into $(DESTDIR). If you don't want
this then use ./configure --disable-ocaml.
---
ocaml/Makefile.am | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index bae9e58..c69b5bd 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
@@ -103,4 +103,23 @@ endif
$(OCAMLFIND) ocamldep $^ > $@
-include .depend
+# Run ocamlfind to perform the install. ocamlfind refuses to install
+# the package if it is already installed, so remove the old package
+# first.
+data_hook_files = META *.so *.a *.cma *.cmi $(srcdir)/*.mli
+if HAVE_OCAMLOPT
+data_hook_files += *.cmx *.cmxa
+endif
+
+install-data-hook:
+ mkdir -p $(DESTDIR)$(OCAMLLIB)
+ mkdir -p $(DESTDIR)$(OCAMLLIB)/stublibs
+ rm -rf $(DESTDIR)$(OCAMLLIB)/nbd
+ rm -rf $(DESTDIR)$(OCAMLLIB)/stublibs/dllmlnbd.so*
+ $(OCAMLFIND) install \
+ -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
+ nbd \
+ $(data_hook_files)
+ rm $(DESTDIR)$(OCAMLLIB)/nbd/libnbdocaml.a
+
endif HAVE_OCAML
--
2.22.0