diff options
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/tesseract/README | 10 | ||||
-rw-r--r-- | graphics/tesseract/tesseract.SlackBuild | 85 | ||||
-rw-r--r-- | graphics/tesseract/tesseract.info | 8 |
3 files changed, 35 insertions, 68 deletions
diff --git a/graphics/tesseract/README b/graphics/tesseract/README index f9be7a1c4c17a..f83336cf36ad4 100644 --- a/graphics/tesseract/README +++ b/graphics/tesseract/README @@ -13,9 +13,7 @@ changed by passing an alternate value on the command line. Here is the relevant code from the build script: # Language pack(s) to use - # We'll install English by default, but you can pass another one (or all) - # 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 + # We'll install English by default, but you can pass another one. + # Edit the LANGNAM variable to switch to another language + # Please use full package name on that variable (including the extension) + # see https://code.google.com/p/tesseract-ocr/downloads/list for the list diff --git a/graphics/tesseract/tesseract.SlackBuild b/graphics/tesseract/tesseract.SlackBuild index 92c3b990aff25..846fb6a807f6f 100644 --- a/graphics/tesseract/tesseract.SlackBuild +++ b/graphics/tesseract/tesseract.SlackBuild @@ -1,14 +1,5 @@ #!/bin/sh - -# Pierre Cazenave 10/11/2007. -# 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. +# Slackware build script for tesseract # Copyright 2009-2010 Pierre Cazenave <pwcazenave {at} gmail [dot] com> # All rights reserved. @@ -30,11 +21,25 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# Pierre Cazenave 10/11/2007. +# 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) +# Thanks to S+*n_Pe*rm*n for a bug report from OCRopus. +# Modified by Willy Sudiarto Raharjo <willysr@slackware-id.org> + PRGNAM=tesseract -VERSION=2.04 -BUILD=${BUILD:-2} +VERSION=${VERSION:-3.01} +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 ;; @@ -48,14 +53,6 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -# Language pack(s) to use -# We'll install English by default, but you can pass another one (or all) -# 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 eus fra ita nld por spa vie" ./tesseract.SlackBuild -TESSLANG=${TESSLANG:-"eng"} # English only - if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" @@ -78,11 +75,18 @@ cd $TMP tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION chown -R root:root . -chmod -R u+w,go+r-w,a-s . +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 + +./autogen.sh CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ @@ -95,42 +99,8 @@ CFLAGS="$SLKCFLAGS" \ make -# Let's extract the desired language tarballs, with a hack for the different -# 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" == "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 - else - echo "$CWD/tesseract-2.01.$_language.tar.gz not found." - sleep 5 - fi; - else - if [ -r $CWD/tesseract-2.00.$_language.tar.gz ]; then - tar xf $CWD/tesseract-2.00.$_language.tar.gz - SUCCESS=yes - else - echo "$CWD/tesseract-2.00.$_language.tar.gz not found." - sleep 5 - fi; - fi -done - -if [ ! "$SUCCESS" = "yes" ]; then - echo "No language packs were found, so this package will not work as is." - echo "See $CWD/README for more information." - exit 1 -fi +# Extract language name described above +tar xvf $CWD/$LANGNAM make install DESTDIR=$PKG @@ -141,7 +111,6 @@ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README ReleaseNotes \ $PKG/usr/doc/$PRGNAM-$VERSION 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 {} \; mkdir -p $PKG/install diff --git a/graphics/tesseract/tesseract.info b/graphics/tesseract/tesseract.info index 9646a54a5cbe6..da456a7d87a5a 100644 --- a/graphics/tesseract/tesseract.info +++ b/graphics/tesseract/tesseract.info @@ -1,12 +1,12 @@ PRGNAM="tesseract" -VERSION="2.04" +VERSION="3.01" HOMEPAGE="http://code.google.com/p/tesseract-ocr/" -DOWNLOAD="http://tesseract-ocr.googlecode.com/files/tesseract-2.04.tar.gz \ - http://tesseract-ocr.googlecode.com/files/tesseract-2.00.eng.tar.gz" +DOWNLOAD="https://tesseract-ocr.googlecode.com/files/tesseract-3.01.tar.gz \ + https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.01.eng.tar.gz" MD5SUM="b44eba1a9f4892ac62e484c807fe0533 \ b8291d6b3a63ce7879d688e845e341a9" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="" +REQUIRES="leptonica" MAINTAINER="Pierre Cazenave" EMAIL="pwcazenave <at> gmail {dot} com" |