Sepia

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

END_MAKETXT

    if ( $INFO_DIR ) { $maketxt .= <<"END_MAKETXT" }
	install -d -m755 \$(DESTDIR)$INFO_DIR
	install -m644 sepia.info \$(DESTDIR)$INFO_DIR
	$INSTALL_INFO \$(DESTDIR)$INFO_DIR/sepia.info \$(DESTDIR)$INFO_DIR/dir
	
END_MAKETXT

    if ( $SITE_LISP ) {
        $maketxt .= <<"END_MAKETXT";
	install -d -m755 \$(DESTDIR)$SITE_LISP
	install -m644 *.el \$(DESTDIR)$SITE_LISP
END_MAKETXT
          if ( $EMACS ) {
              $maketxt .= <<"END_MAKETXT";
	install -m644 *.elc \$(DESTDIR)$SITE_LISP
END_MAKETXT
          }
    } else {
        print <<'END_MSG'

======================================================================
To actually use this package, you need to move the Emacs Lisp files
somewhere Emacs will find them.

You may also want to install the HTML documentation somewhere
appropriate to your system.
======================================================================

END_MSG
    }

    # Create a new target for compiled elisp (.elc) files...
    # Allow the compilation to fail (it is prefixed with "-")...
    if ( $EMACS ) {
        $maketxt .= <<"EOS";

\%.elc : \%.el
	- $EMACS -L '$ENV{PWD}' --batch -f batch-byte-compile \$? 2>/dev/null

all :: sepia-snippet.elc sepia.elc sepia-cpan.elc sepia-tree.elc \\
	   sepia-w3m.elc sepia-ido.elc
EOS
    }

    return $maketxt;
}

GetOptions( 'emacs=s' => \$EMACS,
            'lisp=s'  => \$SITE_LISP,
            'info=s'  => \$INFO_DIR,
            'help'    => \$HELP,
           );

exit pod2usage( '-verbose' => 1 ) if $HELP;

test_for 'Devel::Peek', 'Printing internals requires Devel::Peek';
test_for 'Devel::Size', 'Printing variable sizes requires Devel::Size';
test_for 'IO::Scalar', 'Printing internals requires IO::Scalar because Devel::Peek sucks';
test_for 'PadWalker', 'Strict mode requires PadWalker';
test_for 'Devel::LexAlias', 'Strict mode requires Devel::LexAlias';
test_for 'LWP::Simple', 'CPAN documentation browsing requires LWP::Simple';
test_for 'Module::CoreList', 'sepia-core-version requires Module::CoreList';
test_for 'Module::Info', 'Required for some Emacs functions';
test_for 'BSD::Resource', 'Detailed command timing';
test_for 'Time::HiRes', 'Basic command timing';
# test_for 'Pod::Webserver', 'Pod::Webserver creates nice documentation.';
# test_for 'Scope::Upper', 'Required for return-from-context';

$INSTALL_INFO = 'install-info';

if ( !defined $EMACS ) {
    $EMACS = prompt_for_emacs()
      or warn "Disabling elisp compilation and dir detection.\n";
}
$SITE_LISP    ||= prompt_for_sitelisp();
$INFO_DIR     ||= prompt_for_infodir();
$INSTALL_INFO ||= prompt("install-info program?", 'install-info')
    if $INFO_DIR;

WriteMakefile(
    NAME		=> 'Sepia',
    VERSION_FROM	=> 'lib/Sepia.pm', # finds $VERSION
    PREREQ_PM		=> \%prereq,
    EXE_FILES		=> ['sepl'],
    AUTHOR		=> "Sean O'Rourke <seano\@cpan.org>",
    ABSTRACT		=> 'Simple Emacs-Perl InterAction',
    clean           => { FILES => '*.elc' },
);

__END__

=head1 SYNOPSIS

  # prompts for paths
  perl Makefile.PL 
  
  # doesn't prompt for paths
  perl Makefile.PL --emacs /usr/bin/emacs \
      --lisp /usr/share/emacs/site-lisp/sepia \
      --info /usr/share/info

=head1 OPTIONS

=over 4

=item B<--emacs>

Specifies the path to emacs.

=item B<--lisp>

Specifies the directory to install the elisp files to.

=item B<--info>

Specifies the directory to install the texinfo files to.

=item B<--help>



( run in 2.055 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )