Thomas Klausner wrote:
I'm currently fuzzing around with a Build.PL that should do the
following:
- ask for a location where the application shall be installed to
- make sure the location exists
- install various files there
- install the libs into the default location
That's exactly what I was trying to do too (see my earlier post to this
list), but I've not found anything on CPAN which fits the bill
perfectly, particularly something which installs with the correct
ownership and permissions. Module::Build uses ExtUtils::Install, and
will set the executable bit on certain *files*, but no more. Directories
are not handled at all, so although they may get created for files it's
installing, it won't create empty directories.
App::Build does more of what I needed but again doesn't deal with
permissions and ownership (if I remember right). I have some
modifications I need to wrap up and contribute back.
So, I am currently working around this problem with some code which does
it's own file copying, plus sets permissions and ownership from a
configuration file (since it's not feasible to expect them to be
preserved exactly in the distribution). I'd like to contribute this to
somewhere on CPAN (App::Build?) but it's had to take a low priority
relative to certain other work so far. To be included in a general
purpose module it would need to work on various platforms.
If you're interested I might be motivated to have another look, other
work permitting.
Can I somehow add Build actions? If yes, I could define a new action
'app_install', and call that with correct user. i.e
perl Build.PL
./Build
./Build test
./Build app_install
sudo ./Build install
Yes you can do this, there's some info in the M::B cookbook:
http://search.cpan.org/~kwilliams/Module-Build-0.2808/lib/Module/Build/Cookbook.pm
I also copied some of the code from the OpenGuides distribution (this
was just the first example I found):
http://search.cpan.org/src/DOM/OpenGuides-0.61/lib/OpenGuides/Build.pm
Cheers,
Nick