-
Notifications
You must be signed in to change notification settings - Fork 51
/
Makefile.PL
46 lines (41 loc) · 1.06 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
use ExtUtils::MakeMaker;
use File::Find;
use File::Spec;
use strict;
# load $CONFIG if it exists
our $CONFIG = {};
eval { require "../config.db" };
# find all files in this directory
my @EXE;
File::Find::find({no_chdir => 1,
wanted => sub {
return if m!/blib/!;
return unless -f and m!bric_\w+$!;
push @EXE, $_;
}},
File::Spec->curdir);
# skip manifying PODs if '!' is given as MAN_DIR
sub MY::manifypods {
if (exists $CONFIG->{MAN_DIR} && $CONFIG->{MAN_DIR} eq '!') {
return '
manifypods:
@$(NOOP)
';
} else {
package MY;
return shift->SUPER::manifypods(@_);
}
}
# Write out the Makefile
WriteMakefile(NAME => 'bric_bin',
EXE_FILES => \@EXE,
( exists $CONFIG->{MODULE_DIR} ?
( INSTALLSITELIB => $CONFIG->{MODULE_DIR} ) :
()),
( exists $CONFIG->{BIN_DIR} ?
( INSTALLSCRIPT => $CONFIG->{BIN_DIR},
INSTALLSITEBIN => $CONFIG->{BIN_DIR} ) :
()),
( exists $CONFIG->{MAN_DIR} ?
( INSTALLMAN1DIR => "$CONFIG->{MAN_DIR}/man1" ) :
()));