[Bps-public-commit] Module-Install-RTx branch, master, updated. 0.37-2-g72a91d6

Shawn Moore shawn at bestpractical.com
Mon Nov 30 15:46:58 EST 2015


The branch, master has been updated
       via  72a91d6ecb4a3ab4a0e34fd2bfe94f57c6318f03 (commit)
       via  89a9c6c19cc6324e58b1bcb1ee39b4f092f5cfbe (commit)
      from  28f09587349d107872dfd98ffeb317591f60a9a6 (commit)

Summary of changes:
 lib/Module/Install/RTx.pm | 40 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit 89a9c6c19cc6324e58b1bcb1ee39b4f092f5cfbe
Author: Dominic Hargreaves <dom at earth.li>
Date:   Fri Apr 24 23:47:25 2015 +0100

    Support for INSTALLDIRS=vendor
    
    INSTALLDIRS=vendor will install the module into the configured
    $RT::PluginPath variable in RT::Generated.
    
    Heavily inspired by Kai Storbeck's patch against an older version
    of Module::Install::RTx

diff --git a/lib/Module/Install/RTx.pm b/lib/Module/Install/RTx.pm
index c25cd76..90e7ef4 100644
--- a/lib/Module/Install/RTx.pm
+++ b/lib/Module/Install/RTx.pm
@@ -36,6 +36,13 @@ sub RTx {
     }
     $self->add_metadata("x_module_install_rtx_version", $VERSION );
 
+    my $installdirs = $ENV{INSTALLDIRS};
+    for ( @ARGV ) {
+        if ( /INSTALLDIRS=(.*)/ ) {
+            $installdirs = $1;
+        }
+    }
+
     # Try to find RT.pm
     my @prefixes = qw( /opt /usr/local /home /usr /sw /usr/share/request-tracker4);
     $ENV{RTHOME} =~ s{/RT\.pm$}{} if defined $ENV{RTHOME};
@@ -70,7 +77,13 @@ sub RTx {
 
     # Installation locations
     my %path;
-    $path{$_} = $RT::LocalPluginPath . "/$name/$_"
+    my $plugin_path;
+    if ( $installdirs && $installdirs eq 'vendor' ) {
+        $plugin_path = $RT::PluginPath;
+    } else {
+        $plugin_path = $RT::LocalPluginPath;
+    }
+    $path{$_} = $plugin_path . "/$name/$_"
         foreach @DIRS;
 
     # Copy RT 4.2.0 static files into NoAuth; insufficient for
@@ -130,6 +143,7 @@ install ::
     if ( $path{lib} ) {
         $self->makemaker_args( INSTALLSITELIB => $path{'lib'} );
         $self->makemaker_args( INSTALLARCHLIB => $path{'lib'} );
+        $self->makemaker_args( INSTALLVENDORLIB => $path{'lib'} )
     } else {
         $self->makemaker_args( PM => { "" => "" }, );
     }
@@ -138,6 +152,13 @@ install ::
     $self->makemaker_args( INSTALLSITEMAN3DIR => "$RT::LocalPath/man/man3" );
     $self->makemaker_args( INSTALLSITEARCH => "$RT::LocalPath/man" );
 
+    # INSTALLDIRS=vendor should install manpages into /usr/share/man.
+    # That is the default path in most distributions. Need input from
+    # Redhat, Centos etc.
+    $self->makemaker_args( INSTALLVENDORMAN1DIR => "/usr/share/man/man1" );
+    $self->makemaker_args( INSTALLVENDORMAN3DIR => "/usr/share/man/man3" );
+    $self->makemaker_args( INSTALLVENDORARCH => "/usr/share/man" );
+
     if (%has_etc) {
         print "For first-time installation, type 'make initdb'.\n";
         my $initdb = '';
@@ -348,6 +369,23 @@ Path to the RT installation that contains a valid F<lib/RT.pm>.
 
 =back
 
+=head1 EXAMPLES
+
+To install an extension which makes use of this installer:
+
+    perl Makefile.PL RTHOME=/opt/rt4
+
+This will install all subdirs into the $RT::LocalPluginPath dir
+as configured in RT::Generated.
+
+To install an extension into the (vendor) plugin path:
+
+    perl Makefile.PL RTHOME=/opt/rt4 INSTALLDIRS=vendor
+
+This will install all subdirs into the $RT::PluginPath which is specifically
+meant for plugins that are installed through other packaging utils like
+APT or RPM.
+
 =head1 SEE ALSO
 
 L<Module::Install>

commit 72a91d6ecb4a3ab4a0e34fd2bfe94f57c6318f03
Merge: 28f0958 89a9c6c
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Mon Nov 30 15:46:44 2015 -0500

    Merge remote-tracking branch 'jmdh/support_installdirs_vendor'


-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list