1Module::Package::PluginU(s3e)r Contributed Perl DocumentaMtoidounle::Package::Plugin(3)
2
3
4
6 package Module::Package::Name;
7
8 package Module::Package::Name::flavor;
9 use Moo;
10 extends 'Module::Package::Plugin';
11
12 sub main {
13 my ($self) = @_;
14 $self->mi->some_module_install_author_plugin;
15 $self->mi->other_author_plugin;
16 }
17
18 1;
19
21 This module is the base class for Module::Package plugins.
22
24 Take a look at the Module::Package::Ingy module, for a decent starting
25 point example. That plugin module is actually used to package
26 Module::Package itself.
27
29 To create a Module::Package plugin you need to subclass
30 Module::Package::Plugin and override the "main" method, and possibly
31 other things. This section describes how that works.
32
33 Makefile.PL processing happens in the following order:
34
35 - 'use inc::Module::Package...' is invoked
36 - $plugin->initial is called
37 - BEGIN blocks in Makefile.PL are run
38 - $plugin->main is called
39 - The body of Makefile.PL is run
40 - $plugin->final is called
41
42 initial
43 This method is call during the processing of 'use
44 inc::Module::Package'. You probably don't need to subclass it. If you
45 do you probably want to call the SUPER method.
46
47 It runs the deps_list, if any and guesses the primary modules file
48 path.
49
50 main
51 This is the method you must override. Do all the things you want. You
52 can call "all_from", if you need to get sequencing right, otherwise it
53 gets called by final(). Don't call "WriteAll", it get's called
54 automatically in final().
55
56 final
57 This does all the things after the entire Makefile.PL body has run. You
58 probably don't need to override it.
59
61 The following options are available for use from the Makefile.PL:
62
63 use Module::Package 'Foo:bar',
64 deps_list => 0|1,
65 install_bin => 0|1,
66 install_share => 0|1,
67 manifest_skip => 0|1,
68 requires_from => 0|1;
69
70 These options can be used by any subclass of this module.
71
72 deps_list
73 Default is 1.
74
75 This option tells Module::Package to generate a "author_requires" deps
76 list, when you run the Makefile.PL. This list will go in the file
77 "pkg/deps_list.pl" if that exists, or after a '__END__' statement in
78 your Makefile.PL. If neither is available, a reminder will be warned
79 (only when the author runs it).
80
81 This list is important if you want people to be able to collaborate on
82 your modules easily.
83
84 install_bin
85 Default is 1.
86
87 All files in a "bin/" directory will be installed. It will call the
88 "install_script" plugin for you. Set this option to 0 to disable it.
89
90 install_share
91 Default is 1.
92
93 All files in a "share/" directory will be installed. It will call the
94 "install_share" plugin for you. Set this option to 0 to disable it.
95
96 manifest_skip
97 Default is 1.
98
99 This option will generate a sane MANIFEST.SKIP for you and delete it
100 again when you run "make clean". You can add your own skips in the file
101 called "pkg/manifest.skip". You almost certainly want this option on.
102 Set to 0 if you are weird.
103
104 requires_from
105 Default is 1.
106
107 This option will attempt to find all the requirements from the primary
108 module. If you make any of your own requires or requires_from calls,
109 this option will do nothing.
110
111
112
113perl v5.38.0 2023-07-20 Module::Package::Plugin(3)