# Template file for 'tesseract-ocr'
pkgname=tesseract-ocr
version=3.02.02
revision=2
wrksrc=$pkgname
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://code.google.com/p/tesseract-ocr/"
_distsite="https://${pkgname}.googlecode.com/files"
distfiles="${_distsite}/${pkgname}-${version}.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.afr.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.ara.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.aze.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.bel.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.ben.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.bul.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.cat.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.ces.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.chi_sim.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.chi_tra.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.chr.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.dan.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.deu.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.ell.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.eng.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.enm.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.epo.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.epo_alt.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.equ.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.est.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.eus.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.fin.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.fra.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.frk.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.frm.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.glg.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.grc.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.heb.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.hin.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.hrv.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.hun.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.ind.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.isl.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.ita.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.ita_old.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.jpn.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.kan.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.kor.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.lav.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.lit.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.mal.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.mkd.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.mlt.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.msa.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.nld.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.nor.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.pol.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.por.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.ron.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.rus.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.slk.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.slv.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.spa.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.spa_old.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.sqi.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.srp.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.swa.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.swe.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.tam.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.tel.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.tgl.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.tha.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.tur.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.ukr.tar.gz
 ${_distsite}/${pkgname}-${version%.*}.vie.tar.gz"

checksum="26cd39cb3f2a6f6f1bf4050d1cc0aae35edee49eb49a92df3cb7f9487caa013d
[encoded data, 4224 characters]
 a113254882eac70168aec00544805e7c9cec20527217b98349ed48f6e2d2611e"

pre_configure() {
	cd ${wrksrc}
	./autogen.sh
}
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 README
	vdoc eurotext.tif
	vdoc phototest.tif
}
tesseract-ocr-tools_package() {
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Tools (development)"
	pkg_install() {
		local f
		vmkdir usr/share/tesseract
		vmkdir usr/share/man/man1
		vmkdir usr/share/man/man5
		for f in ambiguous_words classifier_tester cntraining combine_tessdata \
			dawg2wordlist mftraining shapeclustering 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="tesseract-ocr>=${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
	depends="tesseract-ocr>=${version}_${revision}"
	conflics="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 pol por rus spa swe tur; do
		depends+=" tesseract-ocr-${lang}>=${version}_${revision}"
	done
}
tesseract-ocr-all_package() {
	local lang
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	conflics="tesseract-ocr-basic>=0"
	short_desc+=" - All languages data"
	# All available languages
	for lang in afr ara aze bel ben bul cat ces chi_sim chi_tra \
		chr dan deu ell eng enm epo epo_alt equ est eus frk \
		fin fra frm glg grc heb hin hrv hun ind isl ita ita_old \
		jpn kan kor lav lit mal mkd mlt msa nld nor pol por \
		ron rus slk slv spa spa_old sqi srp swa swe tam tel \
		tgl tha tur ukr vie; do
		depends+=" tesseract-ocr-${lang}>=${version}_${revision}"
	done
}
tesseract-ocr-afr_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Afrikaans language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-ara_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Arabic language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-aze_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Azerbaijani language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-bel_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Belarusian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-ben_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Bengali language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-bul_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Bulgarian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-cat_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Catalan language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-ces_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Czech language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-chi_sim_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Chinese (Simplified) language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-chi_tra_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Chinese (Traditional) language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-chr_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Cherokee language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-dan_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Danish language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-deu_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - German language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-ell_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Greek language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-eng_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - English language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-enm_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Middle English (1100-1500) language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-epo_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Esperanto language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-epo_alt_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Esperanto alternative language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-equ_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Math / equation detection module"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-est_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Estonian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-eus_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Basque language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-fin_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Finnish language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-fra_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - French language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-frk_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Frankish language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-frm_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Middle French (ca. 1400-1600) language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-glg_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Galician language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-grc_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Ancient Greek Language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-heb_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Hebrew language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-hin_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Hindi language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-hrv_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Croatian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-hun_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Hungarian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-ind_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Indonesian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-isl_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Icelandic language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-ita_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Italian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-ita_old_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Italian (Old) language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-jpn_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Japanese language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-kan_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Kannada language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-kor_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Korean language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-lav_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Latvian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-lit_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Lithuanian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-mal_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Malayalam language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-mkd_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Macedonian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-mlt_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Maltese language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-msa_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Malay language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-nld_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Dutch language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-nor_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Norwegian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-pol_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Polish language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-por_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Portuguese language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-ron_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Romanian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-rus_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Russian Language Data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-slk_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Slovakian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-slv_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Slovenian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-spa_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Spanish language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-spa_old_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Spanish (Old) language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-sqi_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Albanian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-srp_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Serbian (Latin) language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-swa_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Swahili language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-swe_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Swedish language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-tam_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Tamil language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-tel_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Telugu language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-tgl_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Tagalog language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-tha_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Thai language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-tur_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Turkish language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-ukr_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Ukrainian language data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
tesseract-ocr-vie_package() {
	noarch=yes
	depends="tesseract-ocr>=${version}_${revision}"
	short_desc+=" - Vietnamese Language Data"
	pkg_install() {
		local f lang=${pkgname#tesseract-ocr-}
		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
	}
}
