And Dist::Zooky too!

Dist::Zilla is fantastic, but I seem to have quite a few distributions I wanted to convert and doing the boilerplate for dist.ini from an existing distribution can be a little tedious.

Wouldn't it be great if there was a tool to do this for me?

And so Dist::Zooky was born.

( Embarressingly I had to explain the reference to RJBS, who found this ).

Dist::Zooky generates a dist.ini for a distribution by examining the metadata produced by running Makefile.PL or Build.PL and then converting it to something that
Dist::Zilla will like.

For Build.PL and Module::Install based distributions it does this from the MYMETA.yml file that is produced by running the .PL file. For ExtUtils::MakeMaker based distributions it gathers the meta by parsing the Makefile that is generated. Ick.

Here's an example

$ cd Foo-Bar

$ ls -l

total 32

-r--r--r-- 1 chris users 20 Apr 1 2005 CHANGES

-rw-r--r-- 1 chris users 152 Apr 1 2005 MANIFEST

-rw-r--r-- 1 chris users 389 Jan 13 2008 META.yml

-r-xr-xr-x 1 chris users 297 Jun 24 14:41 Makefile.PL

-r--r--r-- 1 chris users 19 Apr 1 2005 README

drwxr-xr-x 2 chris users 512 Apr 1 2005 bin

drwxr-xr-x 3 chris users 512 Apr 1 2005 lib

-r--r--r-- 1 chris users 49 Apr 1 2005

And Makefile.PL looks like this:

use ExtUtils::MakeMaker;

NAME => 'Foo::Bar',
AUTHOR => 'Gobby Davro',
LICENSE => 'perl',
VERSION_FROM => 'lib/Foo/',
EXE_FILES => ['bin/'],
PREREQ_PM => { 'Some::Dependency' => '1.02' },

So we run dzooky the Dist::Zooky command-line tool:

$ dzooky Wrote 'dist.ini'

There are a number of files that should be removed now

Do you want me to remove [MANIFEST Makefile.PL] ? (yes/no) [no] yes
Removing files

And now we have a dist.ini file:

name = Foo-Bar version = 0.01 author = Gobby Davro license = Perl_5 copyright_holder = Gobby Davro







;[Prereq / ConfigureRequires]
;[Prereq / BuildRequires]
Some::Dependency = 1.02

Neat, huh.

Leave a comment

About bingos

user-pic System administrator, part-time Perl hacker, full-time POE [] evangelist. One day he will be made to pay for his crimes. He has some modules on CPAN []. They may or may not be useful