[Pkg-libvirt-commits] [SCM] Libguestfs Debian packaging branch, experimental, updated. debian/1%1.21.40-1
Richard W.M. Jones
rjones at redhat.com
Sat Jun 1 11:04:25 UTC 2013
The following commit has been merged in the experimental branch:
commit 1623f540b113391b2f5b91f0f5a6e31e5bf2bed2
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Tue Apr 30 13:25:16 2013 +0100
erlang: Make separated builds work correctly.
Set ERL_LIBS and also create a phony 'ebin' directory for the
guestfs.beam (library) so that the tests run against the local copy
not the installed version, and so that separated builds work.
diff --git a/.gitignore b/.gitignore
index a303092..8e5fe92 100644
--- a/.gitignore
+++ b/.gitignore
@@ -104,6 +104,7 @@ Makefile.in
/erlang/examples/stamp-guestfs-erlang.pod
/erlang/guestfs.beam
/erlang/guestfs.erl
+/erlang/libguestfs-1.*
/erlang/test.img
/examples/copy-over
/examples/create-disk
diff --git a/erlang/Makefile.am b/erlang/Makefile.am
index 1599103..7ac24f2 100644
--- a/erlang/Makefile.am
+++ b/erlang/Makefile.am
@@ -38,8 +38,17 @@ erlang_bindir = $(ERLANG_LIB_DIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)/ebin
erlang_bin_DATA = guestfs.beam
+# In order for the tests to work on the local copy, we have to create
+# a phony directory hierarchy:
+#
+# $(builddir)/erlang/libguestfs-$(VERSION)/ebin/guestfs.beam
+#
+# The ./run script will set $ERL_LIBS to point to $(builddir)/erlang.
+# (See: http://www.erlang.org/doc/man/code.html)
guestfs.beam: guestfs.erl
$(ERLC) +debug_info $^
+ mkdir -p $(PACKAGE)-$(VERSION)/ebin
+ cp $@ $(PACKAGE)-$(VERSION)/ebin
bin_PROGRAMS = erl-guestfs
diff --git a/run.in b/run.in
index 6e0b63d..36916b5 100755
--- a/run.in
+++ b/run.in
@@ -118,6 +118,12 @@ fi
export CLASSPATH
# For Erlang.
+if [ -z "$ERL_LIBS" ]; then
+ ERL_LIBS="$b/erlang"
+else
+ ERL_LIBS="$b/erlang:$ERL_LIBS"
+fi
+export ERL_LIBS
if [ -z "$PATH" ]; then
PATH="$b/erlang"
else
--
Libguestfs Debian packaging
More information about the Pkg-libvirt-commits
mailing list