[283] | 1 | use 5.006001;
|
---|
[33] | 2 | use ExtUtils::MakeMaker;
|
---|
[867] | 3 | use strict;
|
---|
[33] | 4 |
|
---|
| 5 | # See lib/ExtUtils/MakeMaker.pm for details of how to influence
|
---|
| 6 | # the contents of the Makefile that is written.
|
---|
| 7 | WriteMakefile(
|
---|
[867] | 8 | NAME => 'PBPKG',
|
---|
| 9 | DISTNAME => 'PBPKG',
|
---|
| 10 | VERSION => 'PBVER',
|
---|
| 11 | INST_SCRIPT => 'blib/bin',
|
---|
[338] | 12 | INSTALLDIRS => 'perl',
|
---|
[867] | 13 | PREREQ_PM => {
|
---|
[33] | 14 | #HTTP::Headers => 1.59,
|
---|
| 15 | #Template => 0,
|
---|
[867] | 16 | }, # e.g., Module::Name => 1.1
|
---|
[63] | 17 | #ABSTRACT_FROM => 'bin/pb', # retrieve abstract from module
|
---|
[867] | 18 | AUTHOR => 'Bruno Cornec <bruno#project-builder.org>',
|
---|
[402] | 19 | EXE_FILES => [ qw( bin/pbdistrocheck ) ],
|
---|
[396] | 20 | MAN3PODS => { 'lib/ProjectBuilder/Distribution.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Distribution.$(MAN3EXT)',
|
---|
[405] | 21 | 'lib/ProjectBuilder/Conf.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Conf.$(MAN3EXT)',
|
---|
[514] | 22 | 'lib/ProjectBuilder/Display.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Display.$(MAN3EXT)',
|
---|
[396] | 23 | 'lib/ProjectBuilder/Base.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Base.$(MAN3EXT)', },
|
---|
[33] | 24 | );
|
---|
[867] | 25 |
|
---|
| 26 | package MY;
|
---|
| 27 |
|
---|
| 28 | sub postamble {
|
---|
| 29 |
|
---|
| 30 | # Determine location of etc conf files
|
---|
| 31 | my $text ="";
|
---|
| 32 |
|
---|
| 33 | # Grab out any CONFDIR param
|
---|
| 34 | my $confdir = undef;
|
---|
| 35 |
|
---|
| 36 | while (my $arg = shift @ARGV) {
|
---|
| 37 | my ($key, $value) = split /=/, $arg;
|
---|
| 38 | if ($key =~ /^CONFDIR$/) {
|
---|
| 39 | $confdir = $value;
|
---|
| 40 | }
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | my $etcdir = $confdir || "/usr/local/etc/pb";
|
---|
| 44 |
|
---|
| 45 | # Use that conf dir info to modify Distribution.pm
|
---|
| 46 | system("perl -pi -e \"s~CCCC~$etcdir~\" lib/ProjectBuilder/Distribution.pm");
|
---|
| 47 |
|
---|
| 48 | $text .= "install ::\n";
|
---|
[915] | 49 | $text .= "\t".'mkdir -p $(DESTDIR)'."$etcdir\n";
|
---|
| 50 | $text .= "\t".'chmod 755 $(DESTDIR)'."$etcdir\n";
|
---|
[867] | 51 | $text .= "\t".'cp etc/pb.conf $(DESTDIR)'."$etcdir\n";
|
---|
| 52 | return($text);
|
---|
| 53 | }
|
---|