[1466] | 1 | use 5.006001;
|
---|
| 2 | use ExtUtils::MakeMaker;
|
---|
| 3 | use strict;
|
---|
| 4 |
|
---|
| 5 | # See lib/ExtUtils/MakeMaker.pm for details of how to influence
|
---|
| 6 | # the contents of the Makefile that is written.
|
---|
| 7 | WriteMakefile(
|
---|
| 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/cb', # retrieve abstract from module
|
---|
| 18 | AUTHOR => 'Bruno Cornec <bruno#project-builder.org>',
|
---|
| 19 | EXE_FILES => [ qw( bin/cbusterize bin/cb ) ],
|
---|
| 20 | MAN1PODS => {
|
---|
| 21 | 'bin/cbusterize' => '$(INST_MAN1DIR)/cbusterize.$(MAN1EXT)',
|
---|
| 22 | 'bin/cb' => '$(INST_MAN1DIR)/cb.$(MAN1EXT)',
|
---|
| 23 | },
|
---|
[1667] | 24 | #MAN3PODS => {
|
---|
| 25 | #'lib/CasparBuster/Env.pm' => '$(INST_MAN3DIR)/CasparBuster::Env.$(MAN3EXT)',
|
---|
| 26 | #'lib/CasparBuster/Version.pm' => '$(INST_MAN3DIR)/CasparBuster::Version.$(MAN3EXT)',
|
---|
| 27 | #},
|
---|
[1466] | 28 | );
|
---|
| 29 |
|
---|
| 30 | package MY;
|
---|
| 31 |
|
---|
| 32 | sub postamble {
|
---|
| 33 |
|
---|
| 34 | # Determine location of etc conf files
|
---|
| 35 | my $text ="";
|
---|
| 36 |
|
---|
| 37 | # Grab out any CONFDIR or MANDIR param
|
---|
| 38 | my $confdir = undef;
|
---|
| 39 | my $mandir = undef;
|
---|
| 40 |
|
---|
| 41 | while (my $arg = shift @ARGV) {
|
---|
| 42 | my ($key, $value) = split /=/, $arg;
|
---|
| 43 | if ($key =~ /^CONFDIR$/) {
|
---|
| 44 | $confdir = $value;
|
---|
| 45 | } elsif ($key =~ /^MANDIR$/) {
|
---|
| 46 | $mandir = $value;
|
---|
| 47 | }
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | my $etcdir = $confdir || "/usr/local/etc/cb";
|
---|
| 51 | my $mandir = $mandir || "/usr/local/share/man";
|
---|
| 52 |
|
---|
| 53 | # Use that conf dir info to modify Distribution.pm
|
---|
| 54 | system("perl -pi -e \"s~CCCC~$etcdir~\" lib/CasparBuster/Env.pm");
|
---|
| 55 |
|
---|
| 56 | $text .= "install ::\n";
|
---|
| 57 | $text .= "\t".'mkdir -p $(DESTDIR)'."$etcdir\n";
|
---|
| 58 | $text .= "\t".'chmod 755 $(DESTDIR)'."$etcdir\n";
|
---|
| 59 | $text .= "\t".'cp etc/cb/cb.conf $(DESTDIR)'."$etcdir\n";
|
---|
[1485] | 60 | $text .= "\t".'chmod 644 $(DESTDIR)'."$etcdir/cb.conf\n";
|
---|
| 61 | $text .= "\t".'cp -r etc/cb/plugins $(DESTDIR)'."$etcdir\n";
|
---|
| 62 | $text .= "\t".'chmod 755 $(DESTDIR)'."$etcdir/plugins\n";
|
---|
| 63 | $text .= "\t".'chmod 644 $(DESTDIR)'."$etcdir/plugins/*\n";
|
---|
[1466] | 64 |
|
---|
| 65 | # Produce the man page for pb.conf
|
---|
| 66 | $text .= "\t".'mkdir -p $(DESTDIR)'."$mandir/man5\n";
|
---|
| 67 | $text .= "\t".'pod2man --section=5 etc/cb/cb.conf > $(DESTDIR)'."$mandir/man5/cb.conf.5\n";
|
---|
| 68 | return($text);
|
---|
| 69 | }
|
---|