source: perl/lib/Module/Install/BarnOwl.pm

release-1.10
Last change on this file was e4b8f93, checked in by Anders Kaseorg <andersk@mit.edu>, 11 years ago
Really support building Perl modules from a separate builddir Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Property mode set to 100644
File size: 1.2 KB
Line 
1use warnings;
2use strict;
3
4=head1 NAME
5
6Module::Install::BarnOwl
7
8=head1 DESCRIPTION
9
10Module::Install::BarnOwl is a M::I module to help building BarnOwl
11modules,
12
13=head1 SYNOPSIS
14
15    use inc::Module::Install;
16    barnowl_module('Jabber');
17    WriteAll;
18
19This is roughly equivalent to:
20
21    use inc::Module::Install;
22
23    name('BarnOwl-Module-Jabber');
24    all_from('lib/BarnOwl/Module/Jabber.pm');
25    requires_external_bin('barnowl');
26
27    WriteAll;
28
29As well as make rules to generate Jabber.par, and to put some
30additional BarnOwl-specific information into META.yml
31
32=cut
33
34package Module::Install::BarnOwl;
35
36use base qw(Module::Install::Base);
37
38sub barnowl_module {
39    my $self = shift;
40    my $name = ucfirst shift;
41    my $class = ref $self;
42
43    my $srcdir = $ENV{BARNOWL_SRCDIR} || '.';
44
45    $self->name("BarnOwl-Module-$name");
46    $self->all_from("$srcdir/lib/BarnOwl/Module/$name.pm");
47    $self->makemaker_args(PMLIBDIRS => ["$srcdir/lib"],
48                          PMLIBPARENTDIRS => ["$srcdir/lib"]);
49
50    $self->postamble(<<"END_MAKEFILE");
51
52# --- $class section:
53
54BARNOWL_SRCDIR = $srcdir
55export BARNOWL_SRCDIR
56
57$name.par: pm_to_blib
58\tcd blib; zip -q ../$name.par -r arch lib
59
60END_MAKEFILE
61}
62
63=head1 SEE ALSO
64
65L<Module::Install>, L<BarnOwl>
66
67=cut
68
691;
Note: See TracBrowser for help on using the repository browser.