gaal has asked for the wisdom of the Perl Monks concerning the following question:
So I cooked up this hackaround. It may be useful for people, but I'm posting this as a SoPW and not a Snippet because somehow I feel I'm doing something wrong. Certainly, this only Works For MeTM because the module I'm packaging is pure Perl and doesn't need a blib/; YMMV and if you know the Right Thing to do here, please let me know.
In any case, here it is. It just makes a PAR from everything in your MANIFEST, and names it DIST-VER.par. Usage:
./Build.PL && ./Build pardist
In your Build.PL, instead of
my $build = new Module::Builder
Put this:
my $class = Module::Build->subclass ( class => 'My::Builder', code => q# sub make_parfile { my ($self, $file) = @_; $file =~ s/(?<!\.par)$/.par/; print "Creating $file\n"; require Archive::Zip; my $zip = Archive::Zip->new(); $zip->addFile($_) for keys %{ $self->_read_manifest('MANIFEST') +}; die 'write error' unless $zip->writeToFileNamed( $file ) == Arch +ive::Zip->AZ_OK; } sub ACTION_pardist { my($self) = @_; $self->make_parfile(join "-", $self->dist_name, $self->dist_vers +ion); } #, ); my $build = $class->new # The rest is the same.
|
|---|