Blame SPECS/tesseract-tessdata.spec

502016
#global commit 7274cfad453d770f36b53ec5a2294ddd6d905703
502016
#global shortcommit %(c=%{commit}; echo ${c:0:7})
502016
502016
#global pre beta.1
502016
502016
Name:          tesseract-tessdata
502016
Version:       4.1.0
502016
Release:       3%{?pre:.%pre}%{?commit:.git%{shortcommit}}%{?dist}
502016
Summary:       Trained models for the Tesseract Open Source OCR Engine
502016
BuildArch:     noarch
502016
502016
License:       ASL 2.0
502016
URL:           https://github.com/tesseract-ocr/tessdata_fast
502016
%if 0%{?commit:1}
502016
Source0:       https://github.com/tesseract-ocr/tessdata_fast/archive/%{commit}/tessdata_fast-%{shortcommit}.tar.gz
502016
%else
502016
Source0:       https://github.com/tesseract-ocr/tessdata_fast/archive/%{version}%{?pre:-%pre}/tessdata_fast-%{version}%{?pre:-%pre}.tar.gz
502016
%endif
502016
502016
502016
%description
502016
This package contains fast integer versions of trained models for the Tesseract
502016
Open Source OCR Engine.
502016
502016
These models only work with the LSTM OCR engine of Tesseract 4.
502016
502016
502016
%package        doc
502016
Summary:        Documentation for %{name}
502016
502016
%description    doc
502016
The %{name}-doc package contains the documentation for %{name}.
502016
502016
502016
%package -n tesseract-osd
502016
Summary:       Orientation & Script Detection Data for tesseract
502016
BuildArch:     noarch
502016
Requires:      tesseract
502016
Requires:      %{name}-doc = %{version}-%{release}
502016
502016
%description -n tesseract-osd
502016
Orientation & Script Detection data for the Tesseract Open Source OCR Engine.
502016
502016
502016
%package -n tesseract-equ
502016
Summary:       Equation traineddata for tesseract
502016
BuildArch:     noarch
502016
Requires:      tesseract
502016
Requires:      %{name}-doc = %{version}-%{release}
502016
502016
%description -n tesseract-equ
502016
Data for processing images of mathematics with the Tesseract Open Source OCR Engine.
502016
502016
502016
# define lang_subpkg macro
502016
# m: 3 letter macrolanguage code
502016
# l: langcode used in Provides and Supplements tags
502016
# n: language name
502016
# -m and -n is needed for subpackages, -l is optional
502016
#
502016
%define lang_subpkg(l:m:n:) \
502016
%define macrolang %{-m:%{-m*}}%{!-m:%{error:3 letter Language code not defined}} \
502016
%define langcode %{-l:%{-l*}}%{!-l:%{error:Language code not defined}} \
502016
%define langname %{-n:%{-n*}}%{!-n:%{error:Language name not defined}} \
502016
\
502016
%package -n tesseract-langpack-%{macrolang}\
502016
Summary:       %{langname} language data for %{name}\
502016
BuildArch:     noarch\
502016
Requires:      tesseract\
502016
Requires:      %{name}-doc = %{version}-%{release}\
502016
%{-l:Provides:      %{name}-langpack-%{langcode} = %{version}-%{release}\
502016
Supplements:   (tesseract and langpacks-%{langcode})}\
502016
\
502016
%description -n tesseract-langpack-%{macrolang}\
502016
This package contains the fast integer version of the %{langname} language \
502016
trained models for the Tesseract Open Source OCR Engine.\
502016
\
502016
%files -n tesseract-langpack-%{macrolang}\
502016
%{_datadir}/tesseract/tessdata/%{macrolang}.*
502016
502016
# define script_subpkg macro
502016
# s: script name
502016
# n: package name
502016
#
502016
%define script_subpkg(s:n:) \
502016
%define scriptname %{-s:%{-s*}}%{!-s:%{error:Script name defined}} \
502016
%define filename %{-n:%{-n*}}%{!-n:%{error:Package name not defined}} \
502016
%define pkgname %(echo %filename | tr '[:upper:]' '[:lower:]') \
502016
\
502016
%package -n tesseract-script-%{pkgname}\
502016
Summary:       %{scriptname} script data for %{name}\
502016
BuildArch:     noarch\
502016
Requires:      tesseract\
502016
Requires:      %{name}-doc = %{version}-%{release}\
502016
\
502016
%description -n tesseract-script-%{pkgname}\
502016
This package contains the fast integer version of the %{scriptname} script \
502016
trained models for the Tesseract Open Source OCR Engine.\
502016
\
502016
%files -n tesseract-script-%{pkgname}\
502016
%dir %{_datadir}/tesseract/tessdata/script/\
502016
%{_datadir}/tesseract/tessdata/script/%{filename}.*
502016
502016
# see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
502016
# and https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
502016
%lang_subpkg -m afr -l af -n Afrikaans
502016
%lang_subpkg -m amh -l an -n Amharic
502016
%lang_subpkg -m ara -l ar -n Arabic
502016
%lang_subpkg -m asm -l as -n Assamese
502016
%lang_subpkg -m aze -l az -n Azerbaijani
502016
%lang_subpkg -m aze_cyrl -n %{quote:Azerbaijani (Cyrillic)}
502016
%lang_subpkg -m bel -l bel -n Belarusian
502016
%lang_subpkg -m ben -l bn -n Bengali
502016
%lang_subpkg -m bod -l bo -n %{quote:Tibetan (Standard)}
502016
%lang_subpkg -m bos -l bs -n Bosnian
502016
%lang_subpkg -m bre -l br -n Breton
502016
%lang_subpkg -m bul -l bg -n Bulgarian
502016
%lang_subpkg -m cat -l ca -n Catalan
502016
%lang_subpkg -m ceb -n Cebuano
502016
%lang_subpkg -m ces -l cs -n Czech
502016
%lang_subpkg -m chi_sim -l zh_CN -n %{quote:Chinese (Simplified)}
502016
%lang_subpkg -m chi_sim_vert -l zh_CN -n %{quote:Chinese (Simplified, Vertical)}
502016
%lang_subpkg -m chi_tra -l zh_TW -n %{quote:Chinese (Traditional)}
502016
%lang_subpkg -m chi_tra_vert -l zh_TW -n %{quote:Chinese (Traditional, Vertical)}
502016
%lang_subpkg -m chr -n Cherokee
502016
%lang_subpkg -m cos -l co -n Corsican
502016
%lang_subpkg -m cym -l cy -n Welsh
502016
%lang_subpkg -m dan -l da -n Danish
502016
%lang_subpkg -m deu -l de -n German
502016
%lang_subpkg -m div -l dv -n %{quote:Dhivehi; Maldivian}
502016
%lang_subpkg -m dzo -n Dzongkha
502016
%lang_subpkg -m ell -l el -n Greek
502016
%lang_subpkg -m eng -n English
502016
%lang_subpkg -m enm -n %{quote:Middle English (1100-1500)}
502016
%lang_subpkg -m epo -l eo -n Esperanto
502016
%lang_subpkg -m est -l et -n Estonian
502016
%lang_subpkg -m eus -l eu -n Basque
502016
%lang_subpkg -m fao -l fo -n %{quote:Faroese}
502016
%lang_subpkg -m fas -l fa -n %{quote:Persian (Farsi)}
502016
%lang_subpkg -m fil -n %{quote:Filipino; Pilipino}
502016
%lang_subpkg -m fin -l fi -n Finnish
502016
%lang_subpkg -m fra -l fr -n French
502016
%lang_subpkg -m frk -n Fraktur
502016
%lang_subpkg -m frm -n %{quote:Middle French (ca. 1400-1600)}
502016
%lang_subpkg -m fry -l fy -n %{quote:Western Frisian}
502016
%lang_subpkg -m gla -l gd -n %{quote:Gaelic; Scottish Gaelic}
502016
%lang_subpkg -m gle -l ga -n Irish
502016
%lang_subpkg -m glg -l gl -n Galician
502016
%lang_subpkg -m grc -n %{quote:Ancient Greek}
502016
%lang_subpkg -m guj -l gu -n Gujarati
502016
%lang_subpkg -m hat -l ht -n Haitian
502016
%lang_subpkg -m heb -l he -n Hebrew
502016
%lang_subpkg -m hin -l hi -n Hindi
502016
%lang_subpkg -m hrv -l hr -n Croatian
502016
%lang_subpkg -m hun -l hu -n Hungarian
502016
%lang_subpkg -m hye -l hy -n Armenian
502016
%lang_subpkg -m iku -l iu -n Inuktitut
502016
%lang_subpkg -m ind -l id -n Indonesian
502016
%lang_subpkg -m isl -l is -n Icelandic
502016
%lang_subpkg -m ita -l it -n Italian
502016
%lang_subpkg -m ita_old -n %{quote:Italian (Old)}
502016
%lang_subpkg -m jav -l jav -n Javanese
502016
%lang_subpkg -m jpn -l ja -n Japanese
502016
%lang_subpkg -m jpn_vert -l ja -n "Japanese (Vertical)"
502016
%lang_subpkg -m kan -l kn -n Kannada
502016
%lang_subpkg -m kat -l ka -n Georgian
502016
%lang_subpkg -m kat_old -n %{quote:Georgian (Old)}
502016
%lang_subpkg -m kaz -l kk -n Kazakh
502016
%lang_subpkg -m khm -l km -n Khmer
502016
%lang_subpkg -m kir -l ky -n Kyrgyz
502016
%lang_subpkg -m kor -l ko -n Korean
502016
%lang_subpkg -m kor_vert -l ko -n "Korean (Vertical)"
502016
%lang_subpkg -m kmr -l ku -n Kurmanji
502016
%lang_subpkg -m lao -l lo -n Lao
502016
%lang_subpkg -m lat -l lat -n Latin
502016
%lang_subpkg -m lav -l lv -n Latvian
502016
%lang_subpkg -m lit -l lt -n Lithuanian
502016
%lang_subpkg -m ltz -l lb -n Luxembourgish
502016
%lang_subpkg -m mal -l ml -n Malayalam
502016
%lang_subpkg -m mar -l mr -n Marathi
502016
%lang_subpkg -m mkd -l mk -n Macedonian
502016
%lang_subpkg -m mlt -l mt -n Maltese
502016
%lang_subpkg -m mon -l mn -n Mongolian
502016
%lang_subpkg -m mri -l mi -n Maori
502016
%lang_subpkg -m msa -l ms -n Malay
502016
%lang_subpkg -m mya -l my -n Burmese
502016
%lang_subpkg -m nep -l ne -n Nepali
502016
%lang_subpkg -m nld -l nl -n Dutch
502016
%lang_subpkg -m nor -l no -n Norwegian
502016
%lang_subpkg -m oci -l oc -n Occitan
502016
%lang_subpkg -m ori -l or -n Oriya
502016
%lang_subpkg -m pan -l pa -n Panjabi
502016
%lang_subpkg -m pol -l pl -n Polish
502016
%lang_subpkg -m por -l pt -n Portuguese
502016
%lang_subpkg -m pus -l ps -n Pashto
502016
%lang_subpkg -m que -l qu -n Quechuan
502016
%lang_subpkg -m ron -l ro -n Romanian
502016
%lang_subpkg -m rus -l ru -n Russian
502016
%lang_subpkg -m san -l sa -n Sanskrit
502016
%lang_subpkg -m sin -l si -n Sinhala
502016
%lang_subpkg -m slk -l sk -n Slovakian
502016
%lang_subpkg -m slv -l sl -n Slovenian
502016
%lang_subpkg -m snd -l sd -n Sindhi
502016
%lang_subpkg -m spa -l es -n Spanish
502016
%lang_subpkg -m spa_old -n %{quote:Spanish (Old)}
502016
%lang_subpkg -m sqi -l sq -n Albanian
502016
%lang_subpkg -m srp -l sr -n Serbian
502016
%lang_subpkg -m srp_latn -n %{quote:Serbian (Latin)}
502016
%lang_subpkg -m sun -l su -n Sundanese
502016
%lang_subpkg -m swa -l sw -n Swahili
502016
%lang_subpkg -m swe -l sv -n Swedish
502016
%lang_subpkg -m syr -l ar_SY -n Syriac
502016
%lang_subpkg -m tam -l ta -n Tamil
502016
%lang_subpkg -m tat -l tt -n Tatar
502016
%lang_subpkg -m tel -l te -n Telugu
502016
%lang_subpkg -m tgk -l tg -n Tajik
502016
%lang_subpkg -m tha -l th -n Thai
502016
%lang_subpkg -m tir -l ti -n Tigrinya
502016
%lang_subpkg -m ton -l to -n Tongan
502016
%lang_subpkg -m tur -l tr -n Turkish
502016
%lang_subpkg -m uig -l ug -n Uyghur
502016
%lang_subpkg -m ukr -l uk -n Ukrainian
502016
%lang_subpkg -m urd -l ur -n Urdu
502016
%lang_subpkg -m uzb -l uz -n Uzbek
502016
%lang_subpkg -m uzb_cyrl -n %{quote:Uzbek (Cyrillic)}
502016
%lang_subpkg -m vie -l vi -n Vietnamese
502016
%lang_subpkg -m yid -l yi -n Yiddish
502016
%lang_subpkg -m yor -l yo -n Yoruba
502016
502016
%script_subpkg -n Arabic -s Arabic
502016
%script_subpkg -n Armenian -s Armenian
502016
%script_subpkg -n Bengali -s Bengali
502016
%script_subpkg -n Canadian_Aboriginal -s %{quote:Canadian (Aboriginal)}
502016
%script_subpkg -n Cherokee -s Cherokee
502016
%script_subpkg -n Cyrillic -s Cyrillic
502016
%script_subpkg -n Devanagari -s Devanagari
502016
%script_subpkg -n Ethiopic -s Ethiopic
502016
%script_subpkg -n Fraktur -s Fraktur
502016
%script_subpkg -n Georgian -s Georgian
502016
%script_subpkg -n Greek -s Greek
502016
%script_subpkg -n Gujarati -s Gujarati
502016
%script_subpkg -n Gurmukhi -s Gurmukhi
502016
%script_subpkg -n HanS -s %{quote:Han (Simplified)}
502016
%script_subpkg -n HanS_vert -s %{quote:Han (Simplified, Vertical)}
502016
%script_subpkg -n HanT -s %{quote:Han (Traditional)}
502016
%script_subpkg -n HanT_vert -s %{quote:Han (Traditional, Vertical)}
502016
%script_subpkg -n Hangul -s Hangul
502016
%script_subpkg -n Hangul_vert -s %{quote:Hangul (Vertical)}
502016
%script_subpkg -n Hebrew -s Hebrew
502016
%script_subpkg -n Japanese -s Japanese
502016
%script_subpkg -n Japanese_vert -s %{quote:Japanese (Vertical)}
502016
%script_subpkg -n Kannada -s Kannada
502016
%script_subpkg -n Khmer -s Khmer
502016
%script_subpkg -n Lao -s Lao
502016
%script_subpkg -n Latin -s Latin
502016
%script_subpkg -n Malayalam -s Malayalam
502016
%script_subpkg -n Myanmar -s Myanmar
502016
%script_subpkg -n Oriya -s Oriya
502016
%script_subpkg -n Sinhala -s Sinhala
502016
%script_subpkg -n Syriac -s Syriac
502016
%script_subpkg -n Tamil -s Tamil
502016
%script_subpkg -n Telugu -s Telugu
502016
%script_subpkg -n Thaana -s Thaana
502016
%script_subpkg -n Thai -s Thai
502016
%script_subpkg -n Tibetan -s Tibetan
502016
%script_subpkg -n Vietnamese -s Vietnamese
502016
502016
502016
%prep
502016
%if 0%{?commit:1}
502016
%autosetup -p1 -n tessdata_fast-%{commit}
502016
%else
502016
%autosetup -p1 -n tessdata_fast-%{version}%{?pre:-%pre}
502016
%endif
502016
502016
502016
%build
502016
# Nothing to build
502016
502016
502016
%install
502016
mkdir -p %{buildroot}/%{_datadir}/tesseract/tessdata/
502016
cp -a * %{buildroot}/%{_datadir}/tesseract/tessdata/
502016
502016
# Install these through %%license and %%doc
502016
rm -f %{buildroot}/%{_datadir}/tesseract/tessdata/LICENSE
502016
rm -f %{buildroot}/%{_datadir}/tesseract/tessdata/README.md
502016
502016
# https://github.com/tesseract-ocr/tessdata_fast/issues/27
502016
rm -f %{buildroot}/%{_datadir}/tesseract/tessdata/configs
502016
rm -f %{buildroot}/%{_datadir}/tesseract/tessdata/pdf.ttf
502016
502016
502016
502016
%files doc
502016
%license LICENSE
502016
%doc README.md
502016
502016
%files -n tesseract-osd
502016
%{_datadir}/tesseract/tessdata/osd.traineddata
502016
502016
%files -n tesseract-equ
502016
%{_datadir}/tesseract/tessdata/equ.traineddata
502016
502016
502016
%changelog
502016
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 4.1.0-3
502016
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
502016
  Related: rhbz#1991688
502016
502016
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 4.1.0-2
502016
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
502016
502016
* Wed Feb 17 2021 Sandro Mani <manisandro@gmail.com> - 4.1.0-1
502016
- Update to 4.1.0
502016
502016
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-10
502016
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
502016
502016
* Tue Sep 29 2020 Sandro Mani <manisandro@gmail.com> - 4.0.0-9
502016
- Fix supplements
502016
502016
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-8
502016
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
502016
502016
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-7
502016
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
502016
502016
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-6
502016
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
502016
502016
* Wed Jul 17 2019 Sandro Mani <manisandro@gmail.com> - 4.0.0-5
502016
- Improve subpackage descriptions
502016
- Make script subpackages own the script directory
502016
- Bump release to -5
502016
502016
* Wed Jul 17 2019 Sandro Mani <manisandro@gmail.com> - 4.0.0-2
502016
- Make all langpack / script subpackages require tesseract for tessdata dir ownership
502016
- Fix tesseract-osd requires
502016
- Fix typo cirilic -> cyrillic
502016
502016
* Tue Jul 16 2019 Sandro Mani <manisandro@gmail.com> - 4.0.0-1
502016
- Initial package split from the tesseract package