summaryrefslogtreecommitdiff
blob: a9c3115f1586f8d99d87b65257867aa94ee5dd56 (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
--- Build.PL.orig	2005-07-19 06:55:12.000000000 -0400
+++ Build.PL	2005-07-19 08:34:47.000000000 -0400
@@ -1,9 +1,30 @@
-use Module::Build;
-use File::Spec::Functions qw( catfile );
+use File::Basename        qw( basename );
+use File::Find            qw( find );
+use File::Spec::Functions qw( catfile catdir );
+use lib File::Spec->catdir('lib');
 
-use lib '.';
+use Module::Build;
 use Generate qw( %GENERATE );
 
+use constant RAW_COMPS    => map(join('.', basename($_, '.m'), 'pm'),
+                                 glob(catfile qw(components *.m)));
+use constant COMPONENTS   =>
+  +{map {catfile('components', join('.',basename($_,'.pm'),'m')) =>
+         catfile(qw(MethodMaker), $_)} RAW_COMPS};
+use constant OPTEXT       => catfile qw( lib Class MethodMaker OptExt.pm );
+
+my %pm;
+find (sub {
+        $File::Find::prune = 1, return
+          if -d $_ and $_ eq 'CVS';
+        return unless /\.pm$/;
+	(my $target = $File::Find::name) =~ s!^$File::Find::topdir/Class/MethodMaker/!!;
+	$target =~ s!^$File::Find::topdir/Class/!!;
+	next if ($target =~ m!/Class!);
+        $pm{$target} = $File::Find::name;
+      },
+      'lib');
+
 my $class = Module::Build->subclass
   (
    class => 'CMM::AutoSplit',
@@ -14,20 +35,20 @@ my $class = Module::Build->subclass
                 # Create blib/arch to keep blib.pm happy
                 my $blib = $self->blib;
                 $self->add_to_cleanup($blib);
-                File::Path::mkpath( File::Spec->catdir($blib, 'arch') );
+                File::Path::mkpath( File::Spec->catdir($blib, 'arch', 'lib') );
 
                 foreach my $element (@{$self->build_elements}) {
                   my $method = "process_${element}_files";
                   $self->$method();
                 }
-                if ( my $autosplit = $self->autosplit ) {
-                  if ( ref $autosplit eq 'ARRAY' ) {
-                    $self->autosplit_file($_, $blib)
-                      for @$autosplit;
-                  } else {
-                    $self->autosplit_file($autosplit, $blib);
-                  }
-                }
+		if ( my $autosplit = $self->autosplit ) {
+		if ( ref $autosplit eq 'ARRAY' ) {
+		$self->autosplit_file($_, $blib)
+		for @$autosplit;
+		} else {
+		$self->autosplit_file($autosplit, $blib);
+		}
+		}
               }
             },
            );
@@ -40,9 +61,10 @@ my $build = $class->new(
                          sign          => 1,
                          dist_author   => 'Martyn J. Pearce <fluffy@cpan.org>',
                          dist_abstract => 'create generic class accessor methods',
-                         PL_files      => +{ 'generate.PL', [ values %GENERATE ] },
-                         autosplit     => [ values %GENERATE,
-                                            catfile(qw(lib Class MethodMaker Engine.pm )) ],
+                         PL_files      => { 'generate.PL', [ values %GENERATE ] },
+			 pm_files      => %pm,
+	   		 autosplit     => [ values %GENERATE,
+	                                    catfile(qw(lib Class MethodMaker Engine.pm )) ],
                          xs_files      => +{ 'MethodMaker.xs' => 'lib/Class/MethodMaker.xs' },
                        );