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

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

r3705@localhost: bruno | 2010-02-22 01:48:44 +0100

  • Improved pod format for pb.conf.pod
  • man page generated from pod now included in Makefile.PL and packages
  • Move the pod file into the etc conf dir
File size: 2.0 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/Base.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Base.$(MAN3EXT)', },
25);
26
27package MY;
28
29sub postamble {
30
31 # Determine location of etc conf files
32 my $text ="";
33
34 # Grab out any CONFDIR or MANDIR param
35 my $confdir = undef;
36 my $mandir = undef;
37
38 while (my $arg = shift @ARGV) {
39 my ($key, $value) = split /=/, $arg;
40 if ($key =~ /^CONFDIR$/) {
41 $confdir = $value;
42 } elsif ($key =~ /^MANDIR$/) {
43 $mandir = $value;
44 }
45 }
46
47 my $etcdir = $confdir || "/usr/local/etc/pb";
48 my $mandir = $mandir || "/usr/local/share/man";
49
50 # Use that conf dir info to modify Distribution.pm
51 system("perl -pi -e \"s~CCCC~$etcdir~\" lib/ProjectBuilder/Distribution.pm");
52
53 $text .= "install ::\n";
54 $text .= "\t".'mkdir -p $(DESTDIR)'."$etcdir\n";
55 $text .= "\t".'chmod 755 $(DESTDIR)'."$etcdir\n";
56 $text .= "\t".'cp etc/pb.conf $(DESTDIR)'."$etcdir\n";
57
58 # Produce the man page for pb.conf
59 $text .= "\t".'mkdir -p $(DESTDIR)'."$mandir/man5\n";
60 $text .= "\t".'pod2man etc/pb.conf.pod > $(DESTDIR)'."$mandir/man5/pb.conf.5\n";
61 return($text);
62}
Note: See TracBrowser for help on using the repository browser.