diff options
Diffstat (limited to 'roles/tesseractor')
-rw-r--r-- | roles/tesseractor/tasks/main.yml | 2 | ||||
-rw-r--r-- | roles/tesseractor/tasks/tesseract.yml | 56 |
2 files changed, 58 insertions, 0 deletions
diff --git a/roles/tesseractor/tasks/main.yml b/roles/tesseractor/tasks/main.yml new file mode 100644 index 0000000..48f791f --- /dev/null +++ b/roles/tesseractor/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include: tesseract.yml diff --git a/roles/tesseractor/tasks/tesseract.yml b/roles/tesseractor/tasks/tesseract.yml new file mode 100644 index 0000000..5e04296 --- /dev/null +++ b/roles/tesseractor/tasks/tesseract.yml @@ -0,0 +1,56 @@ +--- +# Installs tesseract + +- name: Install tesseract dependencies + package: name={{ item }} state=present + with_items: + - gcc-c++ + - make + - libpng12-devel + - libjpeg-turbo-devel + - libtiff-devel + - zlib-devel + +- name: Install tesseract training dependencies + package: name={{ item }} state=present + with_items: + - libicu-devel + - pango-devel + - cairo-devel + +- name: Install extra tesseract development dependencies + package: name={{ item }} state=present + with_items: + - git + +- name: Clone leptonica repository + git: + repo: https://github.com/nickjwhite/leptonica + dest: /home/ec2-user/src/leptonica + version: addinstall + depth: 1 + +- name: Configure leptonica environ.h + lineinfile: + dest: /home/ec2-user/src/leptonica/src/environ.h + line: "{{ item }}" + insertbefore: "^#endif * LEPTONICA_ENVIRON_H" + with_items: + - "#define HAVE_FMEMOPEN 1" + - "#define HAVE_FSTATAT 1" + +- name: Build leptonica + make: + chdir: /home/ec2-user/src/leptonica/src + target: "-f makefile.static install" + params: SHARED=yes + +- name: Clone tesseract repository + git: + repo: https://github.com/nickjwhite/tesseract + dest: /home/ec2-user/src/tesseract + version: simplemakev4 + depth: 1 + +- name: Build and install tesseract + make: chdir=/home/ec2-user/src/tesseract target=install |