From: Sven Eckelmann <sven@narfation.org>
Date: Sun, 22 Jun 2014 22:09:56 +0200
Subject: Install module to perl vendor path

Bug-Debian: https://bugs.debian.org/752344
Forwarded: not-needed
---
 api/perl/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/api/perl/Makefile b/api/perl/Makefile
index 0169e5b..d928d4d 100644
--- a/api/perl/Makefile
+++ b/api/perl/Makefile
@@ -3,6 +3,7 @@ include build/top.make
 BINARY = ExactImage
 BINARY_EXT = $(X_DYNEXT)
 DEPS = $(lib_BINARY) $(bardecode_BINARY) $(codecs_BINARY) $(api_BINARY) $($(X_MODULE)_OUTPUT)/api-perl-wrap.cc
+PERL_ARCHLIB := $(shell perl -MConfig -e 'print $$Config{vendorarch}')
 
 objdir/api/perl/CXXFLAGS := -I api $(PERLINCS)
 
@@ -20,5 +21,5 @@ X_BUILD_IMPLICIT := $(_X_BUILD_IMPLICIT)
 all:: $($(X_MODULE)_BINARY)
 install:: $($(X_MODULE)_BINARY)
 	$(Q)echo "INSTALL PERL module $^"
-	$(Q)mkdir -p $(DESTDIR)$(libdir)/perl5/site_perl/
-	$(Q)install $^ $(dir $^)/ExactImage.pm $(DESTDIR)$(libdir)/perl5/site_perl/
+	$(Q)mkdir -p $(DESTDIR)$(PERL_ARCHLIB)
+	$(Q)install $^ $(dir $^)/ExactImage.pm $(DESTDIR)$(PERL_ARCHLIB)
