File::ShareDir support is something I'd like to add to the Module::Build core. I just haven't had time to work on it.
I suspect it requires: * adding a "share_dir" property * adding an ACTION_share_dir routine (that does nothing if sharedir is undef) to copy things to the right spots in blib * making ACTION_build call share_dir I'm probably oversimplifying, but if you want to work on a patch, I'm willing to give advice along the way and integrate the patch when it's done. David On Aug 8, 2009 9:13 AM, "Thomas Klausner" <d...@cpan.org> wrote: Hi! So, to put my SDL-base Spaceinvaders game [0] on CPAN I need to install some stuff (images) alongside my dist. Previously I used several different homegrown techniques for this, which work. But I'd rather use the sort of common File::ShareDir instead of rolling my own. Unfortunatly, Module::Build does not support actually installing stuff that File::ShareDir can later find out of the box. I could now (again) fuzz around add_build_element, install_path etc, but I'd rather put all of this into a reusable module, i.e. something like File::Share::Install or Module::Install::Share, only for Module::Build. First question: Does this exist already? Or is there some easy way using Module::Build to say "take all the stuff in this dir and install it to where File::ShareDir would look for it"? Second question: Instead of writing a subclass of Module::Build and put that on CPAN I'd rather implement this as a mixin (i.e. a distribution that exports some methods that then can be used by a standard Module::Build instance). What do you think about that? For the API, I'd like to have something like $builder->install_share(@list_of_dirs); This would go through all the dirs, add the files in these dirs to the configuration ('share_files'), add a correct install_path, call add_build_elements, maybe add those files to no_index, .. Any more feedback/ideas? 0: http://github.com/domm/Game-PerlInvaders -- #!/usr/bin/perl http://domm.plix.at for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}