Plugin Packaging: Makefile.PL and Plugin Manifests

Once your plugin is ready for distribution, you will need to package it up into a single file, a zip file or a "tarball" (a .tar.gz file common among unix users) so that your users can easily download it.

Even though you have a choice between .tar.gz and .zip files we recommend only producing .zip files as in this day and age, zip is supported almost everywhere.

To create a zip file, you first need to produce two simple files: a Makefile.PL file and a MANIFEST.SKIP file. These files produce an automated way for you to reliably create a zip file. Here are some examples:

Example Makefile.PL

use ExtUtils::MakeMaker;
WriteMakefile(
    NAME            => "My Plugin's Display Name",
    VERSION         => '1.1',
    DISTNAME        => 'MyPlugin',
);

Example MANIFEST.SKIP

# version control
\bCVS
(^|/)\.

# CPAN chain files
^MANIFEST
^Makefile
^META.yml$
^blib/
~$

# packages
\.zip$
\.tar\.gz$

Creating a zip file for your plugin

Provided you have created a Makefile.PL and MANIFEST.SKIP file, the following sequence of commands will quickly and easily produce a zip file of your plugin. The zip produces will be clean - there will be no .~ files, or .svn files, or any other artifacts of development. The zip file will automatically have the version number of the plugin embedded within it to make it easy for your users to differentiate between older and newer builds.

> cd src/PluginName
> perl Makefile.PL
> make manifest
> make zipdist
This page was last updated on 2008-09-17, 14:41.  

Leave a note

Have a question, please use the MT Forums. Notes sumbitted here should pertain to tips & hints regarding documentation. Your note may be removed once it's contents has be integrated into the body of the page.