makemoredists 1.5 KB
Newer Older
T
theraysmith 已提交
1
#!/bin/bash
2
# Requirement: tesseract directory name should be "tesseract-ocr"
3

4
source_dir=${PWD##*/}
5 6 7
tess_ver=3.02
src_min_ver=.02
ver=$source_dir-$tess_ver
8
excld="exclude.txt"
9

10
cd ..
11
echo Output for $source_dir is in `pwd` ...
12

13 14 15 16 17 18
# create language files packages
if [ -f $excld ] 
then
	echo Removing $excld...
	rm -f $excld
fi
19

20
for l in $source_dir/tessdata/*.traineddata
T
theraysmith 已提交
21
do
22 23 24 25 26 27
	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
T
theraysmith 已提交
28
done
29

30
# Windows build relevant files
31
name=$ver-win_vs2008
32
# Let's be nice and use common windows packager ;-)
Z
zdenop 已提交
33
zip -9 -r --exclude=*.svn* --exclude=*strtok_r* $name.zip $source_dir/vs2008/
34

35
# create linux source package
36
echo Creating linux source package $ver$src_min_ver.tar.gz ...
Z
zdenop@gmail.com 已提交
37
tar -chof $ver$src_min_ver.tar --exclude=.svn --exclude=debian --exclude=autom4te.cache --exclude=doc/html --exclude=po/ --exclude=m4/ --exclude=makemoredists --exclude=vs2008 -exclude=INSTALL.SVN -X $excld $source_dir/*
Z
zdenop 已提交
38
#workaround to include strtok_r from vs2008 for mingw
Z
zdenop@gmail.com 已提交
39
tar -rof $ver$src_min_ver.tar $source_dir/vs2008/port/strtok_r.*
40
gzip $ver$src_min_ver.tar
41 42 43

# create doc and package doc
cd $source_dir
44
doxygen doc/Doxyfile
45
cd ..
Z
zdenop@gmail.com 已提交
46
tar --group root --owner root -chozf $ver-doc-html.tar.gz $source_dir/doc/html/*
47 48

rm -f $excld
Z
zdenop 已提交
49
cd $source_dir