source: ProjectBuilder/devel/pb-modules/Makefile.PL@ 1090

Last change on this file since 1090 was 1090, checked in by Bruno Cornec, 14 years ago

r4004@localhost: bruno | 2010-09-06 00:18:33 +0200

  • Fix #66: Adds log management (contribution from joachim). Starting point, as some more work has to be done around it.
File size: 2.2 KB
Line 
1use 5.006001;
2use ExtUtils::MakeMaker;
3use strict;
4
5# See lib/ExtUtils/MakeMaker.pm for details of how to influence
6# the contents of the Makefile that is written.
7WriteMakefile(
8 NAME => 'PBPKG',
9 DISTNAME => 'PBPKG',
10 VERSION => 'PBVER',
11 INST_SCRIPT => 'blib/bin',
12 INSTALLDIRS => 'perl',
13 PREREQ_PM => {
14 #HTTP::Headers => 1.59,
15 #Template => 0,
16 }, # e.g., Module::Name => 1.1
17 #ABSTRACT_FROM => 'bin/pb', # retrieve abstract from module
18 AUTHOR => 'Bruno Cornec <bruno#project-builder.org>',
19 EXE_FILES => [ qw( bin/pbdistrocheck ) ],
20 MAN1PODS => { 'bin/pbdistrocheck' => '$(INST_MAN1DIR)/pbdistrocheck.$(MAN1EXT)', },
21 MAN3PODS => { 'lib/ProjectBuilder/Distribution.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Distribution.$(MAN3EXT)',
22 'lib/ProjectBuilder/Conf.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Conf.$(MAN3EXT)',
23 'lib/ProjectBuilder/Display.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Display.$(MAN3EXT)',
24 'lib/ProjectBuilder/Log.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Log.$(MAN3EXT)',
25 'lib/ProjectBuilder/Log/Item.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Log::Item.$(MAN3EXT)',
26 'lib/ProjectBuilder/Base.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Base.$(MAN3EXT)', },
27);
28
29package MY;
30
31sub postamble {
32
33 # Determine location of etc conf files
34 my $text ="";
35
36 # Grab out any CONFDIR or MANDIR param
37 my $confdir = undef;
38 my $mandir = undef;
39
40 while (my $arg = shift @ARGV) {
41 my ($key, $value) = split /=/, $arg;
42 if ($key =~ /^CONFDIR$/) {
43 $confdir = $value;
44 } elsif ($key =~ /^MANDIR$/) {
45 $mandir = $value;
46 }
47 }
48
49 my $etcdir = $confdir || "/usr/local/etc/pb";
50 my $mandir = $mandir || "/usr/local/share/man";
51
52 # Use that conf dir info to modify Distribution.pm
53 system("perl -pi -e \"s~CCCC~$etcdir~\" lib/ProjectBuilder/Distribution.pm");
54
55 $text .= "install ::\n";
56 $text .= "\t".'mkdir -p $(DESTDIR)'."$etcdir\n";
57 $text .= "\t".'chmod 755 $(DESTDIR)'."$etcdir\n";
58 $text .= "\t".'cp etc/pb.conf $(DESTDIR)'."$etcdir\n";
59
60 # Produce the man page for pb.conf
61 $text .= "\t".'mkdir -p $(DESTDIR)'."$mandir/man5\n";
62 $text .= "\t".'pod2man --section=5 etc/pb.conf.pod > $(DESTDIR)'."$mandir/man5/pb.conf.5\n";
63 return($text);
64}
Note: See TracBrowser for help on using the repository browser.