diff -Nru libebook-tools-perl-0.4.8/Changes libebook-tools-perl-0.4.9/Changes --- libebook-tools-perl-0.4.8/Changes 2010-03-08 20:55:20.000000000 +0000 +++ libebook-tools-perl-0.4.9/Changes 2011-12-15 17:32:30.000000000 +0000 @@ -1,6 +1,11 @@ Release Notes ============= +0.4.9 + New Features: + * 'ebook unpack' now automatically handles ePub files (or to be more + specific, any zip file) + 0.4.8 Bug fixes: diff -Nru libebook-tools-perl-0.4.8/debian/changelog libebook-tools-perl-0.4.9/debian/changelog --- libebook-tools-perl-0.4.8/debian/changelog 2012-01-22 04:16:01.000000000 +0000 +++ libebook-tools-perl-0.4.9/debian/changelog 2012-01-22 04:16:02.000000000 +0000 @@ -1,3 +1,12 @@ +libebook-tools-perl (0.4.9-1) unstable; urgency=low + + * New upstream version: + * ebook unpack now unpacks .epub (or .zip) files + * MMDDYYYY-unparseable test removed (closes: 642163) + * Standards-Version 3.9.2 + + -- Zed Pobre Thu, 15 Dec 2011 12:28:19 -0500 + libebook-tools-perl (0.4.8-1) unstable; urgency=low * New upstream version: diff -Nru libebook-tools-perl-0.4.8/debian/control libebook-tools-perl-0.4.9/debian/control --- libebook-tools-perl-0.4.8/debian/control 2012-01-22 04:16:01.000000000 +0000 +++ libebook-tools-perl-0.4.9/debian/control 2012-01-22 04:16:02.000000000 +0000 @@ -3,7 +3,7 @@ Priority: optional Maintainer: Zed Pobre Build-Depends: cdbs, debhelper (>= 6), perl (>= 5.8.8), perl (>= 5.10.1) | libmodule-build-perl (>= 0.3000), libarchive-zip-perl, libbit-vector-perl, libconfig-inifiles-perl, libdate-manip-perl, libfile-mimeinfo-perl, libfile-slurp-perl, libhtml-parser-perl, libimage-size-perl, liblist-moreutils-perl, libossp-uuid-perl, libpalm-perl, libstring-crc32-perl, libtie-ixhash-perl, libtime-local-perl, libxml-twig-perl, txt2html -Standards-Version: 3.8.4 +Standards-Version: 3.9.2 Homepage: http://search.cpan.org/dist/EBook-Tools/ Vcs-Git: git://github.com/AZed/ebook-tools.git diff -Nru libebook-tools-perl-0.4.8/lib/EBook/Tools/Mobipocket.pm libebook-tools-perl-0.4.9/lib/EBook/Tools/Mobipocket.pm --- libebook-tools-perl-0.4.8/lib/EBook/Tools/Mobipocket.pm 2010-03-08 20:55:20.000000000 +0000 +++ libebook-tools-perl-0.4.9/lib/EBook/Tools/Mobipocket.pm 2011-12-15 17:32:30.000000000 +0000 @@ -1636,24 +1636,29 @@ if($OSNAME eq 'MSWin32') { @mobigen_guesses = ( + 'kindlegen', 'mobigen', + 'C:\Program Files\Mobipocket.com\kindlegen', 'C:\Program Files\Mobipocket.com\mobigen', ); if($confdir) { push(@mobigen_guesses, + $confdir . '\kindlegen', $confdir . '\mobigen'); } } else { @mobigen_guesses = ( + 'kindlegen', 'mobigen', 'mobigen_linux', ); if($confdir) { push(@mobigen_guesses, + $confdir . "/kindlegen", $confdir . "/mobigen_linux", $confdir . "/mobigen"); } diff -Nru libebook-tools-perl-0.4.8/lib/EBook/Tools/Unpack.pm libebook-tools-perl-0.4.9/lib/EBook/Tools/Unpack.pm --- libebook-tools-perl-0.4.8/lib/EBook/Tools/Unpack.pm 2010-03-08 20:55:20.000000000 +0000 +++ libebook-tools-perl-0.4.9/lib/EBook/Tools/Unpack.pm 2011-12-15 17:32:30.000000000 +0000 @@ -1,7 +1,7 @@ package EBook::Tools::Unpack; use warnings; use strict; use utf8; use English qw( -no_match_vars ); -use version 0.74; our $VERSION = qv("0.4.8"); +use version 0.74; our $VERSION = qv("0.4.9"); # Perl Critic overrides: ## no critic (Package variable) @@ -48,6 +48,7 @@ @EXPORT_OK = qw ( ); +use Archive::Zip qw(:ERROR_CODES); use Carp; use EBook::Tools qw(:all); use EBook::Tools::EReader qw(:all); @@ -807,6 +808,7 @@ 'msreader' => \&unpack_msreader, 'palmdoc' => \&unpack_palmdoc, 'aportisdoc' => \&unpack_palmdoc, + 'ziparchive' => \&unpack_zip, ); croak($subname, @@ -1073,6 +1075,39 @@ } +=head2 C + +Unpacks Zip archives (including ePub files). + +=cut + +sub unpack_zip :method +{ + my $self = shift; + my $subname = ( caller(0) )[3]; + debug(2,"DEBUG[",$subname,"]"); + + unless($self->{nosave}) + { + my $cwd = usedir($self->{dir}); + my $zip = Archive::Zip->new(); + my $status = $zip->read($cwd.'/'.$self->{file}); + if ($status != AZ_OK) + { + croak($subname,'(): error while parsing zip file "',$self->{file},'" (',$status,')!'); + } + + $status = $zip->extractTree(undef); + if ($status != AZ_OK) + { + croak($subname,'(): error while extracting zip file "',$self->{file},'" (',$status,')!'); + } + chdir($cwd); + } + return 1; +} + + ########## PROCEDURES ########## # No procedures diff -Nru libebook-tools-perl-0.4.8/lib/EBook/Tools.pm libebook-tools-perl-0.4.9/lib/EBook/Tools.pm --- libebook-tools-perl-0.4.8/lib/EBook/Tools.pm 2010-03-08 20:55:20.000000000 +0000 +++ libebook-tools-perl-0.4.9/lib/EBook/Tools.pm 2011-12-15 17:32:30.000000000 +0000 @@ -3,7 +3,7 @@ #use 5.010; # Needed for smart-match operator #v5.10 feature use removed until 5.10 is standard on MacOSX and Debian use English qw( -no_match_vars ); -use version 0.74; our $VERSION = qv("0.4.8"); +use version 0.74; our $VERSION = qv("0.4.9"); #use warnings::unused; diff -Nru libebook-tools-perl-0.4.8/Makefile.PL libebook-tools-perl-0.4.9/Makefile.PL --- libebook-tools-perl-0.4.8/Makefile.PL 2010-03-08 20:55:20.000000000 +0000 +++ libebook-tools-perl-0.4.9/Makefile.PL 2011-12-15 17:32:30.000000000 +0000 @@ -1,5 +1,5 @@ -# Note: this file was auto-generated by Module::Build::Compat version 0.30 -require 5.8.8; +# Note: this file was auto-generated by Module::Build::Compat version 0.3607 +require 5.008008; use Module::Build::Compat 0.02; Module::Build::Compat->run_build_pl(args => \@ARGV); diff -Nru libebook-tools-perl-0.4.8/META.yml libebook-tools-perl-0.4.9/META.yml --- libebook-tools-perl-0.4.8/META.yml 2010-03-08 20:55:20.000000000 +0000 +++ libebook-tools-perl-0.4.9/META.yml 2011-12-15 17:32:30.000000000 +0000 @@ -1,12 +1,40 @@ --- -name: EBook-Tools -version: 0.4.8 +abstract: 'Object class for manipulating and generating E-books' author: - 'Zed Pobre ' -abstract: Object class for manipulating and generating E-books +configure_requires: + Module::Build: 0.36 +generated_by: 'Module::Build version 0.3607' license: gpl2 -resources: - license: http://opensource.org/licenses/gpl-2.0.php +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: EBook-Tools +provides: + EBook::Tools: + file: lib/EBook/Tools.pm + version: v0.4.9 + EBook::Tools::EReader: + file: lib/EBook/Tools/EReader.pm + version: v0.4.8 + EBook::Tools::IMP: + file: lib/EBook/Tools/IMP.pm + version: v0.4.8 + EBook::Tools::LZSS: + file: lib/EBook/Tools/LZSS.pm + version: v0.4.8 + EBook::Tools::MSReader: + file: lib/EBook/Tools/MSReader.pm + version: v0.4.8 + EBook::Tools::Mobipocket: + file: lib/EBook/Tools/Mobipocket.pm + version: v0.4.8 + EBook::Tools::PalmDoc: + file: lib/EBook/Tools/PalmDoc.pm + version: v0.4.8 + EBook::Tools::Unpack: + file: lib/EBook/Tools/Unpack.pm + version: v0.4.9 requires: Archive::Zip: 1.16 Bit::Vector: 6.4 @@ -27,34 +55,8 @@ Tie::IxHash: 1.21 Time::Local: 1.18 XML::Twig: 3.32 - perl: 5.8.8 + perl: v5.8.8 version: 0.74 -provides: - EBook::Tools: - file: lib/EBook/Tools.pm - version: 0.4.8 - EBook::Tools::EReader: - file: lib/EBook/Tools/EReader.pm - version: 0.4.8 - EBook::Tools::IMP: - file: lib/EBook/Tools/IMP.pm - version: 0.4.8 - EBook::Tools::LZSS: - file: lib/EBook/Tools/LZSS.pm - version: 0.4.8 - EBook::Tools::MSReader: - file: lib/EBook/Tools/MSReader.pm - version: 0.4.8 - EBook::Tools::Mobipocket: - file: lib/EBook/Tools/Mobipocket.pm - version: 0.4.8 - EBook::Tools::PalmDoc: - file: lib/EBook/Tools/PalmDoc.pm - version: 0.4.8 - EBook::Tools::Unpack: - file: lib/EBook/Tools/Unpack.pm - version: 0.4.8 -generated_by: Module::Build version 0.3 -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.2.html - version: 1.2 +resources: + license: http://opensource.org/licenses/gpl-2.0.php +version: v0.4.9 diff -Nru libebook-tools-perl-0.4.8/README.Helpers.txt libebook-tools-perl-0.4.9/README.Helpers.txt --- libebook-tools-perl-0.4.8/README.Helpers.txt 2010-03-08 20:55:20.000000000 +0000 +++ libebook-tools-perl-0.4.9/README.Helpers.txt 2011-12-15 17:32:30.000000000 +0000 @@ -31,6 +31,21 @@ http://dukelupus.pri.ee/convertlit.php +========= +Kindlegen +========= + +Kindlegen is the replacement for Mobigen, a command-line executable +originally provided by Mobipocket and now by Amazon for creating +Mobipocket .mobi/.prc files. + +It is made available from Amazon Kindle's Publishing Program page at: + +http://www.amazon.com/gp/feature.html?docId=1000234621 + +The old mobigen executable (see below) will still be found, but using +Kindlegen is recommended. + ========= MobiDeDRM @@ -55,9 +70,11 @@ Mobigen ======= -Mobigen is a command-line executable provided by Mobipocket for -creating Mobipocket .mobi/.prc files as an alternative to their GUI -for doing the same. +Mobigen is an obsolete command-line executable provided by Mobipocket +for creating Mobipocket .mobi/.prc files as an alternative to their +GUI for doing the same. Use of Kindlegen (see above) in its place is +strongly recommended, as Mobigen is known to produce incorrect results +when given Unicode text. It is made available from the Mobipocket Developer Center at: diff -Nru libebook-tools-perl-0.4.8/t/10-fix_datestring.t libebook-tools-perl-0.4.9/t/10-fix_datestring.t --- libebook-tools-perl-0.4.8/t/10-fix_datestring.t 2010-03-08 20:55:20.000000000 +0000 +++ libebook-tools-perl-0.4.9/t/10-fix_datestring.t 2011-12-15 17:32:30.000000000 +0000 @@ -5,7 +5,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; -use Test::More tests => 20; +use Test::More tests => 19; BEGIN { use_ok('EBook::Tools',qw(fix_datestring)) }; ######################### @@ -20,7 +20,6 @@ is(fix_datestring('2001'),'2001', 'YYYY'); is(fix_datestring('20010501'),'2001-05-01', 'YYYYMMDD'); is(fix_datestring('12151112'),'1215-11-12', 'YYYYMMDD-ambiguous'); -is(fix_datestring('12082001'),undef, 'MMDDYYYY-unparseable'); # This entry fails for an unknown reason on amd64 # Since it's really a Date::Manip failure, I'm just giving up on testing for it.