CGI-Uploader

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

use strict;
use warnings;
use inc::Module::Install;

# Module::Install stuff
{
    no_index directory => 't/lib';
    no_index file => 'examples/friends_photos/FriendsPhotos.pm';

    license ('perl');

   # Graphics::Magick is recommended over Image::Magick, but isn't on CPAN
    recommends
        'Image::Magick'    => 0;

   # This could probably become a "test_requires"
   requires 'Image::Size' => 0;


}


use Config ();
use Getopt::Long();
use Data::Dumper ();

my $TESTDB  = "test";

use vars qw($opt);
$opt = {
    "help"    => \&Usage ,
     testdsn  => 'dbi:SQLite:dbname=t/test.db',
};

Getopt::Long::GetOptions($opt, "help", "testdsn=s", "testuser=s","testpassword=s");
my $source = {};

for my $key (qw/testdsn testuser testpassword/) {
  Configure($opt, $source, $key);
}

print <<"MSG";
I will use the following settings for compiling and testing:

MSG

delete $opt->{'help'};
my $keylen = 0;
for my $key (keys %$opt) {
  $keylen = length($key) if length($key) > $keylen;
}
my $slen = 0;
for my $val (values %$source) {
  $slen = length($val) if length($val) > $slen;
}
for my $key (sort { $a cmp $b} keys %$opt) {
  printf("  %-" . $keylen . "s (%-" . $slen . "s) = %s\n",
     $key, $source->{$key}, $opt->{$key})
}

print <<"MSG";

To change these settings, see 'perl Makefile.PL --help'.

MSG

#sleep 5;

eval { require File::Spec };
my $fileName = $@ ?
  "t/cgi-uploader.config" : File::Spec->catfile("t", "cgi-uploader.config");
die "Failed to determine location of $fileName" unless -f $fileName;

if (open(FILE, ">$fileName")) {



( run in 1.735 second using v1.01-cache-2.11-cpan-39bf76dae61 )