[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:24 UTC 2013


The following commit has been merged in the experimental branch:
commit 4ea016dae96ed4fc3ca6d057f17fde9697f0e627
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Tue Apr 30 12:22:54 2013 +0100

    perl: Fix build and test to work with separated builds.
    
    This is inspired largely by Hilko Bengen's equivalent
    hivex patch here:
    
    https://github.com/libguestfs/hivex/commit/887466794a40f57b84ce32524e1a650d6674c7e6

diff --git a/.gitignore b/.gitignore
index eb1e749..a303092 100644
--- a/.gitignore
+++ b/.gitignore
@@ -285,6 +285,7 @@ Makefile.in
 /perl/MYMETA.json
 /perl/MYMETA.yml
 /perl/pm_to_blib
+/perl/run-perl-tests
 /php/extension/acinclude.m4
 /php/extension/aclocal.m4
 /php/extension/autom4te.cache
diff --git a/configure.ac b/configure.ac
index bb7e2fe..3298a49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1546,6 +1546,8 @@ AC_CONFIG_FILES([appliance/libguestfs-make-fixed-appliance],
                 [chmod +x,-w appliance/libguestfs-make-fixed-appliance])
 AC_CONFIG_FILES([inspector/test-xmllint.sh],
                 [chmod +x,-w inspector/test-xmllint.sh])
+AC_CONFIG_FILES([perl/run-perl-tests],
+                [chmod +x,-w perl/run-perl-tests])
 AC_CONFIG_FILES([pick-guests.pl],
                 [chmod +x,-w pick-guests.pl])
 AC_CONFIG_FILES([podwrapper.pl],
diff --git a/perl/Makefile.PL.in b/perl/Makefile.PL.in
index 59b00d6..4f12bc0 100644
--- a/perl/Makefile.PL.in
+++ b/perl/Makefile.PL.in
@@ -19,13 +19,13 @@ use Config;
 use ExtUtils::MakeMaker;
 
 WriteMakefile (
-    FIRST_MAKEFILE => 'Makefile-pl',
+    FIRST_MAKEFILE => '@abs_builddir@/Makefile-pl',
 
     NAME => 'Sys::Guestfs',
     VERSION => '0. at MAX_PROC_NR@',
 
-    LIBS => '-L at top_builddir@/src/.libs -lguestfs',
-    INC => '-I at top_builddir@/src -I at top_srcdir@/src',
+    LIBS => '-L at abs_top_builddir@/src/.libs -lguestfs',
+    INC => '-I at abs_top_builddir@/src -I at abs_top_srcdir@/src',
     TYPEMAPS => [ '@srcdir@/typemap' ],
     CCFLAGS => $Config{ccflags} . ' -DGUESTFS_PRIVATE=1 @CFLAGS@',
     );
diff --git a/perl/Makefile.am b/perl/Makefile.am
index de38fcd..d34adbe 100644
--- a/perl/Makefile.am
+++ b/perl/Makefile.am
@@ -64,10 +64,20 @@ TESTS_ENVIRONMENT = $(top_builddir)/run --test
 INSTALLDIRS = site
 
 all: Makefile-pl src_deps
-	$(MAKE) -f Makefile-pl
+	$(MAKE) -C $(srcdir) -f $(abs_builddir)/Makefile-pl \
+		INST_ARCHLIB=$(abs_builddir)/blib/arch \
+		INST_SCRIPT=$(abs_builddir)/blib/script \
+		INST_BIN=$(abs_builddir)/blib/bin \
+		INST_LIB=$(abs_builddir)/blib/lib \
+		INST_MAN1DIR=$(abs_builddir)/blib/man1 \
+		INST_MAN3DIR=$(abs_builddir)/blib/man3 \
+		TEST_FILES=$(abs_srcdir)/t/*.t
 
 Makefile-pl: Makefile.PL
-	perl Makefile.PL INSTALLDIRS=$(INSTALLDIRS) PREFIX=$(prefix)
+	cd $(srcdir); \
+	perl $(abs_builddir)/Makefile.PL \
+		INSTALLDIRS=$(INSTALLDIRS) PREFIX=$(prefix)
+	sed -i 's,Makefile.PL,$(abs_builddir)/Makefile.PL,' $@
 
 # No!  Otherwise it is deleted before the clean-local rule runs.
 #CLEANFILES = Makefile-pl
diff --git a/perl/run-perl-tests b/perl/run-perl-tests.in
similarity index 93%
rename from perl/run-perl-tests
rename to perl/run-perl-tests.in
index 0e7e9ab..11278a8 100755
--- a/perl/run-perl-tests
+++ b/perl/run-perl-tests.in
@@ -18,4 +18,4 @@
 
 set -e
 
-make -f Makefile-pl test "$@"
+make -C $srcdir -f @abs_builddir@/Makefile-pl test "$@"
diff --git a/run.in b/run.in
index 33f979c..1edc8e4 100755
--- a/run.in
+++ b/run.in
@@ -74,9 +74,9 @@ export LD_LIBRARY_PATH
 
 # For Perl.
 if [ -z "$PERL5LIB" ]; then
-    PERL5LIB="$b/perl/blib/lib:$b/perl/blib/arch"
+    PERL5LIB="$s/perl/lib:$b/perl/blib/lib:$b/perl/blib/arch"
 else
-    PERL5LIB="$b/perl/blib/lib:$b/perl/blib/arch:$PERL5LIB"
+    PERL5LIB="$s/perl/lib:$b/perl/blib/lib:$b/perl/blib/arch:$PERL5LIB"
 fi
 export PERL5LIB
 

-- 
Libguestfs Debian packaging



More information about the Pkg-libvirt-commits mailing list