4 use ExtUtils::MakeMaker qw(WriteMakefile prompt);
5 use 5.006; # for "no warnings" -- sorry!
6 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
7 # the contents of the Makefile that is written.
14 ## Poor man's optional deps.
20 my $resp = prompt("@_. Install $mod (y/n)? ", 'n');
21 $prereq{$mod} = 0 if $resp =~ /^y/i;
25 test_for 'Devel::Peek', 'Printing internals requires Devel::Peek';
26 test_for 'Devel::Size', 'Printing variable sizes requires Devel::Size';
27 test_for 'IO::Scalar', 'Printing internals requires IO::Scalar because Devel::Peek sucks.';
28 test_for 'Lexical::Persistence', 'Strict mode requires Lexical::Persistence';
29 test_for 'LWP::Simple', 'CPAN documentation browsing requires LWP::Simple';
30 test_for 'Module::CoreList', 'sepia-core-version requires Module::CoreList';
31 test_for 'Module::Info', 'Required for some Emacs functions';
32 test_for 'PadWalker', 'Stack/lexical inspection requires PadWalker >= 1.0';
33 test_for 'BSD::Resource', 'Detailed command timing.';
34 test_for 'Time::HiRes', 'Basic command timing.';
35 # test_for 'Pod::Webserver', 'Pod::Webserver creates nice documentation.';
36 # test_for 'Scope::Upper', 'Required for return-from-context';
38 # try to compile and install Elisp files, but don't die if we can't.
40 my ($sysemacs) = grep { -x $_ } $ENV{EMACS}, glob '/usr/bin{/local,}/emacs';
41 my $emacs = quotemeta prompt("What is your emacs? ", $sysemacs);
42 my @lp = `$emacs --batch --eval '(dolist (x load-path) (princ x) (terpri))' 2>/dev/null`;
44 my ($site_lisp) = grep { /site-lisp$/ && -d $_ } @lp;
45 $site_lisp = prompt("Elisp install directory?", $site_lisp);
49 warn "$site_lisp is not a directory.\n";
52 $site_lisp = quotemeta $site_lisp;
54 # Also try to install texinfo documentation.
55 my $install_info = quotemeta prompt("install-info program?", 'install-info');
56 my $info_dir = `$emacs --batch --eval '(progn (require (quote info)) (princ (car Info-default-directory-list)))' 2>/dev/null`;
58 $info_dir = prompt("Info directory?", $info_dir);
60 warn "Not installing info files.\n";
64 $info_dir = quotemeta $info_dir;
71 \$(CP) sepia.info $info_dir
72 $install_info $info_dir/sepia.info $info_dir/dir
78 \@echo Compiling Elisp files.
79 $emacs -L '$ENV{PWD}' --batch -f batch-byte-compile *.el 2>/dev/null
80 \$(CP) *.el *.elc $site_lisp
85 To actually use this package, you need to move the Emacs Lisp files
86 somewhere Emacs will find them.
88 You may also want to install the HTML documentation somewhere
89 appropriate to your system.
97 VERSION_FROM => 'lib/Sepia.pm', # finds $VERSION
98 PREREQ_PM => \%prereq,
99 EXE_FILES => ['sepl'],
100 AUTHOR => "Sean O'Rourke <seano\@cpan.org>",
101 ABSTRACT => 'Simple Emacs-Perl InterAction',