2007-07-18 09:04:56 +08:00
|
|
|
#!/bin/bash
|
2010-12-05 21:33:45 +08:00
|
|
|
# Requirement: tesseract directory name must be "tesseract-ocr" otherwise
|
|
|
|
# script will not work
|
2010-09-27 04:11:50 +08:00
|
|
|
|
2010-12-05 21:33:45 +08:00
|
|
|
# get version information
|
|
|
|
version=`grep PACKAGE_VERSION= configure | sed -e "s/PACKAGE_VERSION=//" | sed -e "s/'//g"`
|
|
|
|
ver=tesseract-ocr-$version
|
|
|
|
excld="exclude.txt"
|
|
|
|
cd ..
|
|
|
|
echo Output for $ver is in `pwd`...
|
2010-09-27 04:11:50 +08:00
|
|
|
|
2010-12-05 21:33:45 +08:00
|
|
|
# create language files packages
|
|
|
|
if [ -f $excld ]
|
|
|
|
then
|
|
|
|
echo Removing $excld...
|
|
|
|
rm -f $excld
|
|
|
|
fi
|
2010-09-27 04:11:50 +08:00
|
|
|
|
2010-12-05 21:33:45 +08:00
|
|
|
for l in tesseract-ocr/tessdata/*.traineddata
|
2007-07-18 09:04:56 +08:00
|
|
|
do
|
2010-09-27 04:11:50 +08:00
|
|
|
echo Creating language package for `basename "$l" .traineddata`...
|
|
|
|
chmod 644 ${l%%.*}.*
|
|
|
|
tar --group root --owner root -chozf $ver.`basename "$l" .traineddata`.tar.gz ${l%%.*}.*
|
2010-12-05 21:33:45 +08:00
|
|
|
echo ${l%%.*}.* | tr " " "\n" >>$excld
|
2007-07-18 09:04:56 +08:00
|
|
|
done
|
2010-09-27 04:11:50 +08:00
|
|
|
|
2010-12-05 21:33:45 +08:00
|
|
|
# create linux source package
|
|
|
|
tar -chozf tesseract-ocr-3.01.tar.gz --exclude=.svn --exclude=vs2008 -X $excld tesseract-ocr/*
|
|
|
|
rm -f $excld
|
|
|
|
|
|
|
|
# Windows build relevant files
|
|
|
|
name=$ver-vs2008
|
|
|
|
# Let's be nice and use common windows packager ;-)
|
|
|
|
zip $name.zip tesseract-ocr/vs2008/* tesseract-ocr/vs2008/include/* tesseract-ocr/vs2008/include/leptonica/* tesseract-ocr/vs2008/lib/* tesseract-ocr/vs2008/port/*
|
|
|
|
|