To further what has already been said, you can take a look at this basic Makefile.PL at the EXE_FILES directive to see how to go about having "binary" files installed. In that case, the bin/ directory is off of the root of the distribution. It's simply an array reference. For numerous files, you can simply use basic Perl idioms:
EXE_FILES => [ map "bin/$_", qw(brewbuild bbtester bbdispatch)
+],
Also, I'm in agreement with choroba that during testing/install, you do not want to prompt the user if at all possible. Having a config file available in advance is a good idea (and skip tests if its not there), or have a default config to use in the event the user doesn't supply their own. Here's another Makefile.PL that has some conditionals, including copying a configuration file into place prematurely. Here's an example in a Makefile.PL where I die() if a custom prerequisite isn't met (it's not a config file, but an actual application installation). No tests run, no installation happens, all is good in the world.
if (! grep { -x "$_/sqlite3" } split /:/, $ENV{PATH}) {
die "sqlite3 must be installed to continue\n";
}
In a couple of cases, I go as far as to write a module that I have in the t/ directory that handles config file and database creation amongst other things that I load into certain test files, and use the functions within as-needed on a test-file basis. Example module and here's a test file that uses that module, and a few functions within it (set up config, set up db, remove config and destroy db).
Last, but not least, if you can test and install without this config file, you can simply skip the tests that don't meet the criteria you need for these tests, and again, the world will be ok (replace the env var not set for a missing test config file for example). Tests can be skipped individually (see Test::More) or you can skip the whole test file in its entirety:
if (! $ENV{RPI_SERIAL}){
plan skip_all => "RPI_SERIAL not set; Not running RPI::Serial test
+s\n";
exit;
}
|