⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 module::build::api.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 5 页
字号:
documentation..IP "create_readme" 4.IX Item "create_readme"[version 0.22].SpThis parameter tells Module::Build to automatically create a \fI\s-1README\s0\fRfile at the top level of your distribution.  Currently it will simplyuse \f(CW\*(C`Pod::Text\*(C'\fR (or \f(CW\*(C`Pod::Readme\*(C'\fR if it's installed) on the fileindicated by \f(CW\*(C`dist_version_from\*(C'\fR and put the result in the \fI\s-1README\s0\fRfile.  This is by no means the only recommended style for writing a\&\s-1README\s0, but it seems to be one common one used on the \s-1CPAN\s0..SpIf you generate a \fI\s-1README\s0\fR in this way, it's probably a good idea tocreate a separate \fI\s-1INSTALL\s0\fR file if that information isn't in thegenerated \fI\s-1README\s0\fR..IP "dist_abstract" 4.IX Item "dist_abstract"[version 0.20].SpThis should be a short description of the distribution.  This is usedwhen generating metadata for \fI\s-1META\s0.yml\fR and \s-1PPD\s0 files.  If it is notgiven then \f(CW\*(C`Module::Build\*(C'\fR looks in the \s-1POD\s0 of the module from whichit gets the distribution's version.  It looks for the first linematching \f(CW\*(C`$package\es\-\es(.+)\*(C'\fR, and uses the captured text as theabstract..IP "dist_author" 4.IX Item "dist_author"[version 0.20].SpThis should be something like \*(L"John Doe <jdoe@example.com>\*(R", or ifthere are multiple authors, an anonymous array of strings may bespecified.  This is used when generating metadata for \fI\s-1META\s0.yml\fR and\&\s-1PPD\s0 files.  If this is not specified, then \f(CW\*(C`Module::Build\*(C'\fR looks atthe module from which it gets the distribution's version.  If it findsa \s-1POD\s0 section marked \*(L"=head1 \s-1AUTHOR\s0\*(R", then it uses the contents ofthis section..IP "dist_name" 4.IX Item "dist_name"[version 0.11].SpSpecifies the name for this distribution.  Most authors won't need toset this directly, they can use \f(CW\*(C`module_name\*(C'\fR to set \f(CW\*(C`dist_name\*(C'\fR toa reasonable default.  However, some agglomerative distributions like\&\f(CW\*(C`libwww\-perl\*(C'\fR or \f(CW\*(C`bioperl\*(C'\fR have names that don't correspond directlyto a module name, so \f(CW\*(C`dist_name\*(C'\fR can be set independently..IP "dist_version" 4.IX Item "dist_version"[version 0.11].SpSpecifies a version number for the distribution.  See \*(L"module_name\*(R"or \*(L"dist_version_from\*(R" for ways to have this set automatically from a\&\f(CW$VERSION\fR variable in a module.  One way or another, a versionnumber needs to be set..IP "dist_version_from" 4.IX Item "dist_version_from"[version 0.11].SpSpecifies a file to look for the distribution version in.  Mostauthors won't need to set this directly, they can use \*(L"module_name\*(R"to set it to a reasonable default..SpThe version is extracted from the specified file according to the samerules as ExtUtils::MakeMaker and \f(CW\*(C`CPAN.pm\*(C'\fR.  It involves findingthe first line that matches the regular expression.Sp.Vb 1\&   /([\e$*])(([\ew\e:\e\*(Aq]*)\ebVERSION)\eb.*\e=/.Ve.Sp\&\fIeval()\fR\-ing that line, then checking the value of the \f(CW$VERSION\fRvariable.  Quite ugly, really, but all the modules on \s-1CPAN\s0 depend onthis process, so there's no real opportunity to change to somethingbetter..IP "dynamic_config" 4.IX Item "dynamic_config"[version 0.07].SpA boolean flag indicating whether the \fIBuild.PL\fR file must beexecuted, or whether this module can be built, tested and installedsolely from consulting its metadata file.  The main reason to set thisto a true value is that your module performs some dynamicconfiguration as part of its build/install process.  If the flag isomitted, the \fI\s-1META\s0.yml\fR spec says that installation tools shouldtreat it as 1 (true), because this is a safer way to behave..SpCurrently \f(CW\*(C`Module::Build\*(C'\fR doesn't actually do anything with this flag\&\- it's up to higher-level tools like \f(CW\*(C`CPAN.pm\*(C'\fR to do something usefulwith it.  It can potentially bring lots of security, packaging, andconvenience improvements..IP "extra_compiler_flags" 4.IX Item "extra_compiler_flags".PD 0.IP "extra_linker_flags" 4.IX Item "extra_linker_flags".PD[version 0.19].SpThese parameters can contain array references (or strings, in whichcase they will be split into arrays) to pass through to the compilerand linker phases when compiling/linking C code.  For example, to tellthe compiler that your code is \*(C+, you might do:.Sp.Vb 5\&  my $build = Module::Build\->new\&    (\&     module_name          => \*(AqFoo::Bar\*(Aq,\&     extra_compiler_flags => [\*(Aq\-x\*(Aq, \*(Aqc++\*(Aq],\&    );.Ve.SpTo link your \s-1XS\s0 code against glib you might write something like:.Sp.Vb 7\&  my $build = Module::Build\->new\&    (\&     module_name          => \*(AqFoo::Bar\*(Aq,\&     dynamic_config       => 1,\&     extra_compiler_flags => scalar \`glib\-config \-\-cflags\`,\&     extra_linker_flags   => scalar \`glib\-config \-\-libs\`,\&    );.Ve.IP "get_options" 4.IX Item "get_options"[version 0.26].SpYou can pass arbitrary command line options to \fIBuild.PL\fR or\&\fIBuild\fR, and they will be stored in the Module::Build object and canbe accessed via the \*(L"\fIargs()\fR\*(R" method.  However, sometimes you wantmore flexibility out of your argument processing than this allows.  Insuch cases, use the \f(CW\*(C`get_options\*(C'\fR parameter to pass in a hashreference of argument specifications, and the list of arguments to\&\fIBuild.PL\fR or \fIBuild\fR will be processed according to thosespecifications before they're passed on to \f(CW\*(C`Module::Build\*(C'\fR's ownargument processing..SpThe supported option specification hash keys are:.RS 4.IP "type" 4.IX Item "type"The type of option.  The types are those supported by Getopt::Long; consultits documentation for a complete list.  Typical types are \f(CW\*(C`=s\*(C'\fR for strings,\&\f(CW\*(C`+\*(C'\fR for additive options, and \f(CW\*(C`!\*(C'\fR for negatable options.  If thetype is not specified, it will be considered a boolean, i.e. noargument is taken and a value of 1 will be assigned when the option isencountered..IP "store" 4.IX Item "store"A reference to a scalar in which to store the value passed to the option.If not specified, the value will be stored under the option name in thehash returned by the \f(CW\*(C`args()\*(C'\fR method..IP "default" 4.IX Item "default"A default value for the option.  If no default value is specified and no optionis passed, then the option key will not exist in the hash returned by\&\f(CW\*(C`args()\*(C'\fR..RE.RS 4.SpYou can combine references to your own variables or subroutines withunreferenced specifications, for which the result will also be stored in thehash returned by \f(CW\*(C`args()\*(C'\fR.  For example:.Sp.Vb 10\&  my $loud = 0;\&  my $build = Module::Build\->new\&    (\&     module_name => \*(AqFoo::Bar\*(Aq,\&     get_options => {\&                     loud =>     { store => \e$loud },\&                     dbd  =>     { type  => \*(Aq=s\*(Aq   },\&                     quantity => { type  => \*(Aq+\*(Aq    },\&                    }\&    );\&\&  print STDERR "HEY, ARE YOU LISTENING??\en" if $loud;\&  print "We\*(Aqll use the ", $build\->args(\*(Aqdbd\*(Aq), " DBI driver\en";\&  print "Are you sure you want that many?\en"\&    if $build\->args(\*(Aqquantity\*(Aq) > 2;.Ve.SpThe arguments for such a specification can be called like so:.Sp.Vb 1\&  perl Build.PL \-\-loud \-\-dbd=DBD::pg \-\-quantity \-\-quantity \-\-quantity.Ve.Sp\&\fB\s-1WARNING:\s0\fR Any option specifications that conflict with Module::Build's ownoptions (defined by its properties) will throw an exception..SpConsult the Getopt::Long documentation for details on its usage..RE.IP "include_dirs" 4.IX Item "include_dirs"[version 0.24].SpSpecifies any additional directories in which to search for C headerfiles.  May be given as a string indicating a single directory, or asa list reference indicating multiple directories..IP "install_path" 4.IX Item "install_path"[version 0.19].SpYou can set paths for individual installable elements by using the\&\f(CW\*(C`install_path\*(C'\fR parameter:.Sp.Vb 8\&  my $build = Module::Build\->new\&    (\&     ...other stuff here...\&     install_path => {\&                      lib  => \*(Aq/foo/lib\*(Aq,\&                      arch => \*(Aq/foo/lib/arch\*(Aq,\&                     }\&    );.Ve.IP "installdirs" 4.IX Item "installdirs"[version 0.19].SpDetermines where files are installed within the normal perl hierarchyas determined by \fIConfig.pm\fR.  Valid values are: \f(CW\*(C`core\*(C'\fR, \f(CW\*(C`site\*(C'\fR,\&\f(CW\*(C`vendor\*(C'\fR.  The default is \f(CW\*(C`site\*(C'\fR.  See\&\*(L"\s-1INSTALL\s0 \s-1PATHS\s0\*(R" in Module::Build.IP "license" 4.IX Item "license"[version 0.07].SpSpecifies the licensing terms of your distribution.  Valid options include:.RS 4.IP "apache" 4.IX Item "apache"The distribution is licensed under the Apache Software License(<http://opensource.org/licenses/apachepl.php>)..IP "artistic" 4.IX Item "artistic"The distribution is licensed under the Artistic License, as specifiedby the \fIArtistic\fR file in the standard Perl distribution..IP "artistic_2" 4.IX Item "artistic_2"The distribution is licensed under the Artistic 2.0 License(<http://opensource.org/licenses/artistic\-license\-2.0.php>.).IP "bsd" 4.IX Item "bsd"The distribution is licensed under the \s-1BSD\s0 License(<http://www.opensource.org/licenses/bsd\-license.php>)..IP "gpl" 4.IX Item "gpl"The distribution is licensed under the terms of the \s-1GNU\s0 GeneralPublic License (<http://www.opensource.org/licenses/gpl\-license.php>)..IP "lgpl" 4.IX Item "lgpl"The distribution is licensed under the terms of the \s-1GNU\s0 LesserGeneral Public License(<http://www.opensource.org/licenses/lgpl\-license.php>)..IP "mit" 4.IX Item "mit"The distribution is licensed under the \s-1MIT\s0 License(<http://opensource.org/licenses/mit\-license.php>)..IP "mozilla" 4.IX Item "mozilla"The distribution is licensed under the Mozilla PublicLicense.  (<http://opensource.org/licenses/mozilla1.0.php> or<http://opensource.org/licenses/mozilla1.1.php>).IP "open_source" 4.IX Item "open_source"The distribution is licensed under some other Open SourceInitiative-approved license listed at<http://www.opensource.org/licenses/>..IP "perl" 4.IX Item "perl"The distribution may be copied and redistributed under the same termsas Perl itself (this is by far the most common licensing option formodules on \s-1CPAN\s0).  This is a dual license, in which the user maychoose between either the \s-1GPL\s0 or the Artistic license..IP "restrictive" 4.IX Item "restrictive"The distribution may not be redistributed without special permissionfrom the author and/or copyright holder..IP "unrestricted" 4.IX Item "unrestricted"The distribution is licensed under a license that is \fBnot\fR approvedby www.opensource.org but that allows distribution withoutrestrictions..RE.RS 4.SpNote that you must still include the terms of your license in yourdocumentation \- this field only lets automated tools figure out yourlicensing restrictions.  Humans still need something to read.  If youchoose to provide this field, you should make sure that you keep it insync with your written documentation if you ever change your licensingterms..SpIt is a fatal error to use a license other than the ones mentionedabove.  This is not because I wish to impose licensing terms on you \-please let me know if you would like another license option to beadded to the list.  You may also use a license type of \f(CW\*(C`unknown\*(C'\fR ifyou don't wish to specify your terms (but this is usually not a goodidea for you to do!)..SpI just started out with a small set of licenses to keep things simple,figuring I'd let people with actual working knowledge in this areatell me what to do.  So if that's you, drop me a line..RE.IP "meta_add" 4.IX Item "meta_add"[version 0.28].SpA hash of key/value pairs that should be added to the \fI\s-1META\s0.yml\fR fileduring the \f(CW\*(C`distmeta\*(C'\fR action.  Any existing entries with the samenames will be overridden..SpSee the \*(L"\s-1MODULE\s0 \s-1METADATA\s0\*(R" section for details..IP "meta_merge" 4.IX Item "meta_merge"[version 0.28]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -