# Template file for 'tesseract-ocr'
pkgname=tesseract-ocr
version=3.04.01
revision=1
wrksrc=tesseract-${version}
_tessdata_ver=6c9657715d38cb44aea9135605860b1b61b0e275
build_style=gnu-configure
configure_args="LIBLEPT_HEADERSDIR=${XBPS_CROSS_BASE}/usr/include"
hostmakedepends="automake libtool leptonica"
makedepends="pango-devel leptonica-devel"
short_desc="Tesseract Open Source OCR engine"
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
license="Apache-2.0"
homepage="https://github.com/tesseract-ocr/tesseract"
distfiles="
 https://github.com/tesseract-ocr/tesseract/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz
 https://github.com/tesseract-ocr/tessdata/archive/${_tessdata_ver}.tar.gz>tessdata-${_tessdata_ver}.tar.gz"
checksum="
 57f63e1b14ae04c3932a2683e4be4954a2849e17edd638ffe91bc5a2156adc6a
 9da120aa47fc5f2780fb3bf6a346b502607e2b087d1f6857c6d55d5d003ec567"

# Create a package for one specific language $1
pkg_lang() {
	local f lang=$1
	vmkdir usr/share/tessdata
	for f in $(find ${wrksrc}/tessdata -name "${lang}.*" -o -name "${lang}_frak.*"); do
		vinstall $f 644 usr/share/tessdata
		rm $f
	done
}

post_extract() {
	mv ${XBPS_BUILDDIR}/tessdata-${_tessdata_ver}/* ${wrksrc}/tessdata
	rmdir ${XBPS_BUILDDIR}/tessdata-${_tessdata_ver}
}
pre_configure() {
	cd ${wrksrc}
	# Some include paths are not set in training/Makefile.am ?
	sed -i training/Makefile.am \
		-e "/AM_CPPFLAGS += \\\\/a -I${XBPS_CROSS_BASE}/usr/include/glib-2.0 \\\\" \
		-e "/AM_CPPFLAGS += \\\\/a -I${XBPS_CROSS_BASE}/usr/lib/glib-2.0/include \\\\" \
		-e "/AM_CPPFLAGS += \\\\/a -I${XBPS_CROSS_BASE}/usr/include/pango-1.0 \\\\" \
		-e "/AM_CPPFLAGS += \\\\/a -I${XBPS_CROSS_BASE}/usr/include/cairo \\\\" \
		-e "/AM_CPPFLAGS += \\\\/a -I${XBPS_CROSS_BASE}/usr/include/freetype2 \\\\"
	./autogen.sh
	case "$XBPS_TARGET_MACHINE" in
		*-musl) # Don't re-define off_t for musl libc
			sed -i ${wrksrc}/ccutil/scanutils.cpp \
				-e "/typedef long off_t;/d"
	esac
}
post_install() {
	# Rename binary to avoid conflict with tesseract package
	mv ${DESTDIR}/usr/bin/tesseract{,-ocr}
	mv ${DESTDIR}/usr/share/man/man1/tesseract{,-ocr}.1
	vdoc ChangeLog
	vdoc ReleaseNotes
	vdoc README.md
	vdoc testing/eurotext.tif
	vdoc testing/phototest.tif
	vlicense tessdata/COPYING LICENSE-tessdata
}
tesseract-ocr-tools_package() {
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Tools (development)"
	pkg_install() {
		local f
		make -C training DESTDIR=${DESTDIR} install
		vmkdir usr/share/tesseract
		vmkdir usr/share/man/man1
		vmkdir usr/share/man/man5
		# Copy shell scripts
		for f in language-specific.sh tesstrain.sh tesstrain_utils.sh; do
			if [ -e ${wrksrc}/training/${f} ]; then
				cp -a ${wrksrc}/training/${f} \
					${PKGDESTDIR}/usr/share/tesseract
			fi
		done
		# Move binaries and manual pages
		for f in ambiguous_words classifier_tester cntraining combine_tessdata \
			dawg2wordlist mftraining set_unicharset_properties \
			shapeclustering text2image unicharambigs unicharset \
			unicharset_extractor wordlist2dawg; do
			if [ -e ${DESTDIR}/usr/bin/${f} ]; then
				mv ${DESTDIR}/usr/bin/${f} \
					${PKGDESTDIR}/usr/share/tesseract
			fi
			for n in 1 5; do
				if [ -e ${DESTDIR}/usr/share/man/man${n}/${f}.${n} ]; then
					mv ${DESTDIR}/usr/share/man/man${n}/${f}.${n} \
						${PKGDESTDIR}/usr/share/man/man${n}
				fi
			done
		done
	}
}
tesseract-ocr-devel_package() {
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include/tesseract
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.a"
		vmove "usr/lib/*.so"
	}
}
tesseract-ocr-basic_package() {
	local lang
	noarch=yes
	build_style=meta
	depends="${sourcepkg}>=${version}_${revision}"
	conflicts="tesseract-ocr-all>=0"
	short_desc+=" - basic languages data"
	# A number of basic (mostly European) languages
	for lang in bel dan deu eng equ fin fra hun ita nld nor osd pol por rus spa swe tur; do
		depends+=" tesseract-ocr-${lang}>=${version}_${revision}"
	done
}
tesseract-ocr-all_package() {
	local lang
	noarch=yes
	build_style=meta
	depends="${sourcepkg}>=${version}_${revision}"
	conflicts="tesseract-ocr-basic>=0"
	short_desc+=" - all languages data"
	# All aVailable languages
	for lang in afr amh ara asm aze aze_cyrl bel ben bod bos bul cat ceb \
		ces chi_sim chi_tra chr cym dan deu dzo ell eng enm epo equ est eus \
		fas fin fra frk frm gle glg grc guj hat heb hin hrv hun iku ind isl ita \
		ita_old jav jpn kan kat kat_old kaz khm kir kor kur lao lat lav lit mal mar \
		mkd mlt msa mya nep nld nor ori osd pan pol por pus ron rus san sin slk slv \
		spa spa_old sqi srp srp_latn swa swe syr tam tel tgk tgl tha tir tur \
		uig ukr urd uzb uzb_cyrl vie yid; do
		depends+=" tesseract-ocr-${lang}>=${version}_${revision}"
	done
}
tesseract-ocr-afr_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Afrikaans language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-amh_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Amharic language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-ara_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Arabic language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-asm_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Assamese language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-aze_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Azerbaijani language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-aze_cyrl_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Azerbaijani (cyrillic) language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-bel_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Belarusian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-ben_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Bengali language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-bod_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Tibetan language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-bos_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Bosnian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-bul_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Bulgarian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-cat_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Catalan language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-ceb_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Cebuano language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-ces_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Czech language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-chi_sim_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Chinese (Simplified) language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-chi_tra_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Chinese (Traditional) language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-chr_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Cherokee language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-cym_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Welsh language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-dan_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Danish language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-deu_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - German language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-dzo_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Dzongkha language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-ell_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Greek language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-eng_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - English language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-enm_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Middle English (1100-1500) language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-epo_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Esperanto language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-equ_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Math / equation detection module"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-est_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Estonian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-eus_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Basque language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-fas_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Persian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-fin_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Finnish language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-fra_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - French language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-frk_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Frankish language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-frm_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Middle French (ca. 1400-1600) language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-gle_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Irish language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-glg_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Galician language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-grc_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Ancient Greek Language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-guj_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Gujarati Language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-hat_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Haitian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-heb_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Hebrew language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-hin_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Hindi language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-hrv_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Croatian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-hun_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Hungarian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-iku_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Inuktitut language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-ind_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Indonesian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-isl_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Icelandic language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-ita_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Italian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-ita_old_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Italian (Old) language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-jav_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Javanese language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-jpn_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Japanese language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-kan_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Kannada language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-kat_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Georgian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-kat_old_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Georgian (old) language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-kaz_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Kazakh language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-khm_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Central Khmer language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-kir_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Kirghiz language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-kor_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Korean language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-kur_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Kurdish language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-lao_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Lao language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-lat_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Latin language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-lav_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Latvian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-lit_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Lithuanian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-mal_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Malayalam language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-mar_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Marathi language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-mkd_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Macedonian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-mlt_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Maltese language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-msa_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Malay language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-mya_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Burmese language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-nep_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Nepalese language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-nld_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Dutch language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-nor_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Norwegian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-ori_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Oriya language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-osd_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	# No ISO639 code?
	short_desc+=" - OSD language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-pan_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Panjabi language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-pol_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Polish language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-por_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Portuguese language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-pus_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Pushto language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-ron_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Romanian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-rus_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Russian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-san_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Sanskrit language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-sin_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Sinhala language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-slk_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Slovakian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-slv_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Slovenian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-spa_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Spanish language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-spa_old_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Spanish (Old) language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-sqi_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Albanian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-srp_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Serbian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-srp_latn_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Serbian (Latin) language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-swa_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Swahili language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-swe_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Swedish language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-syr_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Syriac language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-tam_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Tamil language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-tel_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Telugu language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-tgk_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Tajik language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-tgl_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Tagalog language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-tha_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Thai language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-tir_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Tigrinya language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-tur_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Turkish language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-uig_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Uighur language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-ukr_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Ukrainian language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-urd_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Urdu language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-uzb_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Uzbek language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-uzb_cyrl_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Uzbek (Cyrillic) language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-vie_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Vietnamese language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
tesseract-ocr-yid_package() {
	noarch=yes
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Yiddish language data"
	pkg_install() {
		$(pkg_lang ${pkgname#tesseract-ocr-})
	}
}
