Description: honour DESTDIR
 used in debian/rules, since the PREFIX hack is gone in perl 5.22
Origin: vendor
Bug-Debian: https://bugs.debian.org/792410
Forwarded: no
Author: gregor herrmann <gregoa@debian.org>
Last-Update: 2015-08-26

--- a/perl/Makefile.PL
+++ b/perl/Makefile.PL
@@ -65,26 +65,29 @@ dictionaries as follows:
 ==== ERROR ====
 __error__
     }
-    my( $libdir ) = ( "@ARGV" =~ m/\bINSTALLDIRS=vendor\b/ ? "INSTALLVENDORLIB" : "INSTALLSITELIB" );
+    my( $libdir ) = ( "@ARGV" =~ m/\bINSTALLDIRS=vendor\b/ ? "DESTINSTALLVENDORLIB" : "DESTINSTALLSITELIB" );
     my $grmfile = q!$(INST_LIB)/Juman/Grammar.pm!;
     my $dicfile = q!$(INST_LIB)/Juman/JUMAN.dic.db!;
     my( @targets ) = ( $grmfile );
     # push( @targets, $dicfile ) if( eval { require DB_File; } );
-    sprintf( <<'__targets__', $dicdir, join(" ",@targets), $libdir, $grmfile, $dicfile );
+    sprintf( <<'__targets__', $dicdir, join(" ",@targets), $libdir, $libdir, $grmfile, $dicfile );
 DICDIR       = %s
 JUMANTARGETS = %s
 
 jumandb_install: $(JUMANTARGETS)
+	mkdir -p $(%s)/Juman/
 	@umask 022; cp -fp $(JUMANTARGETS) $(%s)/Juman/
 
 jumandb_convert: $(JUMANTARGETS)
 
 %s: mkgrammarpm $(DICDIR)/JUMAN.grammar $(DICDIR)/JUMAN.katuyou
 	-rm -f $@
+	mkdir -p $(@D)
 	$(PERL) mkgrammarpm -o $@ $(DICDIR)
 
 %s: mkdicdb $(DICDIR)/*.dic
 	-rm -f $@
+	mkdir -p $(@D)
 	$(PERL) mkdicdb -o $@ $(DICDIR)/*.dic
 __targets__
 }
