summaryrefslogtreecommitdiff
path: root/roles/tesstrainer
diff options
context:
space:
mode:
Diffstat (limited to 'roles/tesstrainer')
-rw-r--r--roles/tesstrainer/handlers/main.yml3
-rw-r--r--roles/tesstrainer/tasks/ldlocal.yml4
-rw-r--r--roles/tesstrainer/tasks/main.yml2
-rw-r--r--roles/tesstrainer/tasks/tesseract.yml (renamed from roles/tesstrainer/tasks/tesstraining.yml)9
4 files changed, 13 insertions, 5 deletions
diff --git a/roles/tesstrainer/handlers/main.yml b/roles/tesstrainer/handlers/main.yml
new file mode 100644
index 0000000..12df781
--- /dev/null
+++ b/roles/tesstrainer/handlers/main.yml
@@ -0,0 +1,3 @@
+---
+- name: update ld.so
+ command: /sbin/ldconfig
diff --git a/roles/tesstrainer/tasks/ldlocal.yml b/roles/tesstrainer/tasks/ldlocal.yml
index e817d85..2fd5fac 100644
--- a/roles/tesstrainer/tasks/ldlocal.yml
+++ b/roles/tesstrainer/tasks/ldlocal.yml
@@ -6,6 +6,4 @@
dest: /etc/ld.so.conf.d/locallib.conf
create: true
line: /usr/local/lib
-
-- name: Update ld.so cache
- command: /sbin/ldconfig
+ notify: update ld.so
diff --git a/roles/tesstrainer/tasks/main.yml b/roles/tesstrainer/tasks/main.yml
index e1245fd..33d6a30 100644
--- a/roles/tesstrainer/tasks/main.yml
+++ b/roles/tesstrainer/tasks/main.yml
@@ -1,3 +1,3 @@
---
-- include: tesstraining.yml
+- include: tesseract.yml
- include: ldlocal.yml
diff --git a/roles/tesstrainer/tasks/tesstraining.yml b/roles/tesstrainer/tasks/tesseract.yml
index 0bcbf7a..0be3380 100644
--- a/roles/tesstrainer/tasks/tesstraining.yml
+++ b/roles/tesstrainer/tasks/tesseract.yml
@@ -29,12 +29,13 @@
dest: /home/ec2-user/src/leptonica
version: addinstall
depth: 1
- force: yes
+ register: leptclone
- name: Build leptonica
command: make -f makefile.static SHARED=yes install
args:
chdir: /home/ec2-user/src/leptonica/src
+ when: leptclone.changed
- name: Clone tesseract repository
git:
@@ -42,6 +43,12 @@
dest: /home/ec2-user/src/tesseract
version: amibuild
depth: 1
+ register: tessclone
+
+- name: Build and install tesseract
+ make: chdir=/home/ec2-user/src/tesseract/simplemake target=install
+ when: tessclone.changed
- name: Build and install tesseract training tools
make: chdir=/home/ec2-user/src/tesseract/simplemake target=install-training
+ when: tessclone.changed