CHANGED: using Makemaker instead of self-written code in Makefile.PL

for installation. No more dependency checks built-in because
                note runs out-of-the-box without additional modules, as a matter fact.
ADDED:          if a search matches exactly on one note it will be displayed
                directly, which avoids typing.
CHANGED:        the main if-else contruct for calling the several subs has
                been replaced by a simple closure call.
CHANGED:        notes will now displayed in a slightly simpler fashion in interactive
                mode, without the separator line between the title and the note.
ADDED:          note can now determine automatically the width and height of
                the terminal window it runs in (in interactive mode only) and
                sets the width/height of what it prints accordingly. the config
                variable "MaxLen" must be set to "auto" (which is the default
                from now on) to get this to work.
ADDED:          any interactive command will now clear the screen before it does
                anything. this look much more uncluttered.
ADDED:          if multiple notes are printed at once (i.e. note 1,2) then the
                separator line between them will no more being printed because
                every notes title is preceded by a line anyway.
CHANGED:        by default the default operation mode is now interactive mode,
                which is somewhat kindlier to new users.
CHANGED:        changed to order which editor note tries to find. vi got now
                higher precedence, because it is likely installed on almost
                any unix system.
CHANGED:        cosmetics.
NOTE:           increased minor version number from 1 to 2 to indicate that
                development begun after 2 1/2 years pause again :-)
This commit is contained in:
TLINDEN
2012-02-10 20:27:05 +01:00
parent 62ede07799
commit 3f3206e506
10 changed files with 1009 additions and 253 deletions

View File

@@ -1,113 +1,7 @@
# does not use ExtUtils::MakeMaker, because
# NOTEDB::mysql and NOTEDB::binary are internals
# of note.
#
# $Id: Makefile.PL,v 1.2 2000/08/10 09:21:56 zarahg Exp $
#
# check for the existence of optional modules:
sub chk_mod
{
my($mod, $msg) = @_;
print "<====\tchecking $mod \t====>\n";
eval {
$mod .= ".pm";
$mod =~ s/::/\//g;
require $mod;
};
if($@) {
print $msg;
}
else {
print " ... installed.\n";
}
print "\n";
}
use ExtUtils::MakeMaker;
&chk_mod(
"Getopt::Long",
"WARNING: Getopt::Long seems not to be installed on your system!\n"
."But it is strongly required in order to run note!\n"
);
&chk_mod(
"DB_File",
"WARNING: DB_File seems not to be installed on your system!\n"
."It is required, if you want to use the DBM backend.\n"
);
&chk_mod(
"DBI",
" WARNING: module DBI is not installed on your system.\n"
." It is required, if you want to use a SQL database with\n"
."note.\n"
);
&chk_mod(
"Crypt::IDEA",
" WARNING: module Crypt::IDEA is not installed on your system.\n"
." It is required, if you want to encrypt your data using IDEA.\n"
);
&chk_mod(
"Crypt::DES",
" WARNING: module Crypt::DES is not installed on your system.\n"
." It is required, if you want to encrypt your data using DES.\n"
);
&chk_mod(
"Crypt::CBC",
" WARNING: module Crypt::CBC is not installed on your system.\n"
." It is required, if you want to encrypt your data using CBC.\n"
);
&chk_mod(
"MD5",
" WARNING: module MD5 is not installed on your system.\n"
." It is required by Crypt::CBC.\n"
);
foreach $dir (@INC) {
if($dir =~ /site_perl/)
{ $LIBDIR = $dir; last; }
}
print "directory, where to install libs [$LIBDIR]: ";
$input = <>;
chomp $input;
$LIBDIR = $input if($input ne "");
$BINDIR = "/usr/local/bin";
print "directory, where to install note [$BINDIR]: ";
$input = <>;
chomp $input;
$BINDIR = $input if($input ne "");
$install = `which install`;
open M, "> Makefile" || die $!;
print M qq~BIN = bin/note
MAN = note.1
LIBS = NOTEDB/mysql.pm NOTEDB/binary.pm NOTEDB/dbm.pm
CORE = NOTEDB.pm
INSTBIN = $BINDIR
INSTLIB = $LIBDIR
INSTMAN = /usr/man/man1
INSTALL = $install
all:
\@echo "done. Type make install.\\n"
install:
\$(INSTALL) -m 755 \$(CORE) \$(INSTLIB)
\$(INSTALL) -d -m 755 \$(INSTLIB)/NOTEDB
\$(INSTALL) -m 755 \$(LIBS) \$(INSTLIB)/NOTEDB
\$(INSTALL) -m 755 \$(BIN) \$(INSTBIN)
\$(INSTALL) -m 644 \$(MAN) \$(INSTMAN)
~;
print "Type \"make install\" to install all files.\n\n";
print "Please note: You may also copy the file \"config/noterc\" to\n"
."your home: \"cp config/noterc ~/.noterc\". Don't forget to edit\n"
."your config-file. Read the README for more informations on this\n"
."topic.\n"
."Thanks for choosing \"note\"! You are helping to keep the \n"
."OpenSource idea alive! Enjoy and tell me, what you think!\n\n";
WriteMakefile(
'NAME' => 'NOTEDB',
'VERSION_FROM' => 'NOTEDB.pm', # finds $VERSION
'EXE_FILES' => [ 'bin/note' ],
);