summaryrefslogtreecommitdiff
path: root/roles/tesstrainer/tasks/tesseract.yml
blob: 477c0e4e39e16198f255961015d5306add388e70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
# Installs tesseract

- name: Install tesseract dependencies
  package: name={{ item }} state=present
  with_items:
    - gcc-c++
    - git
    - libjpeg-turbo-devel
    - libpng12-devel
    - libtiff-devel
    - make
    - zlib-devel

- name: Install tesseract training dependencies
  package: name={{ item }} state=present
  with_items:
    - cairo-devel
    - libicu-devel
    - pango-devel

- name: Clone leptonica repository
  git:
    repo: https://github.com/nickjwhite/leptonica
    dest: /home/ec2-user/src/leptonica
    version: addinstall
    depth: 1
  become: no
  register: leptclone

- name: Build leptonica
  command: make -f makefile.static {{ item }}
  args:
    chdir: /home/ec2-user/src/leptonica/src
  with_items:
    - nodebug
    - SHARED=yes shared
  become: no
  when: leptclone.changed

- name: Install leptonica
  command: make -f makefile.static install
  args:
    chdir: /home/ec2-user/src/leptonica/src
  when: leptclone.changed

- name: Clone tesseract repository
  git:
    repo: https://github.com/nickjwhite/tesseract
    dest: /home/ec2-user/src/tesseract
    version: amibuild
    depth: 1
  become: no
  register: tessclone

- name: Build tesseract and training tools
  command: make all training
  args:
    chdir: /home/ec2-user/src/tesseract/simplemake
  become: no
  when: tessclone.changed

- name: Install tesseract and training tools
  command: make install install-training
  args:
    chdir: /home/ec2-user/src/tesseract/simplemake
  when: tessclone.changed