diff options
Diffstat (limited to 'roles')
-rw-r--r-- | roles/tesseractor/tasks/leptonica.yml | 9 | ||||
-rw-r--r-- | roles/tesseractor/tasks/tesseract.yml | 29 | ||||
-rw-r--r-- | roles/tesstrainer/handlers/main.yml | 3 | ||||
-rw-r--r-- | roles/tesstrainer/tasks/ldlocal.yml | 9 | ||||
-rw-r--r-- | roles/tesstrainer/tasks/main.yml | 3 | ||||
-rw-r--r-- | roles/tesstrainer/tasks/tesseract.yml | 67 |
6 files changed, 32 insertions, 88 deletions
diff --git a/roles/tesseractor/tasks/leptonica.yml b/roles/tesseractor/tasks/leptonica.yml index 0664529..9b07c9b 100644 --- a/roles/tesseractor/tasks/leptonica.yml +++ b/roles/tesseractor/tasks/leptonica.yml @@ -3,8 +3,15 @@ - name: Install leptonica dependencies apt: - name: ['g++', 'git', 'libjpeg62-turbo-dev', 'libpng-dev', 'libtiff-dev', 'make', 'zlib1g-dev'] state: present + name: + - g++ + - git + - libjpeg62-turbo-dev + - libpng-dev + - libtiff-dev + - make + - zlib1g-dev - name: Clone leptonica repository git: diff --git a/roles/tesseractor/tasks/tesseract.yml b/roles/tesseractor/tasks/tesseract.yml index 99d15f8..56d8750 100644 --- a/roles/tesseractor/tasks/tesseract.yml +++ b/roles/tesseractor/tasks/tesseract.yml @@ -3,8 +3,23 @@ - name: Install tesseract dependencies apt: - name: ['g++', 'git', 'libjpeg62-turbo-dev', 'libpng-dev', 'libtiff-dev', 'make', 'zlib1g-dev'] state: present + name: + - g++ + - git + - libjpeg62-turbo-dev + - libpng-dev + - libtiff-dev + - make + - zlib1g-dev + +- name: Install tesseract training dependencies + apt: + state: present + name: + - libcairo2-dev + - libicu-dev + - libpango1.0-dev - name: Clone tesseract repository git: @@ -15,12 +30,16 @@ become: no register: tessclone -- name: Build tesseract - make: chdir=/home/{{ ansible_user }}/src/tesseract/simplemake +- name: Build tesseract and training tools + command: make all training + args: + chdir=/home/{{ ansible_user }}/src/tesseract/simplemake become: no when: tessclone.changed -- name: Install tesseract - make: chdir=/home/{{ ansible_user }}/src/tesseract/simplemake target=install +- name: Install tesseract and training tools + command: make install install-training + args: + chdir=/home/{{ ansible_user }}/src/tesseract/simplemake when: tessclone.changed notify: update ld.so diff --git a/roles/tesstrainer/handlers/main.yml b/roles/tesstrainer/handlers/main.yml deleted file mode 100644 index 12df781..0000000 --- a/roles/tesstrainer/handlers/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: update ld.so - command: /sbin/ldconfig diff --git a/roles/tesstrainer/tasks/ldlocal.yml b/roles/tesstrainer/tasks/ldlocal.yml deleted file mode 100644 index 2fd5fac..0000000 --- a/roles/tesstrainer/tasks/ldlocal.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -# Sets ld.so to search /usr/local/lib for libraries - -- name: Add local path to ld.so.conf search path - lineinfile: - dest: /etc/ld.so.conf.d/locallib.conf - create: true - line: /usr/local/lib - notify: update ld.so diff --git a/roles/tesstrainer/tasks/main.yml b/roles/tesstrainer/tasks/main.yml deleted file mode 100644 index 33d6a30..0000000 --- a/roles/tesstrainer/tasks/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: tesseract.yml -- include: ldlocal.yml diff --git a/roles/tesstrainer/tasks/tesseract.yml b/roles/tesstrainer/tasks/tesseract.yml deleted file mode 100644 index 477c0e4..0000000 --- a/roles/tesstrainer/tasks/tesseract.yml +++ /dev/null @@ -1,67 +0,0 @@ ---- -# 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 |