From 75758d6a903e7f5dbd9e201f08fb32e47315ec25 Mon Sep 17 00:00:00 2001
From: Gilles Talis <gilles.talis@gmail.com>
Date: Fri, 8 May 2015 21:53:09 +0200
Subject: [PATCH 2/2] tesseract-ocr: new package

Signed-off-by: Gilles Talis <gilles.talis@gmail.com>
---
 package/Config.in                                  |    1 +
 package/tesseract/Config.in                        |    2 +
 package/tesseract/tesseract-ocr-chi-sim/Config.in  |    6 +++
 .../tesseract-ocr-chi-sim/tesseract-ocr-chi-sim.mk |   20 ++++++++
 package/tesseract/tesseract-ocr-chi-tra/Config.in  |    6 +++
 .../tesseract-ocr-chi-tra/tesseract-ocr-chi-tra.mk |   20 ++++++++
 package/tesseract/tesseract-ocr-deu/Config.in      |    5 ++
 .../tesseract-ocr-deu/tesseract-ocr-deu.mk         |   21 +++++++++
 package/tesseract/tesseract-ocr-eng/Config.in      |    5 ++
 .../tesseract-ocr-eng/tesseract-ocr-eng.mk         |   20 ++++++++
 package/tesseract/tesseract-ocr-fra/Config.in      |    5 ++
 .../tesseract-ocr-fra/tesseract-ocr-fra.mk         |   20 ++++++++
 package/tesseract/tesseract-ocr-hin/Config.in      |    5 ++
 .../tesseract-ocr-hin/tesseract-ocr-hin.mk         |   20 ++++++++
 package/tesseract/tesseract-ocr-jpn/Config.in      |    5 ++
 .../tesseract-ocr-jpn/tesseract-ocr-jpn.mk         |   20 ++++++++
 package/tesseract/tesseract-ocr-kor/Config.in      |    6 +++
 .../tesseract-ocr-kor/tesseract-ocr-kor.mk         |   20 ++++++++
 package/tesseract/tesseract-ocr-nld/Config.in      |    5 ++
 .../tesseract-ocr-nld/tesseract-ocr-nld.mk         |   21 +++++++++
 package/tesseract/tesseract-ocr-rus/Config.in      |    6 +++
 .../tesseract-ocr-rus/tesseract-ocr-rus.mk         |   20 ++++++++
 package/tesseract/tesseract-ocr-spa/Config.in      |    5 ++
 .../tesseract-ocr-spa/tesseract-ocr-spa.mk         |   20 ++++++++
 package/tesseract/tesseract.mk                     |    1 +
 package/tesseract/tesseract/Config.in              |   49 ++++++++++++++++++++
 package/tesseract/tesseract/tesseract.mk           |   22 +++++++++
 27 files changed, 356 insertions(+)
 create mode 100644 package/tesseract/Config.in
 create mode 100644 package/tesseract/tesseract-ocr-chi-sim/Config.in
 create mode 100644 package/tesseract/tesseract-ocr-chi-sim/tesseract-ocr-chi-sim.mk
 create mode 100644 package/tesseract/tesseract-ocr-chi-tra/Config.in
 create mode 100644 package/tesseract/tesseract-ocr-chi-tra/tesseract-ocr-chi-tra.mk
 create mode 100644 package/tesseract/tesseract-ocr-deu/Config.in
 create mode 100644 package/tesseract/tesseract-ocr-deu/tesseract-ocr-deu.mk
 create mode 100644 package/tesseract/tesseract-ocr-eng/Config.in
 create mode 100644 package/tesseract/tesseract-ocr-eng/tesseract-ocr-eng.mk
 create mode 100644 package/tesseract/tesseract-ocr-fra/Config.in
 create mode 100644 package/tesseract/tesseract-ocr-fra/tesseract-ocr-fra.mk
 create mode 100644 package/tesseract/tesseract-ocr-hin/Config.in
 create mode 100644 package/tesseract/tesseract-ocr-hin/tesseract-ocr-hin.mk
 create mode 100644 package/tesseract/tesseract-ocr-jpn/Config.in
 create mode 100644 package/tesseract/tesseract-ocr-jpn/tesseract-ocr-jpn.mk
 create mode 100644 package/tesseract/tesseract-ocr-kor/Config.in
 create mode 100644 package/tesseract/tesseract-ocr-kor/tesseract-ocr-kor.mk
 create mode 100644 package/tesseract/tesseract-ocr-nld/Config.in
 create mode 100644 package/tesseract/tesseract-ocr-nld/tesseract-ocr-nld.mk
 create mode 100644 package/tesseract/tesseract-ocr-rus/Config.in
 create mode 100644 package/tesseract/tesseract-ocr-rus/tesseract-ocr-rus.mk
 create mode 100644 package/tesseract/tesseract-ocr-spa/Config.in
 create mode 100644 package/tesseract/tesseract-ocr-spa/tesseract-ocr-spa.mk
 create mode 100644 package/tesseract/tesseract.mk
 create mode 100644 package/tesseract/tesseract/Config.in
 create mode 100644 package/tesseract/tesseract/tesseract.mk

diff --git a/package/Config.in b/package/Config.in
index 5b9d18a..e996fed 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -169,6 +169,7 @@ source "package/sdl_sound/Config.in"
 source "package/sdl_net/Config.in"
 source "package/sdl_ttf/Config.in"
 source "package/sdl_gfx/Config.in"
+source "package/tesseract/Config.in"
 
 comment "other GUIs"
 source "package/efl/Config.in"
diff --git a/package/tesseract/Config.in b/package/tesseract/Config.in
new file mode 100644
index 0000000..e8710ec
--- /dev/null
+++ b/package/tesseract/Config.in
@@ -0,0 +1,2 @@
+# Tesseract engine & language training data
+source "package/tesseract/tesseract/Config.in"
diff --git a/package/tesseract/tesseract-ocr-chi-sim/Config.in b/package/tesseract/tesseract-ocr-chi-sim/Config.in
new file mode 100644
index 0000000..5b14d53
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-chi-sim/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_TESSERACT_OCR_CHI_SIM
+	bool "Simplified Chinese language support"
+	depends on BR2_PACKAGE_TESSERACT
+	help
+	  This will install the simplified chinese training data file
+	  for tesseract
diff --git a/package/tesseract/tesseract-ocr-chi-sim/tesseract-ocr-chi-sim.mk b/package/tesseract/tesseract-ocr-chi-sim/tesseract-ocr-chi-sim.mk
new file mode 100644
index 0000000..632685d
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-chi-sim/tesseract-ocr-chi-sim.mk
@@ -0,0 +1,20 @@
+################################################################################
+#
+# tesseract simplified chinese language training data
+#
+################################################################################
+
+TESSERACT_OCR_CHI_SIM_VERSION = 3.02
+TESSERACT_OCR_CHI_SIM_SOURCE = tesseract-ocr-$(TESSERACT_OCR_CHI_SIM_VERSION).chi_sim.tar.gz
+TESSERACT_OCR_CHI_SIM_SITE = http://tesseract-ocr.googlecode.com/files/
+
+define TESSERACT_OCR_CHI_SIM_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0644 -D $(@D)/tessdata/chi_sim.traineddata \
+		$(TARGET_DIR)/usr/share/tessdata/chi_sim.traineddata
+endef
+
+define TESSERACT_OCR_CHI_SIM_UNINSTALL_TARGET_CMDS
+	rm -f $(TARGET_DIR)/usr/share/tessdata/chi_sim.traineddata
+endef
+
+$(eval $(generic-package))
diff --git a/package/tesseract/tesseract-ocr-chi-tra/Config.in b/package/tesseract/tesseract-ocr-chi-tra/Config.in
new file mode 100644
index 0000000..23ba9ee
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-chi-tra/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_TESSERACT_OCR_CHI_TRA
+	bool "Traditional Chinese language support"
+	depends on BR2_PACKAGE_TESSERACT
+	help
+	  This will install the traditional chinese training data file
+	  for tesseract
diff --git a/package/tesseract/tesseract-ocr-chi-tra/tesseract-ocr-chi-tra.mk b/package/tesseract/tesseract-ocr-chi-tra/tesseract-ocr-chi-tra.mk
new file mode 100644
index 0000000..70f70f4
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-chi-tra/tesseract-ocr-chi-tra.mk
@@ -0,0 +1,20 @@
+################################################################################
+#
+# tesseract traditional chinese training data
+#
+################################################################################
+
+TESSERACT_OCR_CHI_TRA_VERSION = 3.02
+TESSERACT_OCR_CHI_TRA_SOURCE = tesseract-ocr-$(TESSERACT_OCR_CHI_TRA_VERSION).chi_tra.tar.gz
+TESSERACT_OCR_CHI_TRA_SITE = http://tesseract-ocr.googlecode.com/files/
+
+define TESSERACT_OCR_CHI_TRA_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0644 -D $(@D)/tessdata/chi_tra.traineddata \
+		$(TARGET_DIR)/usr/share/tessdata/chi_tra.traineddata
+endef
+
+define TESSERACT_OCR_CHI_TRA_UNINSTALL_TARGET_CMDS
+	rm -f $(TARGET_DIR)/usr/share/tessdata/chi_tra.traineddata
+endef
+
+$(eval $(generic-package))
diff --git a/package/tesseract/tesseract-ocr-deu/Config.in b/package/tesseract/tesseract-ocr-deu/Config.in
new file mode 100644
index 0000000..9910c35
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-deu/Config.in
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_TESSERACT_OCR_DEU
+	bool "German language support"
+	depends on BR2_PACKAGE_TESSERACT
+	help
+	  This will install the german language training data file for tesseract
diff --git a/package/tesseract/tesseract-ocr-deu/tesseract-ocr-deu.mk b/package/tesseract/tesseract-ocr-deu/tesseract-ocr-deu.mk
new file mode 100644
index 0000000..1c95923
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-deu/tesseract-ocr-deu.mk
@@ -0,0 +1,21 @@
+################################################################################
+#
+# tesseract german language training data
+#
+################################################################################
+
+TESSERACT_OCR_DEU_VERSION = 3.02
+TESSERACT_OCR_LANGUAGE = deu
+TESSERACT_OCR_DEU_SOURCE = tesseract-ocr-$(TESSERACT_OCR_DEU_VERSION).$(TESSERACT_OCR_LANGUAGE).tar.gz
+TESSERACT_OCR_DEU_SITE = http://tesseract-ocr.googlecode.com/files/
+
+define TESSERACT_OCR_DEU_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0644 -D $(@D)/tessdata/$(TESSERACT_OCR_LANGUAGE).traineddata \
+		$(TARGET_DIR)/usr/share/tessdata/$(TESSERACT_OCR_LANGUAGE).traineddata
+endef
+
+define TESSERACT_OCR_DEU_UNINSTALL_TARGET_CMDS
+	rm -f $(TARGET_DIR)/usr/share/tessdata/$(TESSERACT_OCR_LANGUAGE).traineddata
+endef
+
+$(eval $(generic-package))
diff --git a/package/tesseract/tesseract-ocr-eng/Config.in b/package/tesseract/tesseract-ocr-eng/Config.in
new file mode 100644
index 0000000..ab01a8c
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-eng/Config.in
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_TESSERACT_OCR_ENG
+	bool "English language support"
+	depends on BR2_PACKAGE_TESSERACT
+	help
+	  This will install the english training data file for tesseract
diff --git a/package/tesseract/tesseract-ocr-eng/tesseract-ocr-eng.mk b/package/tesseract/tesseract-ocr-eng/tesseract-ocr-eng.mk
new file mode 100644
index 0000000..d31b7f8
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-eng/tesseract-ocr-eng.mk
@@ -0,0 +1,20 @@
+################################################################################
+#
+# tesseract english language training data
+#
+################################################################################
+
+TESSERACT_OCR_ENG_VERSION = 3.02
+TESSERACT_OCR_ENG_SOURCE = tesseract-ocr-$(TESSERACT_OCR_ENG_VERSION).eng.tar.gz
+TESSERACT_OCR_ENG_SITE = http://tesseract-ocr.googlecode.com/files/
+
+define TESSERACT_OCR_ENG_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0644 -D $(@D)/tessdata/eng.traineddata \
+		$(TARGET_DIR)/usr/share/tessdata/eng.traineddata
+endef
+
+define TESSERACT_OCR_ENG_UNINSTALL_TARGET_CMDS
+	rm -f $(TARGET_DIR)/usr/share/tessdata/eng.traineddata
+endef
+
+$(eval $(generic-package))
diff --git a/package/tesseract/tesseract-ocr-fra/Config.in b/package/tesseract/tesseract-ocr-fra/Config.in
new file mode 100644
index 0000000..ead28a8
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-fra/Config.in
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_TESSERACT_OCR_FRA
+	bool "French language support"
+	depends on BR2_PACKAGE_TESSERACT
+	help
+	  This will install the french training data file for tesseract
diff --git a/package/tesseract/tesseract-ocr-fra/tesseract-ocr-fra.mk b/package/tesseract/tesseract-ocr-fra/tesseract-ocr-fra.mk
new file mode 100644
index 0000000..c26984d
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-fra/tesseract-ocr-fra.mk
@@ -0,0 +1,20 @@
+################################################################################
+#
+# tesseract french language training data
+#
+################################################################################
+
+TESSERACT_OCR_FRA_VERSION = 3.02
+TESSERACT_OCR_FRA_SOURCE = tesseract-ocr-$(TESSERACT_OCR_FRA_VERSION).fra.tar.gz
+TESSERACT_OCR_FRA_SITE = http://tesseract-ocr.googlecode.com/files/
+
+define TESSERACT_OCR_FRA_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0644 -D $(@D)/tessdata/fra.traineddata \
+		$(TARGET_DIR)/usr/share/tessdata/fra.traineddata
+endef
+
+define TESSERACT_OCR_FRA_UNINSTALL_TARGET_CMDS
+	rm -f $(TARGET_DIR)/usr/share/tessdata/fra.traineddata
+endef
+
+$(eval $(generic-package))
diff --git a/package/tesseract/tesseract-ocr-hin/Config.in b/package/tesseract/tesseract-ocr-hin/Config.in
new file mode 100644
index 0000000..a180a99
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-hin/Config.in
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_TESSERACT_OCR_HIN
+	bool "Hindi language support"
+	depends on BR2_PACKAGE_TESSERACT
+	help
+	  This will install the hindi language training data file for tesseract
diff --git a/package/tesseract/tesseract-ocr-hin/tesseract-ocr-hin.mk b/package/tesseract/tesseract-ocr-hin/tesseract-ocr-hin.mk
new file mode 100644
index 0000000..f849718
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-hin/tesseract-ocr-hin.mk
@@ -0,0 +1,20 @@
+################################################################################
+#
+# tesseract hindi language training data
+#
+################################################################################
+
+TESSERACT_OCR_HIN_VERSION = 3.02
+TESSERACT_OCR_HIN_SOURCE = tesseract-ocr-$(TESSERACT_OCR_VERSION).hin.tar.gz
+TESSERACT_OCR_HIN_SITE = http://tesseract-ocr.googlecode.com/files/
+
+define TESSERACT_OCR_HIN_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0644 -D $(@D)/tessdata/hin.traineddata \
+		$(TARGET_DIR)/usr/share/tessdata/hin.traineddata
+endef
+
+define TESSERACT_OCR_HIN_UNINSTALL_TARGET_CMDS
+	rm -f $(TARGET_DIR)/usr/share/tessdata/hin.traineddata
+endef
+
+$(eval $(generic-package))
diff --git a/package/tesseract/tesseract-ocr-jpn/Config.in b/package/tesseract/tesseract-ocr-jpn/Config.in
new file mode 100644
index 0000000..ac5820e
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-jpn/Config.in
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_TESSERACT_OCR_JPN
+	bool "Japanese language support"
+	depends on BR2_PACKAGE_TESSERACT
+	help
+	  This will install the japanese training data file for tesseract
diff --git a/package/tesseract/tesseract-ocr-jpn/tesseract-ocr-jpn.mk b/package/tesseract/tesseract-ocr-jpn/tesseract-ocr-jpn.mk
new file mode 100644
index 0000000..c83d543
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-jpn/tesseract-ocr-jpn.mk
@@ -0,0 +1,20 @@
+################################################################################
+#
+# tesseract japanese language training data
+#
+################################################################################
+
+TESSERACT_OCR_JPN_VERSION = 3.02
+TESSERACT_OCR_JPN_SOURCE = tesseract-ocr-$(TESSERACT_OCR_JPN_VERSION).jpn.tar.gz
+TESSERACT_OCR_JPN_SITE = http://tesseract-ocr.googlecode.com/files/
+
+define TESSERACT_OCR_JPN_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0644 -D $(@D)/tessdata/jpn.traineddata \
+		$(TARGET_DIR)/usr/share/tessdata/jpn.traineddata
+endef
+
+define TESSERACT_OCR_JPN_UNINSTALL_TARGET_CMDS
+	rm -f $(TARGET_DIR)/usr/share/tessdata/jpn.traineddata
+endef
+
+$(eval $(generic-package))
diff --git a/package/tesseract/tesseract-ocr-kor/Config.in b/package/tesseract/tesseract-ocr-kor/Config.in
new file mode 100644
index 0000000..3c315dd
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-kor/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_TESSERACT_OCR_KOR
+	bool "Korean language support"
+	depends on BR2_PACKAGE_TESSERACT
+	help
+	  This will install the korean language training data file
+	  for tesseract
diff --git a/package/tesseract/tesseract-ocr-kor/tesseract-ocr-kor.mk b/package/tesseract/tesseract-ocr-kor/tesseract-ocr-kor.mk
new file mode 100644
index 0000000..6a8cd07
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-kor/tesseract-ocr-kor.mk
@@ -0,0 +1,20 @@
+################################################################################
+#
+# tesseract korean language training data
+#
+################################################################################
+
+TESSERACT_OCR_KOR_VERSION = 3.02
+TESSERACT_OCR_KOR_SOURCE = tesseract-ocr-$(TESSERACT_OCR_KOR_VERSION).kor.tar.gz
+TESSERACT_OCR_KOR_SITE = http://tesseract-ocr.googlecode.com/files/
+
+define TESSERACT_OCR_KOR_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0644 -D $(@D)/tessdata/kor.traineddata \
+		$(TARGET_DIR)/usr/share/tessdata/kor.traineddata
+endef
+
+define TESSERACT_OCR_KOR_UNINSTALL_TARGET_CMDS
+	rm -f $(TARGET_DIR)/usr/share/tessdata/kor.traineddata
+endef
+
+$(eval $(generic-package))
diff --git a/package/tesseract/tesseract-ocr-nld/Config.in b/package/tesseract/tesseract-ocr-nld/Config.in
new file mode 100644
index 0000000..9041888
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-nld/Config.in
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_TESSERACT_OCR_NLD
+	bool "Dutch language support"
+	depends on BR2_PACKAGE_TESSERACT
+	help
+	  This installs the dutch language training data file for tesseract
diff --git a/package/tesseract/tesseract-ocr-nld/tesseract-ocr-nld.mk b/package/tesseract/tesseract-ocr-nld/tesseract-ocr-nld.mk
new file mode 100644
index 0000000..f20bbac
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-nld/tesseract-ocr-nld.mk
@@ -0,0 +1,21 @@
+################################################################################
+#
+# tesseract dutch language training data
+#
+################################################################################
+
+TESSERACT_OCR_NLD_VERSION = 3.02
+TESSERACT_OCR_LANGUAGE = nld
+TESSERACT_OCR_NLD_SOURCE = tesseract-ocr-$(TESSERACT_OCR_NLD_VERSION).nld.tar.gz
+TESSERACT_OCR_NLD_SITE = http://tesseract-ocr.googlecode.com/files/
+
+define TESSERACT_OCR_NLD_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0644 -D $(@D)/tessdata/nld.traineddata \
+		$(TARGET_DIR)/usr/share/tessdata/nld.traineddata
+endef
+
+define TESSERACT_OCR_NLD_UNINSTALL_TARGET_CMDS
+	rm -f $(TARGET_DIR)/usr/share/tessdata/nld.traineddata
+endef
+
+$(eval $(generic-package))
diff --git a/package/tesseract/tesseract-ocr-rus/Config.in b/package/tesseract/tesseract-ocr-rus/Config.in
new file mode 100644
index 0000000..b769f84
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-rus/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_TESSERACT_OCR_RUS
+	bool "Russian language support"
+	depends on BR2_PACKAGE_TESSERACT
+	help
+	  This will install the russian language training data file
+	  for tesseract
diff --git a/package/tesseract/tesseract-ocr-rus/tesseract-ocr-rus.mk b/package/tesseract/tesseract-ocr-rus/tesseract-ocr-rus.mk
new file mode 100644
index 0000000..7adcb05
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-rus/tesseract-ocr-rus.mk
@@ -0,0 +1,20 @@
+################################################################################
+#
+# tesseract russian language training data
+#
+################################################################################
+
+TESSERACT_OCR_RUS_VERSION = 3.02
+TESSERACT_OCR_RUS_SOURCE = tesseract-ocr-$(TESSERACT_OCR_RUS_VERSION).rus.tar.gz
+TESSERACT_OCR_RUS_SITE = http://tesseract-ocr.googlecode.com/files/
+
+define TESSERACT_OCR_RUS_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0644 -D $(@D)/tessdata/rus.traineddata \
+		$(TARGET_DIR)/usr/share/tessdata/rus.traineddata
+endef
+
+define TESSERACT_OCR_RUS_UNINSTALL_TARGET_CMDS
+	rm -f $(TARGET_DIR)/usr/share/tessdata/rus.traineddata
+endef
+
+$(eval $(generic-package))
diff --git a/package/tesseract/tesseract-ocr-spa/Config.in b/package/tesseract/tesseract-ocr-spa/Config.in
new file mode 100644
index 0000000..cd23356
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-spa/Config.in
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_TESSERACT_OCR_SPA
+	bool "Spanish language support"
+	depends on BR2_PACKAGE_TESSERACT
+	help
+	  This will install the spanish training data file for tesseract
diff --git a/package/tesseract/tesseract-ocr-spa/tesseract-ocr-spa.mk b/package/tesseract/tesseract-ocr-spa/tesseract-ocr-spa.mk
new file mode 100644
index 0000000..98ff6eb
--- /dev/null
+++ b/package/tesseract/tesseract-ocr-spa/tesseract-ocr-spa.mk
@@ -0,0 +1,20 @@
+################################################################################
+#
+# tesseract spanish language training data
+#
+################################################################################
+
+TESSERACT_OCR_SPA_VERSION = 3.02
+TESSERACT_OCR_SPA_SOURCE = tesseract-ocr-$(TESSERACT_OCR_SPA_VERSION).spa.tar.gz
+TESSERACT_OCR_SPA_SITE = http://tesseract-ocr.googlecode.com/files/
+
+define TESSERACT_OCR_SPA_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0644 -D $(@D)/tessdata/spa.traineddata \
+		$(TARGET_DIR)/usr/share/tessdata/spa.traineddata
+endef
+
+define TESSERACT_OCR_SPA_UNINSTALL_TARGET_CMDS
+	rm -f $(TARGET_DIR)/usr/share/tessdata/spa.traineddata
+endef
+
+$(eval $(generic-package))
diff --git a/package/tesseract/tesseract.mk b/package/tesseract/tesseract.mk
new file mode 100644
index 0000000..1308b27
--- /dev/null
+++ b/package/tesseract/tesseract.mk
@@ -0,0 +1 @@
+include package/tesseract/*/*.mk
diff --git a/package/tesseract/tesseract/Config.in b/package/tesseract/tesseract/Config.in
new file mode 100644
index 0000000..fbca862
--- /dev/null
+++ b/package/tesseract/tesseract/Config.in
@@ -0,0 +1,49 @@
+config BR2_PACKAGE_TESSERACT
+	bool "tesseract"
+	depends on BR2_INSTALL_LIBSTDCPP
+	select BR2_PACKAGE_LEPTONICA
+	select BR2_PACKAGE_TESSERACT_OCR_ENG
+	help
+	  Tesseract is an OCR (Optical Character Recognition) engine,
+	  It can be used directly, or (for programmers) using an API.
+	  It supports a wide variety of languages.
+
+	  http://code.google.com/p/tesseract-ocr/
+
+comment "tesseract needs a toolchain with C++ support"
+	depends on !BR2_INSTALL_LIBSTDCPP
+
+
+if BR2_PACKAGE_TESSERACT
+	menu "tesseract image file format support"
+
+	config BR2_PACKAGE_TESSERACT_JPEG
+		bool "enable JPEG file format support"
+		select BR2_PACKAGE_JPEG
+		default y
+
+	config BR2_PACKAGE_TESSERACT_PNG
+		bool "enable PNG file format support"
+		select BR2_PACKAGE_LIBPNG
+		default y
+
+	config BR2_PACKAGE_TESSERACT_TIFF
+		bool "enable TIFF file format support"
+		select BR2_PACKAGE_TIFF
+
+	endmenu
+
+	menu "tesseract language support"
+		source "package/tesseract/tesseract-ocr-eng/Config.in"
+		source "package/tesseract/tesseract-ocr-fra/Config.in"
+		source "package/tesseract/tesseract-ocr-spa/Config.in"
+		source "package/tesseract/tesseract-ocr-deu/Config.in"
+		source "package/tesseract/tesseract-ocr-chi-sim/Config.in"
+		source "package/tesseract/tesseract-ocr-chi-tra/Config.in"
+		source "package/tesseract/tesseract-ocr-jpn/Config.in"
+		source "package/tesseract/tesseract-ocr-rus/Config.in"
+		source "package/tesseract/tesseract-ocr-nld/Config.in"
+		source "package/tesseract/tesseract-ocr-hin/Config.in"
+		source "package/tesseract/tesseract-ocr-kor/Config.in"
+	endmenu
+endif
diff --git a/package/tesseract/tesseract/tesseract.mk b/package/tesseract/tesseract/tesseract.mk
new file mode 100644
index 0000000..77ae756
--- /dev/null
+++ b/package/tesseract/tesseract/tesseract.mk
@@ -0,0 +1,22 @@
+################################################################################
+#
+# tesseract
+#
+################################################################################
+
+TESSERACT_VERSION = 3.02.02
+TESSERACT_SOURCE = tesseract-$(TESSERACT_VERSION).tar.gz
+TESSERACT_SITE = http://tesseract-ocr.googlecode.com/files
+TESSERACT_LICENSE = Apache-2.0
+TESSERACT_LICENSE_FILES = COPYING
+
+TESSERACT_DEPENDENCIES += leptonica \
+	$(if $(BR2_PACKAGE_TESSERACT_JPEG),jpeg) \
+	$(if $(BR2_PACKAGE_TESSERACT_PNG),libpng) \
+	$(if $(BR2_PACKAGE_TESSERACT_TIFF),tiff)
+
+TESSERACT_INSTALL_STAGING = YES
+
+TESSERACT_CONF_ENV += LIBLEPT_HEADERSDIR=$(STAGING_DIR)/usr/include/leptonica
+
+$(eval $(autotools-package))
-- 
1.7.10.4

