diff options
author | B. Watson <yalhcru@gmail.com> | 2013-02-24 00:00:42 -0600 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2013-02-24 10:23:08 -0600 |
commit | 793c216f2415d34ea2a90272214a5d2834982b6a (patch) | |
tree | 4fc9a648b7ecd7f1e5accf7ba8ab83633109f708 /office/convertlit | |
parent | 7be70a967816ac12e5fcaca57e64941fc154416a (diff) |
office/convertlit: Added (converts .lit files to .epub)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'office/convertlit')
-rw-r--r-- | office/convertlit/README | 11 | ||||
-rw-r--r-- | office/convertlit/convertlit.1 | 54 | ||||
-rw-r--r-- | office/convertlit/convertlit.SlackBuild | 96 | ||||
-rw-r--r-- | office/convertlit/convertlit.info | 10 | ||||
-rw-r--r-- | office/convertlit/lit2epub | 71 | ||||
-rw-r--r-- | office/convertlit/slack-desc | 19 |
6 files changed, 261 insertions, 0 deletions
diff --git a/office/convertlit/README b/office/convertlit/README new file mode 100644 index 0000000000000..253ec54f2d4d2 --- /dev/null +++ b/office/convertlit/README @@ -0,0 +1,11 @@ +convertlit (converts .lit files to Open E-Book format .epub format) + +Converts Microsoft Reader format eBooks into open format for use with +software or devices which are not directly compatible with Microsoft's +Reader. + +Note that convertlit's output is a directory with the epub contents. The +output is HTML, and can be viewed with any browser. To actually make +an .epub file, the output dir needs to be zipped. This build includes a +wrapper script called lit2epub that does the conversion and zipping in +one go. diff --git a/office/convertlit/convertlit.1 b/office/convertlit/convertlit.1 new file mode 100644 index 0000000000000..c748228719db5 --- /dev/null +++ b/office/convertlit/convertlit.1 @@ -0,0 +1,54 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH CONVERTLIT 1 "Feb 20, 2013" +.\" Please adjust this date whenever revising the manpage. +.\" +.SH NAME +convertlit \- program to manipulate Microsoft Reader .LIT files +.SH SYNOPSIS +.RB "1. " convertlit +.RI [ options ] " litfile.lit" " " subdir/ +.br +.RB "2. " convertlit +.RI [ options ] " oldfile.lit" " " newfile.lit +.br +.RB "3. " convertlit +.RI [ options ] " oldfile.lit" " " newfile.lit " " inscription +.SH DESCRIPTION +This manual page documents briefly the \fBconvertlit\fP command. +.PP +\fBconvertlit\fP is a program to convert Microsoft Reader format eBooks +[\fILIT\fP] into an open format. \fBconvertlit\fP supports three modes +of operation: +.IP 1. +\fBExplosion\fP: expanding a \fILIT\fP file into an OEBPS compliant package, +that is the original \fIXML\fP / \fIHTML\fP source. +.IP 2. +\fBDownconverting\fP: converts to \fIDRM1\fP format, also known as +\fBsealing\fP the \fILIT\fP file. +.IP 3. +\fBInscribing\fP: similar to #2, this adds a label, or \fIinscription\fP, +to the ebook to mark that it belongs to you. +.SH OPTIONS +A summary of options is included below. +For a complete description, run the program without any arguments. +.TP +.B \-d +Disable creating multiple subdirectories. +.TP +.B \-h +Show summary of options. +.TP +.B \-k " " \fI/path/to/keys.txt\fP +The \fIDRM5\fP key file is assumed to be called \fIkeys.txt\fP and located in +the current directory. If not, use this option to instruct \fBconvertlit\fP +where to find the key file. +.SH AUTHOR +\fBconvertlit\fP was written by Dan A. Jackson <drs@convertlit.com>. +.PP +This manual page was written by Joe Nahmias <jello@debian.org>, +for the Debian project (but may be used by others). It was modified +slightly by B. Watson <yalhcru@gmail.com> for use with the SlackBuild.org +project. diff --git a/office/convertlit/convertlit.SlackBuild b/office/convertlit/convertlit.SlackBuild new file mode 100644 index 0000000000000..e6774bf58bd03 --- /dev/null +++ b/office/convertlit/convertlit.SlackBuild @@ -0,0 +1,96 @@ +#!/bin/bash + +# Slackware build script for convertlit + +# Written by B. Watson (yalhcru@gmail.com) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# The original name of this program was also a term for a part of female +# anatomy, not usually considered polite in mixed company. Upstream changed +# the package name, but not the actual executable. I've renamed the binary +# to convertlit to keep things SFW. + +PRGNAM=convertlit +VERSION=${VERSION:-1.8} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +SRCVER="$( echo $VERSION | sed 's/\.//')" +SRCNAME="$PRGNAM${SRCVER}src" + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $SRCNAME +mkdir -p $SRCNAME +cd $SRCNAME +unzip $CWD/$SRCNAME.zip +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# use system-installed ltm +sed -i \ + -e 's,-I *\.\./libtommath[^ ]*/,,' \ + -e 's,\.\./libtommath[^ ]*/libtommath\.a,-ltommath,' \ + cl?t$SRCVER/Makefile + +# update the help message to reflect the name change +sed -i '/^"/s,cl.t,'$PRGNAM,g cl?t$SRCVER/cl?t.c + +make -C lib +make -C cl?t$SRCVER + +mkdir -p $PKG/usr/bin +install -s -m0755 cl?t$SRCVER/cl?t $PKG/usr/bin/$PRGNAM + +# handy wrapper script +install -m0755 $CWD/lit2epub $PKG/usr/bin + +# man page borrowed from Debian +mkdir -p $PKG/usr/man/man1 +gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +sed 's,\r,,' cl?t$SRCVER/COPYING > $PKG/usr/doc/$PRGNAM-$VERSION/COPYING +sed '/^Build/,$d' README > $PKG/usr/doc/$PRGNAM-$VERSION/README +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/convertlit/convertlit.info b/office/convertlit/convertlit.info new file mode 100644 index 0000000000000..2b24f04e5cb35 --- /dev/null +++ b/office/convertlit/convertlit.info @@ -0,0 +1,10 @@ +PRGNAM="convertlit" +VERSION="1.8" +HOMEPAGE="http://www.convertlit.com/" +DOWNLOAD="http://www.convertlit.com/convertlit18src.zip" +MD5SUM="d691d4729485fe5d73e3f0937d8fb42e" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="ltm" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" diff --git a/office/convertlit/lit2epub b/office/convertlit/lit2epub new file mode 100644 index 0000000000000..3dca90e68b5c9 --- /dev/null +++ b/office/convertlit/lit2epub @@ -0,0 +1,71 @@ +#!/bin/bash + +# 20130220: lit2epub by B. Watson (part of convertlit slackbuilds.org build) +# Licensed under the WTFPL. + +# Wrapper script for convertlit, zips up convertlit's output dir +# and cleans it up afterward. Leave the shebang line alone, this +# uses at least one bash-specific feature. + +NAME=$( basename $0 ) +TMP=${TMP:-/tmp} +OUTDIR=$TMP/$NAME.$$.$RANDOM + +set -e + +if [ "$1" = "" -o "$1" = "--help" -o "$1" = "-h" ]; then + cat <<EOF +$NAME - convert a DRM1 .lit file to .epub + +Usage: $NAME input.lit [ output.epub ] + +Default output file is written to the current directory, named after the +input filename with the .lit or .LIT extension changed to .epub, or the +input filename with .epub appended, if there is no .lit extension. + +Use - for the output file, to output to stdout. + +Exit status is 0 on success, non-zero on failure. + +If you need to convert a non-DRM1 .lit file, use convertlit to downconvert +to DRM1 first. +EOF + exit 0 +fi + +INFILE="$1" +case "$INFILE" in + *.lit) EXT=.lit ;; + *.LIT) EXT=.LIT ;; + *) EXT="" ;; +esac + +trap "rm -rf \"$OUTDIR\"" EXIT ERR + +# All this rigamarole with dirname/basename/readlink needed because we run +# zip from within our temp directory. +if [ "$2" = "" ]; then + OUTFILE="$( pwd )/$( basename "$INFILE" $EXT ).epub" + if [ -e "$OUTFILE" ]; then + echo "$NAME: $OUTFILE already exists, aborting" 1>&2 + exit 1 + fi +elif [ "$2" = "-" ]; then + OUTFILE="$OUTDIR/output.epub" +else + OUTFILE="$( readlink -f "$OUTFILE" )" +fi + +# convertlit and zip both want to spew status messages to stdout, +# redirect to stderr so we can output just the .epub to stdout. +convertlit -d "$INFILE" "$OUTDIR"/ 1>&2 +( cd "$OUTDIR" ; zip -r "$OUTFILE" * 1>&2 ) + +if [ "$2" = "-" ]; then + cat "$OUTFILE" + OUTFILE="(standard output)" +fi + +echo 1>&2 +echo "$INFILE => $OUTFILE" 1>&2 +exit 0 diff --git a/office/convertlit/slack-desc b/office/convertlit/slack-desc new file mode 100644 index 0000000000000..f9435d95e4a21 --- /dev/null +++ b/office/convertlit/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------------------------------------------------------| +convertlit: convertlit (converts .lit files to .epub) +convertlit: +convertlit: Converts Microsoft Reader format eBooks into open format for use +convertlit: with software or devices which are not directly compatible with +convertlit: Microsoft's Reader. +convertlit: +convertlit: +convertlit: +convertlit: +convertlit: +convertlit: |