From 7f99e446f8a324cdb30e55305adf261f26ed3017 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 11 Apr 2017 00:18:02 +0700 Subject: office/mobiperl: Added (MobiPocket tools). Signed-off-by: Willy Sudiarto Raharjo --- office/mobiperl/README | 19 ++++ office/mobiperl/mobiperl.SlackBuild | 72 +++++++++++++ office/mobiperl/mobiperl.info | 10 ++ office/mobiperl/reduce_dependency_hell.diff | 155 ++++++++++++++++++++++++++++ office/mobiperl/slack-desc | 19 ++++ 5 files changed, 275 insertions(+) create mode 100644 office/mobiperl/README create mode 100644 office/mobiperl/mobiperl.SlackBuild create mode 100644 office/mobiperl/mobiperl.info create mode 100644 office/mobiperl/reduce_dependency_hell.diff create mode 100644 office/mobiperl/slack-desc diff --git a/office/mobiperl/README b/office/mobiperl/README new file mode 100644 index 0000000000..386da22292 --- /dev/null +++ b/office/mobiperl/README @@ -0,0 +1,19 @@ +mobiperl (tools for generating and manipulating MobiPocket files) + +MobiPocket (.mobi) is a file format used by e-book readers on desktop +PCs and platforms such as the Kindle. + +Included tools: + +html2mobi - convert HTML files to .mobi +lit2mobi - convert LIT files to .mobi [1] +mobi2html - convert .mobi files to HTML +mobi2mobi - manipulate metadata in .mobi files +mobils - list contents (metadata) of .mobi files +opf2mobi - convert OPF files to .mobi [2] + +[1] For lit2mobi to work, office/convertlit must be installed. Even then, + it doesn't seem to work particularly well. + +[2] opf2mobi doesn't seem to actually work. If someone manages to fix + it, please let the maintainer know. diff --git a/office/mobiperl/mobiperl.SlackBuild b/office/mobiperl/mobiperl.SlackBuild new file mode 100644 index 0000000000..cc0daf29eb --- /dev/null +++ b/office/mobiperl/mobiperl.SlackBuild @@ -0,0 +1,72 @@ +#!/bin/sh + +# Slackware build script for mobiperl + +# Written by B. Watson (yalhcru@gmail.com) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +PRGNAM=mobiperl +VERSION=${VERSION:-0.0.43} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +ARCH=noarch + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# Get rid of some perl module dependencies, replacing with stuff that's +# shipped with Slackware's perl package. Specifically: +# The obsolete Getopt::Mixed module is replaced by Getopt::Long. +# Date::Format is only used for ctime(), which is replaced by POSIX::ctime(). +# Date::Parse is supposedly required, but is never used (removed it). +# For anyone reading this, no, this didn't break opf2mobi (it was +# already broken). +patch -p1 < $CWD/reduce_dependency_hell.diff + +# lit2mobi calls convertlit by its old name, which might trigger +# stupid content filters. Replace with modern inoffensive name, in +# silly obfuscated way so this script doesn't contain the old name. +# (In case you're wondering, I'm not offended by this, I just don't want +# to get complaints from easily-offended people). +sed -i 's,\,convertlit,g' MobiPerl/Util.pm lit2mobi + +# It's pure Perl code (no shared libs), but not packaged as a perl module. +# We'll install the modules in the standard place for 3rd-party perl modules. +mkdir -p $PKG/usr/share/perl5/vendor_perl +cp -a Palm MobiPerl $PKG/usr/share/perl5/vendor_perl + +mkdir -p $PKG/usr/man/man1 $PKG/usr/bin +EXES="html2mobi lit2mobi mobi2html mobi2mobi opf2mobi mobils" +for exe in $EXES; do + pod2man -c 'SlackBuilds.org' -r $VERSION $exe | gzip -9c > $PKG/usr/man/man1/$exe.1.gz + install -m0755 -oroot -groot $exe $PKG/usr/bin/$exe +done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README *.txt $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/office/mobiperl/mobiperl.info b/office/mobiperl/mobiperl.info new file mode 100644 index 0000000000..594753e38c --- /dev/null +++ b/office/mobiperl/mobiperl.info @@ -0,0 +1,10 @@ +PRGNAM="mobiperl" +VERSION="0.0.43" +HOMEPAGE="http://www.ida.liu.se/~tompe44/mobiperl/" +DOWNLOAD="http://www.ida.liu.se/~tompe44/mobiperl/downloads/mobiperl-0.0.43.tar" +MD5SUM="39a7c5d416ff34e7572881fd35df9368" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="perl-Image-Size perl-GD perl-HTML-Tree perl-palm-pdb perl-image-bmp perl-xml-parser-lite-tree" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" diff --git a/office/mobiperl/reduce_dependency_hell.diff b/office/mobiperl/reduce_dependency_hell.diff new file mode 100644 index 0000000000..440a8707eb --- /dev/null +++ b/office/mobiperl/reduce_dependency_hell.diff @@ -0,0 +1,155 @@ +diff -Naur mobiperl-0.0.43/html2mobi mobiperl-0.0.43.patched/html2mobi +--- mobiperl-0.0.43/html2mobi 2009-07-18 17:52:02.000000000 -0400 ++++ mobiperl-0.0.43.patched/html2mobi 2017-04-10 01:51:43.440363698 -0400 +@@ -24,7 +24,7 @@ + use MobiPerl::LinksInfo; + + use HTML::TreeBuilder; +-use Getopt::Mixed; ++use Getopt::Long; + + use strict; + +@@ -34,12 +34,12 @@ + $opt_imagerescale $opt_removejavascript $opt_scaleallimages + $opt_imagemaxbytes); + +-Getopt::Mixed::getOptions ("title=s author=s htmlfile=s mobifile=s gentoc ++Getopt::Long::GetOptions (qw/title=s author=s htmlfile=s mobifile=s gentoc + coverimage=s addthumbnail=s noimages addcoverlink + prefixtitle=s fixhtml fixhtmlbr keepbr + removejavascript + scaleallimages=s +- imagerescale=s imagemaxbytes=s"); ++ imagerescale=s imagemaxbytes=s/); + + # + # expand html document with links... +diff -Naur mobiperl-0.0.43/lit2mobi mobiperl-0.0.43.patched/lit2mobi +--- mobiperl-0.0.43/lit2mobi 2009-07-18 17:52:02.000000000 -0400 ++++ mobiperl-0.0.43.patched/lit2mobi 2017-04-10 01:51:53.602363787 -0400 +@@ -27,7 +27,7 @@ + use MobiPerl::Config; + use MobiPerl::LinksInfo; + +-use Getopt::Mixed; ++use Getopt::Long; + use File::Copy; + + use vars qw ($opt_title $opt_author $opt_htmlfile $opt_mobifile +@@ -35,10 +35,10 @@ + $opt_tocfirst $opt_addcoverlink + $opt_prefixtitle $opt_fixhtml $opt_fixhtmlbr $opt_imagerescale); + +-Getopt::Mixed::getOptions ("title=s author=s htmlfile=s mobifile=s ++Getopt::Long::GetOptions (qw/title=s author=s htmlfile=s mobifile=s + coverimage=s addthumbnail=s + noimages tocfirst addcoverlink +- prefixtitle=s fixhtml fixhtmlbr imagerescale=s"); ++ prefixtitle=s fixhtml fixhtmlbr imagerescale=s/); + + + +diff -Naur mobiperl-0.0.43/mobi2html mobiperl-0.0.43.patched/mobi2html +--- mobiperl-0.0.43/mobi2html 2009-07-18 17:52:02.000000000 -0400 ++++ mobiperl-0.0.43.patched/mobi2html 2017-04-10 01:52:02.969363870 -0400 +@@ -28,9 +28,8 @@ + use Palm::PDB; + use Palm::Doc; + use Image::Size; +-use Date::Parse; +-use Date::Format; +-use Getopt::Mixed; ++use POSIX q/ctime/; ++use Getopt::Long; + + use MobiPerl::EXTH; + +@@ -38,7 +37,7 @@ + + use vars qw ($opt_rawhtml $opt_record0 $opt_saveallrecords $opt_mobihtml); + +-Getopt::Mixed::getOptions ("rawhtml record0 saveallrecords mobihtml"); ++Getopt::Long::GetOptions (qw/rawhtml record0 saveallrecords mobihtml/); + + my $globalcodepage = 0; + my $fullpathfilename = shift; +diff -Naur mobiperl-0.0.43/mobi2mobi mobiperl-0.0.43.patched/mobi2mobi +--- mobiperl-0.0.43/mobi2mobi 2009-07-18 17:52:02.000000000 -0400 ++++ mobiperl-0.0.43.patched/mobi2mobi 2017-04-10 01:52:15.693363982 -0400 +@@ -36,8 +36,8 @@ + + use Palm::PDB; + use Palm::Doc; +-use Date::Format; # for ctime call +-use Getopt::Mixed; ++use POSIX q/ctime/; ++use Getopt::Long; + use Image::Size; # Used to recognize the first record that is an image + + # +@@ -67,7 +67,7 @@ + $opt_imagerescale + $opt_allowtts $opt_deleteclippinglimit $opt_imagemaxbytes); + +-Getopt::Mixed::getOptions ("outfile=s title=s updatedtitle=s ++Getopt::Long::GetOptions (qw/outfile=s title=s updatedtitle=s + prefixtitle=s author=s addauthor=s + description=s language=s subject=s + publisher=s databasename=s patch fiximagesizes +@@ -78,7 +78,7 @@ + mbpfile=s savecover=s savethumb=s imagerescale=s + allowtts deleteclippinglimit + imagemaxbytes=s +- "); ++ /); + + if (not defined $opt_outfile) { + if (defined $opt_title or defined $opt_updatedtitle or +diff -Naur mobiperl-0.0.43/mobils mobiperl-0.0.43.patched/mobils +--- mobiperl-0.0.43/mobils 2009-07-18 17:52:02.000000000 -0400 ++++ mobiperl-0.0.43.patched/mobils 2017-04-10 01:43:39.062359426 -0400 +@@ -23,8 +23,8 @@ + + use Palm::PDB; + use Palm::Doc; +-use Date::Format; # for ctime call +-use Getopt::Mixed; ++use POSIX q/ctime/; ++use Getopt::Long; + + use MobiPerl::MobiHeader; # The MobiHeader package file is in the distribution + use MobiPerl::Util; +@@ -33,7 +33,7 @@ + + use vars qw ($opt_R); + +-Getopt::Mixed::getOptions ("R"); ++Getopt::Long::GetOptions ("R"); + + my $author = ""; + my $publisher = ""; +diff -Naur mobiperl-0.0.43/opf2mobi mobiperl-0.0.43.patched/opf2mobi +--- mobiperl-0.0.43/opf2mobi 2009-07-18 17:52:02.000000000 -0400 ++++ mobiperl-0.0.43.patched/opf2mobi 2017-04-10 01:52:30.947364117 -0400 +@@ -27,7 +27,7 @@ + use MobiPerl::Config; + use MobiPerl::LinksInfo; + +-use Getopt::Mixed; ++use Getopt::Long; + use File::Copy; + use File::Spec; + +@@ -39,9 +39,9 @@ + $opt_tocfirst $opt_addcoverlink + $opt_prefixtitle $opt_imagerescale $opt_imagemaxbytes); + +-Getopt::Mixed::getOptions ("title=s author=s htmlfile=s mobifile=s ++Getopt::Long::GetOptions (qw/title=s author=s htmlfile=s mobifile=s + coverimage=s noimages tocfirst addcoverlink +- prefixtitle=s imagerescale=s imagemaxbytes=s"); ++ prefixtitle=s imagerescale=s imagemaxbytes=s/); + + + diff --git a/office/mobiperl/slack-desc b/office/mobiperl/slack-desc new file mode 100644 index 0000000000..ecd438de4e --- /dev/null +++ b/office/mobiperl/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +mobiperl: mobiperl (tools for generating and manipulating MobiPocket files) +mobiperl: +mobiperl: MobiPocket (.mobi) is a file format used by e-book readers on desktop +mobiperl: PCs and platforms such as the Kindle. +mobiperl: +mobiperl: Included tools: +mobiperl: html2mobi lit2mobi mobi2html mobi2mobi opf2mobi mobils +mobiperl: +mobiperl: +mobiperl: +mobiperl: -- cgit v1.2.3