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

Last change on this file since 2032 was 2032, checked in by Bruno Cornec, 8 years ago
  • Copyright update for 2016
File size: 2.6 KB
Line 
1# (c) B.Cornec 2007-2016
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 bin/pbgetparam) ],
23 MAN1PODS => {
24 'bin/pbdistrocheck' => '$(INST_MAN1DIR)/pbdistrocheck.$(MAN1EXT)',
25 'bin/pbgetparam' => '$(INST_MAN1DIR)/pbgetparam.$(MAN1EXT)',
26 },
27# MAN3PODS => { 'lib/ProjectBuilder/Distribution.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Distribution.$(MAN3EXT)',
28 #'lib/ProjectBuilder/Conf.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Conf.$(MAN3EXT)',
29 #'lib/ProjectBuilder/Display.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Display.$(MAN3EXT)',
30 #'lib/ProjectBuilder/Log.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Log.$(MAN3EXT)',
31 #'lib/ProjectBuilder/Log/Item.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Log::Item.$(MAN3EXT)',
32 #'lib/ProjectBuilder/Base.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Base.$(MAN3EXT)', },
33);
34
35package MY;
36
37sub postamble {
38
39 # Determine location of etc conf files
40 my $text ="";
41
42 # Grab out any CONFDIR or MANDIR param
43 my $etcdir = undef;
44 my $mandir = undef;
45 my $prefix = undef;
46
47 while (my $arg = shift @ARGV) {
48 my ($key, $value) = split /=/, $arg;
49 if ($key =~ /^CONFDIR$/) {
50 $etcdir = $value;
51 } elsif ($key =~ /^MANDIR$/) {
52 $mandir = $value;
53 } elsif ($key =~ /^PREFIX$/) {
54 $prefix = $value;
55 }
56 }
57
58 $etcdir ||= "$prefix/etc/pb" if (defined $prefix);
59 $mandir ||= "$prefix/share/man" if (defined $prefix);
60 $etcdir ||= "/usr/local/etc/pb";
61 $mandir ||= "/usr/local/share/man";
62
63 # Use that conf dir info to modify Distribution.pm
64 system("perl -pi -e \"s~CCCC~$etcdir~\" lib/ProjectBuilder/Distribution.pm");
65
66 $text .= "install ::\n";
67 $text .= "\t".'mkdir -p $(DESTDIR)'."$etcdir\n";
68 $text .= "\t".'chmod 755 $(DESTDIR)'."$etcdir\n";
69 $text .= "\t".'cp etc/pb.conf $(DESTDIR)'."$etcdir\n";
70
71 # Produce the man page for pb.conf
72 $text .= "\t".'mkdir -p $(DESTDIR)'."$mandir/man5\n";
73 $text .= "\t".'pod2man --section=5 etc/pb.conf.pod > $(DESTDIR)'."$mandir/man5/pb.conf.5\n";
74 return($text);
75}
Note: See TracBrowser for help on using the repository browser.