aboutsummaryrefslogtreecommitdiff
path: root/graphics/tesseract
diff options
context:
space:
mode:
authorPierre Cazenave <pwcazenave at gmail {dot} com>2010-09-11 15:22:50 -0500
committerRobby Workman <rworkman@slackbuilds.org>2010-09-12 23:08:52 -0500
commit10af232047d0f27280a1a2b40d5e34223fbb5a97 (patch)
treeebe9b67e3c5b3d815a93b02226caf3d0bcd7041d /graphics/tesseract
parent4412a8b7107a5aa588510b5f37bbafd847d80e71 (diff)
graphics/tesseract: Reworked lang pack installation logic
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'graphics/tesseract')
-rw-r--r--graphics/tesseract/tesseract.SlackBuild29
1 files changed, 18 insertions, 11 deletions
diff --git a/graphics/tesseract/tesseract.SlackBuild b/graphics/tesseract/tesseract.SlackBuild
index 95f010a6cf41c..92c3b990aff25 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 <rworkman@slackbuilds.org> for better
# consistency with our other scripts
# Thanks to S+*n_Pe*rm*n for a bug report from OCRopus.
-# Copyright 2009 Pierre Cazenave <pwcazenave {at} gmail [dot] com>
+# Copyright 2009-2010 Pierre Cazenave <pwcazenave {at} gmail [dot] com>
# 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