tfoertsch has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am making my first steps with Module::Build. Maybe I haven't read the large amount of docs thoroughly enough. But how do I say something like the following to Module::Build?
dist => { PREOP => './mk_README.sh', COMPRESS => 'gzip -9f', }, ... sub MY::postamble { return <<'EOF'; rpm: dist $(PERL) -i -pe 's/^(Version:\s*).*/$${1}$(VERSION)/' perl-IO-Handl +e-Record.spec rpmbuild -ba perl-IO-Handle-Record.spec EOF }
I want it to do 3 things:

Is that possible?

Thanks,
Torsten

Replies are listed 'Best First'.
Re: How to deploy Module::Build
by tfoertsch (Beadle) on Sep 19, 2008 at 10:34 UTC
    OK, for the gzip -9f problem I found a workaround. Don't know if that's the right way, please comment!

    gzip respects the GZIP environment variable. So, one can subclass Module::Build and set it.

    use strict; use warnings; use Module::Build; my $builder = Module::Build->subclass ( code => q{ $ENV{GZIP}='-9f'; }, )->new ( module_name => 'POE::Wheel::IO::Handle::Record', license => 'perl', dist_author => 'Torsten Foertsch <torsten.foertsch@gmx.net> +', dist_version_from => 'lib/POE/Wheel/IO/Handle/Record.pm', requires => { 'IO::Handle::Record' => '0.10', 'Test::More' => 0, }, create_makefile_pl => 'passthrough', ); $builder->create_build_script();