-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.PL
68 lines (62 loc) · 1.66 KB
/
Makefile.PL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
use strict;
use warnings;
use ExtUtils::MakeMaker;
use File::Copy;
use File::Find;
my $perl_ns = "perl";
my $suffix = "";
if (defined $ENV{'PERL_NS'} && $ENV{'PERL_NS'} !~ /^$/) {
$perl_ns = $ENV{'PERL_NS'} . "-" . $perl_ns;
$suffix = "." . $ENV{'PERL_NS'};
}
my @directories_to_search = ("template");
File::Find::find({
wanted => \&wanted,
untaint => 1,
no_chdir => 1,
}, @directories_to_search);
sub wanted {
my $tmpl = $File::Find::name;
my $dir = $File::Find::dir;
if ( -f $tmpl) {
my $file = $tmpl;
$file =~ s/template\///;
$dir =~ s/template\///;
system("mkdir $dir") if (! -d $dir);
$file = $file.$suffix if ($file =~ m/bin/);
copy("$tmpl", "$file") or die "Copy failed: $!";
system("sed -i 's/__PERL_NS__/$perl_ns/' $file");
system("sed -i 's/__PERL_SUFFIX__/$suffix/' $file");
system("chmod 755 $file") if ($file =~ m/bin/);
}
}
WriteMakefile(
'NAME' => 'generators',
'VERSION' => '1.16',
'AUTHOR' => 'Jitka Plesnikova <[email protected]>',
'LICENSE' => 'gpl',
'EXE_FILES' => [ "bin/perl.prov$suffix", "bin/perl.req$suffix" ],
'BUILD_REQUIRES' => {
},
'PREREQ_PM' => {
'Fedora::VSP' => 0,
'version' => 0,
},
TEST_REQUIRES => {
'Test::More' => 0,
'strict' => 0,
'warnings' => 0,
},
'CONFIGURE_REQUIRES' => {
'ExtUtils::MakeMaker' => 0,
},
'META_MERGE' => {
'resources' => {
'homepage' =>
'http://jplesnik.fedorapeople.org/generators/',
},
},
'test' => {
'TESTS' => 't/*.t',
},
);