summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-05-04 15:54:37 +0100
committerNick White <git@njw.name>2020-05-04 15:54:37 +0100
commitee372af8c07fa5f4c78ce0add4d779a8efb61625 (patch)
tree9a7af142dcc4e6158f63288c50d6776822e8a368 /roles
parent582045da94dec61bd5569230fe07ea9302f3c68b (diff)
Roll training into main tesseract role; no need to keep it separate
Diffstat (limited to 'roles')
-rw-r--r--roles/tesseractor/tasks/leptonica.yml9
-rw-r--r--roles/tesseractor/tasks/tesseract.yml29
-rw-r--r--roles/tesstrainer/handlers/main.yml3
-rw-r--r--roles/tesstrainer/tasks/ldlocal.yml9
-rw-r--r--roles/tesstrainer/tasks/main.yml3
-rw-r--r--roles/tesstrainer/tasks/tesseract.yml67
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