diff options
Diffstat (limited to 'source/l/ebook-tools')
-rwxr-xr-x | source/l/ebook-tools/ebook-tools.SlackBuild | 13 | ||||
-rw-r--r-- | source/l/ebook-tools/epub3_fixed_layout.patch | 160 | ||||
-rw-r--r-- | source/l/ebook-tools/slack-desc | 4 |
3 files changed, 170 insertions, 7 deletions
diff --git a/source/l/ebook-tools/ebook-tools.SlackBuild b/source/l/ebook-tools/ebook-tools.SlackBuild index 44fc031e8..7e590df23 100755 --- a/source/l/ebook-tools/ebook-tools.SlackBuild +++ b/source/l/ebook-tools/ebook-tools.SlackBuild @@ -24,7 +24,7 @@ PKGNAM=ebook-tools VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} NUMJOBS=${NUMJOBS:-" -j7 "} @@ -32,7 +32,7 @@ NUMJOBS=${NUMJOBS:-" -j7 "} MARCH=$( uname -m ) if [ -z "$ARCH" ]; then case "$MARCH" in - i?86) export ARCH=i486 ;; + i?86) export ARCH=i586 ;; armv7hl) export ARCH=$MARCH ;; arm*) export ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: @@ -40,8 +40,8 @@ if [ -z "$ARCH" ]; then esac fi -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" @@ -76,6 +76,9 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +# Patch from svn to support epub3 fixed layout +zcat $CWD/epub3_fixed_layout.patch.gz | patch -p0 --verbose || exit 1 + # Build and install: mkdir -p build cd build @@ -95,7 +98,7 @@ cd - # Remove lit2epub binary because it doesn't work without clit (which has # distribution restrictions so we do not include it) -rm -f $PKG/usr/bin/lit2epub +rm -f $PKG/usr/bin/lit2epub # Strip binaries: find $PKG | xargs file | grep -e "executable" -e "shared object" \ diff --git a/source/l/ebook-tools/epub3_fixed_layout.patch b/source/l/ebook-tools/epub3_fixed_layout.patch new file mode 100644 index 000000000..b06b6378a --- /dev/null +++ b/source/l/ebook-tools/epub3_fixed_layout.patch @@ -0,0 +1,160 @@ +Index: src/libepub/opf.c +=================================================================== +--- src/libepub/opf.c (revision 147) ++++ src/libepub/opf.c (revision 148) +@@ -184,12 +184,16 @@ + struct meta *new = malloc(sizeof(struct meta)); + new->name = xmlTextReaderGetAttribute(reader, (xmlChar *)"name"); + new->content = xmlTextReaderGetAttribute(reader, (xmlChar *)"content"); ++ new->property = xmlTextReaderGetAttribute(reader, (xmlChar *)"property"); ++ new->value = string; + + AddNode(meta->meta, NewListNode(meta->meta, new)); +- if (string) +- free(string); + _epub_print_debug(opf->epub, DEBUG_INFO, "meta is %s: %s", + new->name, new->content); ++ if (new->property) { ++ _epub_print_debug(opf->epub, DEBUG_INFO, "meta has property %s: %s", ++ new->property, new->value); ++ } + } else if (xmlStrcasecmp(local, (xmlChar *)"date") == 0) { + struct date *new = malloc(sizeof(struct date)); + new->date = string; +@@ -647,7 +651,7 @@ + + void _opf_parse_spine(struct opf *opf, xmlTextReaderPtr reader) { + int ret; +- xmlChar *linear; ++ xmlChar *linear, *properties; + + _epub_print_debug(opf->epub, DEBUG_INFO, "parsing spine"); + +@@ -707,7 +711,25 @@ + + if(linear) + free(linear); +- ++ ++ properties = xmlTextReaderGetAttribute(reader, (xmlChar *)"properties"); ++ if (properties) { ++ if (xmlStrcasecmp(properties, (xmlChar *)"rendition:page-spread-center") == 0) { ++ item->spreadPosition = PAGE_SPREAD_CENTER; ++ } else if (xmlStrcasecmp(properties, (xmlChar *)"page-spread-left") == 0) { ++ item->spreadPosition = PAGE_SPREAD_LEFT; ++ } else if (xmlStrcasecmp(properties, (xmlChar *)"page-spread-right") == 0) { ++ item->spreadPosition = PAGE_SPREAD_RIGHT; ++ } else { ++ item->spreadPosition = PAGE_SPREAD_UNKNOWN; ++ } ++ } else { ++ item->spreadPosition = PAGE_SPREAD_UNKNOWN; ++ } ++ ++ if(properties) ++ free(properties); ++ + AddNode(opf->spine, NewListNode(opf->spine, item)); + + // decide what to do with non linear items +@@ -884,7 +906,7 @@ + DumpList(opf->metadata->creator, (ListDumpFunc)_list_dump_creator); + printf("Identifier(s):\n "); + DumpList(opf->metadata->id, (ListDumpFunc)_list_dump_id); +- printf("Reading order:\n "); ++ printf("Reading order:\n"); + DumpList(opf->spine, (ListDumpFunc)_list_dump_spine); + printf("\n"); + if (opf->guide) { +Index: src/libepub/epub_shared.h +=================================================================== +--- src/libepub/epub_shared.h (revision 147) ++++ src/libepub/epub_shared.h (revision 148) +@@ -52,4 +52,14 @@ + TITERATOR_PAGES /**< The pages of the ebook */ + }; + ++/** ++ The page-spread-* properties ++*/ ++enum page_spread_position { ++ PAGE_SPREAD_CENTER, ++ PAGE_SPREAD_LEFT, ++ PAGE_SPREAD_RIGHT, ++ PAGE_SPREAD_UNKNOWN ++}; ++ + #endif +Index: src/libepub/epublib.h +=================================================================== +--- src/libepub/epublib.h (revision 147) ++++ src/libepub/epublib.h (revision 148) +@@ -65,6 +65,8 @@ + struct meta { + xmlChar *name; + xmlChar *content; ++ xmlChar *property; ++ xmlChar *value; + }; + + struct id { +@@ -170,6 +172,7 @@ + struct spine { + xmlChar *idref; + int linear; //bool ++ enum page_spread_position spreadPosition; + }; + + struct opf { +Index: src/libepub/list.c +=================================================================== +--- src/libepub/list.c (revision 147) ++++ src/libepub/list.c (revision 148) +@@ -163,10 +163,24 @@ + root->fullpath, root->mediatype); + } + void _list_dump_spine(struct spine *spine) { +- printf("%s", spine->idref); ++ printf(" %s", spine->idref); + if (spine->linear) + printf("(L)"); +- printf(" "); ++ switch (spine->spreadPosition) { ++ case PAGE_SPREAD_CENTER: ++ printf("(CENTER)"); ++ break; ++ case PAGE_SPREAD_LEFT: ++ printf("(LEFT)"); ++ break; ++ case PAGE_SPREAD_RIGHT: ++ printf("(RIGHT)"); ++ break; ++ default: ++ printf("(UNKNOWN)"); ++ break; ++ } ++ printf(" \n"); + } + + void _list_dump_spine_linear(struct spine *spine) { +@@ -200,6 +214,20 @@ + printf("%s", meta->content); + else + printf("unspecified"); ++ ++ printf(" : "); ++ ++ if (meta->property) ++ printf("%s", meta->property); ++ else ++ printf("unspecified"); ++ ++ printf(" : "); ++ ++ if (meta->value) ++ printf("%s", meta->value); ++ else ++ printf("unspecified"); + + printf("\n"); + } diff --git a/source/l/ebook-tools/slack-desc b/source/l/ebook-tools/slack-desc index 374d507b4..9833019be 100644 --- a/source/l/ebook-tools/slack-desc +++ b/source/l/ebook-tools/slack-desc @@ -5,10 +5,10 @@ # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. - |-----handy-ruler--------------------------------------------------| + |-----handy-ruler------------------------------------------------------| ebook-tools: ebook-tools (access and convert various ebook file formats) ebook-tools: -ebook-tools: Tools for accessing and converting various ebook file formats. +ebook-tools: Tools for accessing and converting various ebook file formats. ebook-tools: ebook-tools: Home page: http://sourceforge.net/projects/ebook-tools/ ebook-tools: |