From 10af232047d0f27280a1a2b40d5e34223fbb5a97 Mon Sep 17 00:00:00 2001 From: Pierre Cazenave Date: Sat, 11 Sep 2010 15:22:50 -0500 Subject: graphics/tesseract: Reworked lang pack installation logic Signed-off-by: Robby Workman --- graphics/tesseract/tesseract.SlackBuild | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/graphics/tesseract/tesseract.SlackBuild b/graphics/tesseract/tesseract.SlackBuild index 95f010a6cf..92c3b990af 100644 --- a/graphics/tesseract/tesseract.SlackBuild +++ b/graphics/tesseract/tesseract.SlackBuild @@ -1,14 +1,16 @@ #!/bin/sh # Pierre Cazenave 10/11/2007. -# Updated 25/01/2009. -# Updated 08/04/2009. -# Updated 28/05/2009 for Slackware64. +# Updated 25/01/2009. +# Updated 08/04/2009. +# Updated 28/05/2009 for Slackware64. +# Updated 08/09/2010 Fixed language packs logic (Thanks to Ed Rozenberg) +# # Modified by Robby Workman for better # consistency with our other scripts # Thanks to S+*n_Pe*rm*n for a bug report from OCRopus. -# Copyright 2009 Pierre Cazenave +# Copyright 2009-2010 Pierre Cazenave # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -30,7 +32,7 @@ PRGNAM=tesseract VERSION=2.04 -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -51,8 +53,8 @@ OUTPUT=${OUTPUT:-/tmp} # of them on the command line (space delimited). If you pass more than one # (again, space delimited), you must enclose the string in quotes. Examples: # TESSLANG=fra ./tesseract.SlackBuild -# TESSLANG="deu deu-f eng fra ita nld por spa vie" ./tesseract.SlackBuild -TESSLANG=${TESSLANG:-eng} # Default to English +# TESSLANG="deu deu-f eng eus fra ita nld por spa vie" ./tesseract.SlackBuild +TESSLANG=${TESSLANG:-"eng"} # English only if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" @@ -97,7 +99,15 @@ make # version numbers for certain language files. I shied away from wildcards as # they're a bit unpredictable... for _language in $(echo "$TESSLANG") ; do - if [ "$_language" == "deu-f" -o "$_language" == "por" -o "$_language" == "vie" ]; then + if [ "$_language" == "eus" ]; then + if [ -r $CWD/tesseract-2.04.$_language.tar.gz ]; then + tar xf $CWD/tesseract-2.04.$_language.tar.gz + SUCCESS=yes + else + echo "$CWD/tesseract-2.01.$_language.tar.gz not found." + sleep 5 + fi; + elif [ "$_language" == "deu-f" -o "$_language" == "por" -o "$_language" == "vie" ]; then if [ -r $CWD/tesseract-2.01.$_language.tar.gz ]; then tar xf $CWD/tesseract-2.01.$_language.tar.gz SUCCESS=yes @@ -134,9 +144,6 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README.$TAG find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \; -# remove zero size files (from extra potentially not installed language packs). -find $PKG/usr/share/tessdata -type f -size 0 -exec rm {} + - mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc -- cgit v1.2.3