use 5.006001; use ExtUtils::MakeMaker; use strict; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( NAME => 'PBPKG', DISTNAME => 'PBPKG', VERSION => 'PBVER', INST_SCRIPT => 'blib/bin', INSTALLDIRS => 'perl', PREREQ_PM => { #HTTP::Headers => 1.59, #Template => 0, }, # e.g., Module::Name => 1.1 #ABSTRACT_FROM => 'bin/pb', # retrieve abstract from module AUTHOR => 'Bruno Cornec ', EXE_FILES => [ qw( bin/pbdistrocheck ) ], MAN3PODS => { 'lib/ProjectBuilder/Distribution.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Distribution.$(MAN3EXT)', 'lib/ProjectBuilder/Conf.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Conf.$(MAN3EXT)', 'lib/ProjectBuilder/Display.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Display.$(MAN3EXT)', 'lib/ProjectBuilder/Base.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Base.$(MAN3EXT)', }, ); package MY; sub postamble { # Determine location of etc conf files my $text =""; # Grab out any CONFDIR param my $confdir = undef; while (my $arg = shift @ARGV) { my ($key, $value) = split /=/, $arg; if ($key =~ /^CONFDIR$/) { $confdir = $value; } } my $etcdir = $confdir || "/usr/local/etc/pb"; # Use that conf dir info to modify Distribution.pm system("perl -pi -e \"s~CCCC~$etcdir~\" lib/ProjectBuilder/Distribution.pm"); $text .= "install ::\n"; $text .= "\t".'install -m 755 -d $(DESTDIR)'."$etcdir\n"; $text .= "\t".'cp etc/pb.conf $(DESTDIR)'."$etcdir\n"; return($text); }