Commit 3ef02ac1 authored by Łukasz Nowak's avatar Łukasz Nowak

- put share of tesseract to different location to avoid its deleteion during package upgrade

 - point tesseract to this location and put there trained data


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43026 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d087c770
...@@ -7,14 +7,22 @@ extends = ...@@ -7,14 +7,22 @@ extends =
zlib.cfg zlib.cfg
parts = parts =
tesseract
tesseract-eng-traineddata
tesseract-eng-traineddata-unzip tesseract-eng-traineddata-unzip
tesseract
[tesseract-share]
# XXX: tesseract seems not easy configurable on runtime about where to find
# its trained data, so just move out its datadir to own controlled location
location = ${buildout:parts-directory}/${:_buildout_section_name_}
command = mkdir -p ${:location} && mkdir -p ${:location}/tessdata
update-command = ${:command}
stop-on-error = yes
[tesseract] [tesseract]
recipe = hexagonit.recipe.cmmi recipe = hexagonit.recipe.cmmi
url = http://tesseract-ocr.googlecode.com/files/tesseract-3.00.tar.gz url = http://tesseract-ocr.googlecode.com/files/tesseract-3.00.tar.gz
md5sum = cc812a261088ea0c3d2da735be35d09f md5sum = cc812a261088ea0c3d2da735be35d09f
configure-options = --datarootdir=${tesseract-share:location}
environment = environment =
CPPFLAGS=-I${zlib:location}/include -I${jbigkit:location}/include -I${libjpeg:location}/include -I${libtiff:location}/include -I${libpng:location}/include CPPFLAGS=-I${zlib:location}/include -I${jbigkit:location}/include -I${libjpeg:location}/include -I${libtiff:location}/include -I${libpng:location}/include
LDFLAGS =-Wl,-rpath -L${zlib:location}/lib -Wl,${zlib:location}/lib -L${jbigkit:location}/lib -Wl,-rpath -Wl,${jbigkit:location}/lib -L${libjpeg:location}/lib -Wl,-rpath -Wl,${libjpeg:location}/lib -L${libtiff:location}/lib -Wl,-rpath -Wl,${libtiff:location}/lib -L${libpng:location}/lib -Wl,-rpath -Wl,${libpng:location}/lib LDFLAGS =-Wl,-rpath -L${zlib:location}/lib -Wl,${zlib:location}/lib -L${jbigkit:location}/lib -Wl,-rpath -Wl,${jbigkit:location}/lib -L${libjpeg:location}/lib -Wl,-rpath -Wl,${libjpeg:location}/lib -L${libtiff:location}/lib -Wl,-rpath -Wl,${libtiff:location}/lib -L${libpng:location}/lib -Wl,-rpath -Wl,${libpng:location}/lib
...@@ -26,7 +34,8 @@ url = http://tesseract-ocr.googlecode.com/files/eng.traineddata.gz ...@@ -26,7 +34,8 @@ url = http://tesseract-ocr.googlecode.com/files/eng.traineddata.gz
md5sum = d91041ad156cf2db36664e91ef799451 md5sum = d91041ad156cf2db36664e91ef799451
[tesseract-eng-traineddata-unzip] [tesseract-eng-traineddata-unzip]
location = ${buildout:parts-directory}/${:_buildout_section_name_}
recipe = plone.recipe.command recipe = plone.recipe.command
command = gunzip ${tesseract-eng-traineddata:location}/eng.traineddata.gz -c > ${tesseract:location}/share/tessdata/eng.traineddata command = gunzip ${tesseract-eng-traineddata:location}/eng.traineddata.gz -c > ${tesseract-share:location}/tessdata/eng.traineddata
update-command = ${:command} update-command = ${:command}
stop-on-error = yes stop-on-error = yes
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment