source: ProjectBuilder/0.12.1/pb-modules/Makefile.PL

Last change on this file was 1528, checked in by Bruno Cornec, 12 years ago
  • Add Copyrights specified by HP Open Source Review Board (Eric Anderson)
  • Clarification of copyrights, dates and licences (Bruno Cornec)
File size: 2.5 KB
Line 
1# (c) B.Cornec 2007-2012
2# Eric Anderson's changes are (c) Copyright 2012 Hewlett Packard
3# Provided under the GPL v2
4use 5.006001;
5use ExtUtils::MakeMaker;
6use strict;
7
8# See lib/ExtUtils/MakeMaker.pm for details of how to influence
9# the contents of the Makefile that is written.
10WriteMakefile(
11 NAME => 'PBPKG',
12 DISTNAME => 'PBPKG',
13 VERSION => 'PBVER',
14 INST_SCRIPT => 'blib/bin',
15 INSTALLDIRS => 'perl',
16 PREREQ_PM => {
17 #HTTP::Headers => 1.59,
18 #Template => 0,
19 }, # e.g., Module::Name => 1.1
20 #ABSTRACT_FROM => 'bin/pb', # retrieve abstract from module
21 AUTHOR => 'Bruno Cornec <bruno#project-builder.org>',
22 EXE_FILES => [ qw( bin/pbdistrocheck ) ],
23 MAN1PODS => { 'bin/pbdistrocheck' => '$(INST_MAN1DIR)/pbdistrocheck.$(MAN1EXT)', },
24# MAN3PODS => { 'lib/ProjectBuilder/Distribution.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Distribution.$(MAN3EXT)',
25 #'lib/ProjectBuilder/Conf.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Conf.$(MAN3EXT)',
26 #'lib/ProjectBuilder/Display.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Display.$(MAN3EXT)',
27 #'lib/ProjectBuilder/Log.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Log.$(MAN3EXT)',
28 #'lib/ProjectBuilder/Log/Item.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Log::Item.$(MAN3EXT)',
29 #'lib/ProjectBuilder/Base.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Base.$(MAN3EXT)', },
30);
31
32package MY;
33
34sub postamble {
35
36 # Determine location of etc conf files
37 my $text ="";
38
39 # Grab out any CONFDIR or MANDIR param
40 my $etcdir = undef;
41 my $mandir = undef;
42 my $prefix = undef;
43
44 while (my $arg = shift @ARGV) {
45 my ($key, $value) = split /=/, $arg;
46 if ($key =~ /^CONFDIR$/) {
47 $etcdir = $value;
48 } elsif ($key =~ /^MANDIR$/) {
49 $mandir = $value;
50 } elsif ($key =~ /^PREFIX$/) {
51 $prefix = $value;
52 }
53 }
54
55 $etcdir ||= "$prefix/etc/pb" if (defined $prefix);
56 $mandir ||= "$prefix/share/man" if (defined $prefix);
57 $etcdir ||= "/usr/local/etc/pb";
58 $mandir ||= "/usr/local/share/man";
59
60 # Use that conf dir info to modify Distribution.pm
61 system("perl -pi -e \"s~CCCC~$etcdir~\" lib/ProjectBuilder/Distribution.pm");
62
63 $text .= "install ::\n";
64 $text .= "\t".'mkdir -p $(DESTDIR)'."$etcdir\n";
65 $text .= "\t".'chmod 755 $(DESTDIR)'."$etcdir\n";
66 $text .= "\t".'cp etc/pb.conf $(DESTDIR)'."$etcdir\n";
67
68 # Produce the man page for pb.conf
69 $text .= "\t".'mkdir -p $(DESTDIR)'."$mandir/man5\n";
70 $text .= "\t".'pod2man --section=5 etc/pb.conf.pod > $(DESTDIR)'."$mandir/man5/pb.conf.5\n";
71 return($text);
72}
Note: See TracBrowser for help on using the repository browser.