Writing a CPAN Task

| No Comments | No TrackBacks
Writing a CPAN Task

Last week I was looking into CPAN Bundles and created my first Bundle for the PerlCertifiedHosting project. As a follow up this week I'll create a Task, which is the successor to Bundle.

After listing a load of CGI::Application modules in my Bundle::CertHost it seems it would make a lot of sense if CGI::Application had it's own Bundle or Task that I could just link to.

http://search.cpan.org/dist/Task/lib/Task.pm
A Task is very straight forward. Nothing special about it really as it uses the same Makefile.PL system as normal modules.

First Draft

### In Makefile.PL
use inc::Module::Install;

name         'Task-CGI-Application';
abstract     'Install the most common CGI::Application modules';
author       'Lyle Hopkins <cosmicnet@cpan.org>';
version_from 'lib/Task/CGI/Application.pm';
license      'perl';

# All the things we need for CGI::Application
requires     'CGI::Simple' => 0;
requires     'FCGI' => 0;
requires     'CGI::Fast' => 0;
requires     'CGI::Application' => 0;
requires     'CGI::Application::Plugin::ActionDispatch' => 0;
...lots more...
requires     'Titanium' => 0;

WriteAll;


### In lib/Task/CGI/Application.pm
package Task::CGI::Application;

use strict;
use vars qw( $VERSION );
BEGIN {
    $VERSION = '0.01';
}#BEGIN


1;

That was pretty easy. This is the first time I've used Module::Install so I had to grab that module first "ppm install Module::Install". Also I had to update the MANIFEST to include the Module::Install files that are put in the inc/ folder.

### In MANIFEST
Changes
Makefile.PL
MANIFEST
README
t/Task-CGI-Application.t
lib/Task/CGI/Application.pm
inc/Module/Install.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
inc/Module/Install/Fetch.pm
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm


nmake dist
perl \UnixUtils\tarfixer.pl -i.bak Task-CGI-Application-0.01.tar.gz

Ready to go up to CPAN. That was easy :)


Lyle

No TrackBacks

TrackBack URL: http://perl.bristolbath.org/cgi-bin/mt/mt-tb.cgi/15

Leave a comment

About this Entry

This page contains a single entry by Lyle published on February 8, 2009 9:30 PM.

Writing a CPAN Bundle was the previous entry in this blog.

Perl patching experiences part 1 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.