>>>>> On Fri, 12 Jan 2001 08:38:40 -0800, "Richard Anderson" <[EMAIL PROTECTED]> 
>said:

 > O.K., here's how I think it should work:
 > The Makefile.PL has a postamble subroutine that adds an additional step to
 > "make install" that installs the http-webtest directory in /usr/local/etc.

 > There is a Bourne shell script called "configure", to be run BEFORE "perl
 > Makefile.PL", that prompts the user for where he/she wants to install the
 > http-webtest directory.  If the desired location is not /usr/local/etc, the
 > shell script modifies the Makefile.PL using sed.

 > Sounds good?  The alternative is to have the "make install" step prompt the
 > user for the location of the directory, but this seems non-standard to me
 > and would be more difficult for me to program.

Nope, one of the axioms of distributing software is that no
distributed file ever modifies itself. It must be reproducable for the
innocent user what happens, what has happened so far and there should
always be a simple way to reestablish the state of all files as they
were when the distribution was unpacked (this shouldn't need another
untar).

So among the possible solutions would be that the Makefile.PL itself
runs a dialog with the user to find out the installation directory,
e.g. [untested, off the top of my head]:

use ExtUtils::MakeMaker qw(prompt);
use File::Spec;
my $default = "/usr/local/etc/webtest"; # or whatever
my $instdir = prompt "Where should your foobar files be stored permanently?", $default;

sub MY::postamble {
    sprintf qq{install :: %s\n\t\${CP} %s %s},
        File::Spec->catfile("etc", "permfile.txt"),
        File::Spec->catfile("etc", "permfile.txt"),
        File::Spec->catfile($instdir, "permfile.txt");
}


Hope that helps,
-- 
andreas

Reply via email to