source: gs2-extensions/tesseract/trunk/makedists.sh@ 34198

Last change on this file since 34198 was 34198, checked in by ak19, 4 years ago
  1. Added a script to generate the cut-down ('binary only') tesseract binary tarball and zip. 2. Also adding the tesseract binary zip itself to svn.
  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/bin/sh
2
3osarch=$1
4usagemsg="Usage: $0 linux-x64|linux"
5if [ -z "$osarch" ]; then
6 echo $usagemsg
7 exit 1;
8fi
9# https://stackoverflow.com/questions/3265803/bash-string-equality
10if [ "$osarch" != "linux-x64" ] && [ "$osarch" != "linux" ]; then
11 echo "Parameter is (slightly?) incorrect."
12 echo $usagemsg
13 exit 1
14fi
15
16
17echo "Creating tarball and zip for $osarch"
18
19if [ ! -d tesseract ]; then
20 mkdir tesseract
21
22 cp src/setup.ba* tesseract/.
23
24 if [ ! -d src/linux ]; then
25 echo "No src/linux folder, can't proceed tarring and zipping up tesseract."
26 exit 1;
27 else
28 echo "Moving src/linux into tesseract folder"
29 #mv src/linux tesseract/.
30 cp -r src/linux tesseract/.
31
32 echo "Copying licence files"
33 cp src/packages/*LICENSE.txt tesseract/linux/.
34
35 echo "Copying user info files"
36 cp GETTING-OCR-SUPPORT-FOR-MORE-LANGS.txt tesseract/.
37
38 echo "Removing tesseract/linux/man"
39 rm -rf tesseract/linux/man
40
41 echo "Removing all but folder 'tessdata' from tesseract/linux/share folder"
42 #rm -rf tesseract/linux/share/aclocal
43 #rm -rf tesseract/linux/share/doc
44 #rm -rf tesseract/linux/share/info/
45 #rm -rf tesseract/linux/share/libtool/
46 #rm -rf tesseract/linux/share/man
47 mv tesseract/linux/share tesseract/linux/share.del
48 mkdir tesseract/linux/share
49 mv tesseract/linux/share.del/tessdata tesseract/linux/share/.
50 rm -rf tesseract/linux/share.del
51 fi
52else
53 echo "Folder tesseract already exists. Using existing."
54 echo "For creating a fresh tarball and zip, delete the existing tesseract folder"
55 echo "at this script level ($0) first."
56fi
57
58# just try to create it for the OS
59outfile="tesseract-$osarch"
60if [ -f "$outfile.tar.gz" ]; then
61 rm "$outfile.tar.gz"
62fi
63tar -cvzf "$outfile.tar.gz" tesseract
64
65if [ -f "$outfile.zip" ]; then
66 rm "$outfile.zip"
67fi
68zip -r "$outfile.zip" tesseract
69
70echo "Done making $outfile tarball/zip"
71echo ""
Note: See TracBrowser for help on using the repository browser.