aboutsummaryrefslogtreecommitdiffstats
path: root/main/perl-rt-authen-externalauth/01-fix-plugindir.patch
blob: ea4fa485b2e313e38782a0230bff4534d420e42c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Author: Tom Jampen <tom@cryptography.ch>
Description:
 Using the PREFIX environment variable defined in rules to find debian's request
 tracker installation and fixing the plugin path to install to DESTDIR.

diff -Naurp a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
--- a/inc/Module/Install/RTx.pm	2014-10-15 08:41:45.631919231 +0200
+++ b/inc/Module/Install/RTx.pm	2014-10-15 08:41:04.130328032 +0200
@@ -42,12 +42,14 @@ sub RTx {
     $ENV{RTHOME} =~ s{/RT\.pm$}{} if defined $ENV{RTHOME};
     $ENV{RTHOME} =~ s{/lib/?$}{}  if defined $ENV{RTHOME};
     my @try = $ENV{RTHOME} ? ($ENV{RTHOME}, "$ENV{RTHOME}/lib") : ();
+    my $prefix = $ENV{PREFIX};
+    push @INC, "$prefix/lib";
     while (1) {
         my @look = @INC;
         unshift @look, grep {defined and -d $_} @try;
         push @look, grep {defined and -d $_}
             map { ( "$_/rt4/lib", "$_/lib/rt4", "$_/lib" ) } @prefixes;
-        last if eval {local @INC = @look; require RT; $RT::LocalLibPath};
+        last if eval {local @INC = @look; require RT; $RT::LocalPluginPath = '$(DESTDIR)'."$prefix/plugins"; $RT::LocalLibPath};
 
         warn
             "Cannot find the location of RT.pm that defines \$RT::LocalPath in: @look\n";