You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.0 KiB

  1. # Copyright (C) 2019 Valentín Kivachuk <vk18496@gmail.com>
  2. #
  3. # This is free software, licensed under the GNU General Public License v2.
  4. # See /LICENSE for more information.
  5. #
  6. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=tessdata
  8. PKG_VERSION:=4.1.0
  9. PKG_RELEASE:=$(AUTORELEASE)
  10. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  11. PKG_SOURCE_URL:=https://codeload.github.com/tesseract-ocr/tessdata/tar.gz/$(PKG_VERSION)?
  12. PKG_HASH:=990fffb9b7a9b52dc9a2d053a9ef6852ca2b72bd8dfb22988b0b990a700fd3c7
  13. PKG_MAINTAINER:=Valentín Kivachuk <vk18496@gmail.com>
  14. PKG_LICENSE:=Apache-2.0
  15. PKG_LICENSE_FILES:=COPYING
  16. #No need to extract 1,5GB...
  17. PKG_UNPACK:=
  18. include $(INCLUDE_DIR)/package.mk
  19. ALLTESSERACTLANG:=afr amh ara asm aze aze_cyrl bel ben bod bos bre bul cat ceb ces chi_sim chi_sim_vert chi_tra chi_tra_vert chr cos cym dan dan_frak deu deu_frak div dzo ell eng enm epo equ est eus fao fas fil fin fra frk frm fry gla gle glg grc guj hat heb hin hrv hun hye iku ind isl ita ita_old jav jpn jpn_vert kan kat kat_old kaz khm kir kmr kor kor_vert lao lat lav lit ltz mal mar mkd mlt mon mri msa mya nep nld nor oci ori osd pan pol por pus que ron rus san sin slk slk_frak slv snd spa spa_old sqi srp srp_latn sun swa swe syr tam tat tel tgk tgl tha tir ton tur uig ukr urd uzb uzb_cyrl vie yid yor
  20. define Build/Compile
  21. endef
  22. define Build/Install
  23. endef
  24. define Package/tesseract-data-default
  25. SECTION:=utils
  26. CATEGORY:=Utilities
  27. DEPENDS:=tesseract
  28. endef
  29. define generate-tesseract-data-package
  30. define Package/tesseract-data-$(1)
  31. TITLE:=Training data for $(1) language
  32. $(call Package/tesseract-data-default)
  33. endef
  34. define Package/tesseract-data-$(1)/install
  35. $(INSTALL_DIR) $$(1)/usr/share/tessdata
  36. $(TAR) --strip=1 -C $$(1)/usr/share/tessdata/ -xvf $(DL_DIR)/$(PKG_NAME)-$(PKG_VERSION).tar.gz $(PKG_NAME)-$(PKG_VERSION)/$(1).traineddata
  37. endef
  38. endef
  39. $(foreach LANG,$(ALLTESSERACTLANG),$(eval $(call generate-tesseract-data-package,$(LANG))))
  40. $(foreach LANG,$(ALLTESSERACTLANG),$(eval $(call BuildPackage,tesseract-data-$(LANG))))