Re: Injecting custom code to the make install process?

2005-12-04 Thread Marcel Holan
On Sat, Dec 03, 2005 at 03:13:36PM +, Nick Ing-Simmons wrote:
 Or you could override install sub, call original and add your
 Makefile fragment: 
 
 package MY;
 
 sub install
 {
  my $self = shift;
  my $str = $self-MM::install(@_);
  $str .= MyStuff;
 ...
 MyStuff
  return $str; 
 }

Thanks for that info - I'll try it. Somehow I was not able to extract this
hint from the docs.


-- 
 best regards
  Marcel Holan

 project manager RD
++
 PetaMem s.r.o., Ocelarska 1, 190 00 Praha, Czech Republic - www.petamem.com


Re: Injecting custom code to the make install process?

2005-12-03 Thread Nick Ing-Simmons
Marcel Holan [EMAIL PROTECTED] writes:
Hi MM-Team, hi Michael,

I'm trying to make a nice CPAN-package called Goo (see http://thegoo.org) and
have serious problems using ExtUtils::MakeMaker (MM).

Now the problems may very well result from my inexperience with MM, as I never
needed anything more than just a  NAME, VERSION_FROM  AUTHOR Makefile.PL
OTOH, MM documentation - while (or because) extensive - is quite terse. All I
need to do is to hook up own perl code to the make install part of the
generated Makefile. I don't find anything in the docs.

Basically, there is this skel directory whose contents I'd need to copy to
/usr/lib/Goo 

That likely needs root permission - do you really mean /usr/lib/...
or did you intend a perl directory?

and to create a link (or copy where links not available) from goo
to goo.pl. That's all. Simple.

goo.pl why? and where is this file - in perl's script dir or ?


But not with MM - and my knowledge. I thought I could abuse some of the INST*
variables to get make install do the copying. But instead it blew up by
copying the whole lib to skel and installed that under /usr/lib/Goo

Makefiles generated by MM use double colon rules for install etc.
So you can add a fragment of makefile (say by defining sub MY::postamble)
which does 

install :: ...
... 

To do whatever you want.

Or you could override install sub, call original and add your
Makefile fragment: 

package MY;

sub install
{
 my $self = shift;
 my $str = $self-MM::install(@_);
 $str .= MyStuff;
...
MyStuff
 return $str; 
}