aboutsummaryrefslogtreecommitdiff
path: root/graphics/tesseract/tesseract.SlackBuild
diff options
context:
space:
mode:
authorLukenShiro <lukenshiro@ngi.it>2013-11-15 17:28:26 -0600
committerRobby Workman <rworkman@slackbuilds.org>2013-11-15 20:27:39 -0600
commitde93f3da319db3308a95b6f9175b60eb7904f65e (patch)
treea29c10dada459fd68eec2ab4bbfa032be58356ad /graphics/tesseract/tesseract.SlackBuild
parent811878d4dfc2ee37f3d2b5c8f0c9833608c16ac9 (diff)
graphics/tesseract: Updated for version 3.02.02.
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'graphics/tesseract/tesseract.SlackBuild')
-rw-r--r--graphics/tesseract/tesseract.SlackBuild55
1 files changed, 31 insertions, 24 deletions
diff --git a/graphics/tesseract/tesseract.SlackBuild b/graphics/tesseract/tesseract.SlackBuild
index a66096916ae48..5f1423c7ae2cc 100644
--- a/graphics/tesseract/tesseract.SlackBuild
+++ b/graphics/tesseract/tesseract.SlackBuild
@@ -2,6 +2,7 @@
# Slackware build script for tesseract
# Copyright 2009-2010 Pierre Cazenave <pwcazenave {at} gmail [dot] com>
+# Copyright 2013 LukenShiro, Italy
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -30,16 +31,10 @@
# Modified by Willy Sudiarto Raharjo <willysr@slackware-id.org>
PRGNAM=tesseract
-VERSION=${VERSION:-3.01}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-3.02.02}
+BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
-# language file name
-# replace this with the filename of the language you want to install
-# filename differs from one language to another, so it's very unpredictable
-# see https://code.google.com/p/tesseract-ocr/downloads/list for complete list
-LANGNAM=${LANGNAM:-"tesseract-ocr-3.01.eng.tar.gz"}
-
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
@@ -67,6 +62,19 @@ else
LIBDIRSUFFIX=""
fi
+DOCFILES="AUTHORS COPYING ChangeLog INSTALL NEWS README ReleaseNotes"
+# Language data files
+# replace this with the 3-character ISO 639-2 language code of the language(s)
+# you want to install: different language data files can coexist nicely.
+# Available languages are (in no particular order):
+# grc epo_alt eng ukr tur tha tgl tel tam swe swa srp sqi spa_old spa slv
+# slk ron por pol nor nld msa mlt mkd mal lit lav kor kan ita_old ita isl
+# ind chr hun hrv hin heb glg frm frk fra fin eus est equ epo enm ell due
+# dan ces cat bul ben bel aze ara afr jpn chi_sim chi_tra rus vie
+# see https://code.google.com/p/tesseract-ocr/downloads/list for complete list
+LANGVER=${LANGVER:-3.02}
+LANGNAM=${LANGNAM:-"eng"}
+
set -e
rm -rf $TMP/$PRGNAM-$VERSION $PKG
@@ -75,16 +83,11 @@ cd $TMP
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
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 {} \;
-
-# Fix missing snprintf()
-patch -p1 < $CWD/svutil.cpp-include_stdio_h.diff
-
-sed -i '1,1i#include <unistd.h>' viewer/svutil.cpp
+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 {} \;
./autogen.sh
CFLAGS="$SLKCFLAGS" \
@@ -98,20 +101,24 @@ CFLAGS="$SLKCFLAGS" \
--build=$ARCH-slackware-linux
make
-
-# Extract language name described above
-tar xvf $CWD/$LANGNAM
-
make install DESTDIR=$PKG
-find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+# Extract language name described above;
+# language files are not automatically installed.
+mkdir -p $PKG/usr/share/tessdata
+for LNG in $LANGNAM; \
+ do tar xvf $CWD/tesseract-ocr-$LANGVER.$LNG.tar.gz ; \
+ mv tesseract-ocr/tessdata/* $PKG/usr/share/tessdata/
+done
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README ReleaseNotes \
+cp -a $DOCFILES \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \;