3 ###APPAUTHOR: xiaoranzzz
4 ###APPDATE: Wed Apr 28 00:34:14 2010
8 ###APPEXAMPLE: epubmake
12 #ENV variable MUST be defined somewhere,
13 #FOR perl to search modules from,
15 use lib
$ENV{XR_PERL_MODULE_DIR
};
17 use MyPlace
::Script
::Usage qw
/help_required help_even_empty/;
18 #exit 0 if(help_required($0,@ARGV));
19 exit 0 if(help_even_empty
($0,@ARGV));
28 $bookname =~ s/^.*[\/\\]//;
29 $bookname =~ s/[\/\\]+$//;
30 chdir $_ or die("$!\n");
31 print STDERR
"$bookname.epub ... \n";
32 if(-f
"$cwd/$bookname.epub") {
33 print STDERR
"Delete $bookname.epub first...\n";
34 unlink "$cwd/$bookname.epub";
36 die("$!\n") unless(system("zip","-rXDq","$cwd/$bookname.epub","mimetype",".")==0);
37 # die("$!\n") unless(system("zip","-rXDv","$cwd/$bookname.epub",".")==0);
38 print STDERR
"\"$cwd/$bookname.epub\" created.\n";
39 chdir $cwd or die("$!\n");
43 print STDERR
"Directory:\"$_\" not exist!\n";