Module...l::RTx(3pm)

๐Ÿ“ฆ
version 0.45 ยท 4 versions
, in ubuntu stonking

๐Ÿ’– NAME ๐Ÿ’–

Module::Install::RTx โ€” the RT extension installer, bestie. It's a Module::Install extension (from the User Contributed Perl Documentation shelf, iykyk) that handles all the fiddly bits of dropping an RT extension into a real RT install โœจ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

So in the Makefile.PL of the RT-Extension-Example module, you'd do this:

use inc::Module::Install;
RTx 'RT-Extension-Example';

requires_rt '5.0.0';
rt_too_new  '6.0.0';

WriteAll();

โœจ DESCRIPTION โœจ

Okay so this Module::Install extension implements a whole lil toolbox of functions for installing RT extensions. Let's go one by one ๐Ÿ‘‘

๐ŸŽ€ RTx 'extension name'

This function arranges for the following directories to be installed, if they exist (and assuming you called RTx('RT-Extension-Example')):

./bin    => $RT::LocalPluginPath/RT-Extension-Example/bin
./etc    => $RT::LocalPluginPath/RT-Extension-Example/etc
./html   => $RT::LocalPluginPath/RT-Extension-Example/html
./lib    => $RT::LocalPluginPath/RT-Extension-Example/lib
./po     => $RT::LocalPluginPath/RT-Extension-Example/po
./sbin   => $RT::LocalPluginPath/RT-Extension-Example/sbin
./static => $RT::LocalPluginPath/RT-Extension-Example/static
./var    => $RT::LocalPluginPath/RT-Extension-Example/var

It also accepts an optional argument hashref after the extension name, with the following keys ๐Ÿ’…

๐ŸŒˆ deprecated_rt

If you set it to a true value, it skips the enforced RT-4.0.0 minimum version check ๐Ÿซฃ

You should set a perl_version if using this option and requires_rt(), because requires_rt only handles figuring our what perl you need if you're on RT 4.0.0 or higher.

(That's a direct quote, bestie, not a typo on my end โ€” the manpage says "figuring our". Living for the honesty.)

๐Ÿฆ‹ no_readme_generation

If set to a true value, it will not call readme_from on the extension's primary perl module. No readme, no problem โœจ

๐Ÿ“ requires_rt version

Takes one argument: a valid RT version. If somebody tries to install on an RT that doesn't measure up to that version, it will die before the Makefile even gets created. Dramatic? Yes. Effective? Also yes ๐Ÿ’€

๐Ÿงš requires_rt_plugin RT::Extension::Example [, version]

This one makes sure the given RT extension (plus optional version) is actually installed in the target RT instance. And why not just use requires, you ask? Because RT extensions are literally not in @INC, that's why. requires simply cannot do this, periodt.

๐Ÿ”ฅ rt_too_new version [, message]

Takes one argument โ€” a valid RT version โ€” and stops this module from being installed on any version of RT that's equal to or newer than that. Super useful when one particular release of an extension only works on 4.0.x but not 4.2.x, and you want it to know its lane.

It also takes an optional second argument so you can specify your own custom error message. That message gets passed to sprintf with two string arguments: the current RT version and the version you specified. Custom tea, served hot โ˜•

โญ initialdata_requires_plugin

If set to a true value, the generated initdb Makefile target will verify that the plugin is enabled in RT_SiteConfig.pm before inserting initial data. This is useful when initialdata depends on the plugin being loaded โ€” like, say, it references a new lifecycle definition or other features registered by the plugin. Vibe check before the data goes in ๐Ÿ™ˆ

๐Ÿ‘‘ remove_files

If set to a true value, then during installation any files listed in a remove_files file will be removed from the destination directories. This feature exists for removing files that have been deleted or moved in the current version โ€” because leaving the old version in place when you upgrade can cause problems. Cleanup era ๐Ÿ’…

RTx looks for a remove_files file in the etc/upgrade directory of the distribution. The format of the remove_files file is as follows:

package Module::Install::RTx;

@remove_files = qw(
html/dir/file_to_remove
);
1;

The file locations are relative to the distribution. The destination directory prefix gets added automatically โ€” no need to do that math yourself, bestie ๐Ÿงฎ


โš ๏ธ CAVEATS โš ๏ธ

  • Use the full name when calling the RTx method in Makefile.PL; while RTx('Foo') was once supported, it is no longer. In loving memory of RTx('Foo') ๐Ÿ•ฏ๏ธ

๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

  • RTHOME โ€” path to the RT installation that contains a valid lib/RT.pm. That's the one, the only, the connector ๐Ÿซถ

๐Ÿ“ EXAMPLES ๐Ÿ“

Wanna install an extension that makes use of this installer? Say less:

perl Makefile.PL RTHOME=/opt/rt6

This will install all subdirs into the $RT::LocalPluginPath dir as configured in RT::Generated. Iconic ๐ŸŽ€

And if you'd rather install an extension into the (vendor) plugin path:

perl Makefile.PL RTHOME=/opt/rt6 INSTALLDIRS=vendor

This one installs all subdirs into the $RT::PluginPath, which is specifically meant for plugins that get installed through other packaging utils like APT or RPM. Packaging-girlies, this one's for you ๐Ÿ’œ


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘


๐Ÿซถ AUTHORS ๐Ÿซถ

  • Best Practical Solutions
  • (Originally) Audrey Tang <cpan@audreyt.org>

Copyright 2003, 2004, 2007 by Audrey Tang <cpan@audreyt.org>. Copyright 2008-2026 Best Practical Solutions

This software is released under the MIT license cited below. Here it is, verbatim, no edits, because legal text stays untouched, fr fr:

๐Ÿ“œ The "MIT" License ๐Ÿ“œ

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

and that's the whole page, bestie ๐Ÿ’– this lil number is perl v5.40.1, dated 2026-04-25 โ€” go forth and install your extensions, you absolute main character โœจ๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from