2007-07-18 09:04:56 +08:00
|
|
|
#!/bin/bash
|
2012-03-01 20:40:04 +08:00
|
|
|
# Requirement: tesseract directory name should be "tesseract-3.02"
|
2010-09-27 04:11:50 +08:00
|
|
|
|
2012-03-01 20:40:04 +08:00
|
|
|
source_dir=${PWD##*/}
|
|
|
|
ver=$source_dir
|
2010-12-05 21:33:45 +08:00
|
|
|
excld="exclude.txt"
|
2012-03-01 20:40:04 +08:00
|
|
|
|
2010-12-05 21:33:45 +08:00
|
|
|
cd ..
|
2012-03-01 20:40:04 +08:00
|
|
|
echo Output for $source_dir 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
|
|
|
|
2012-03-01 20:40:04 +08:00
|
|
|
for l in $source_dir/tessdata/*.traineddata
|
2007-07-18 09:04:56 +08:00
|
|
|
do
|
2012-03-01 20:40:04 +08:00
|
|
|
filename=`basename "$l"`
|
|
|
|
lang=${filename%.*}
|
|
|
|
echo Creating language package for `basename "$l"`...
|
|
|
|
chmod 644 $source_dir/tessdata/*$lang*
|
|
|
|
tar --group root --owner root -chozf $ver.`basename "$l" .traineddata`.tar.gz $source_dir/tessdata/*$lang*
|
|
|
|
echo $source_dir/tessdata/*$lang* | 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
|
|
|
# Windows build relevant files
|
2011-06-26 05:58:59 +08:00
|
|
|
name=$ver-win_vs
|
2010-12-05 21:33:45 +08:00
|
|
|
# Let's be nice and use common windows packager ;-)
|
2012-03-01 20:40:04 +08:00
|
|
|
zip -9 -r --exclude=*.svn* $name.zip $source_dir/vs2008/
|
2010-12-05 21:33:45 +08:00
|
|
|
|
2012-03-01 20:40:04 +08:00
|
|
|
# create linux source package
|
|
|
|
echo Creating linux source package $ver.tar.gz ...
|
|
|
|
tar -chzf $ver.tar.gz --exclude=.svn --exclude=debian --exclude=doc/html --exclude=po/ --exclude=makemoredists --exclude=vs2008 -X $excld $source_dir/*
|
|
|
|
|
|
|
|
# create doc and package doc
|
|
|
|
cd $source_dir
|
|
|
|
doxygen doc/Doxyfile
|
|
|
|
cd ..
|
|
|
|
tar -chzf $ver-doc-html.tar.gz $source_dir/doc/html/*
|
|
|
|
|
|
|
|
rm -f $excld
|
|
|
|
cd $source_dir
|