]> git.pld-linux.org Git - packages/tesseract.git/blob - tesseract.spec
fix build on arm32 without neon
[packages/tesseract.git] / tesseract.spec
1 # TODO:
2 # - tensorflow support
3 #
4 # Conditional build:
5 %bcond_without  openmp          # OpenMP support
6 %bcond_with     opencl          # OpenCL support
7 %bcond_without  static_libs     # static library
8
9 Summary:        Tesseract Open Source OCR Engine
10 Summary(pl.UTF-8):      Tesseract - silnik OCR o otwartych źródłach
11 Name:           tesseract
12 Version:        5.3.4
13 Release:        1
14 License:        Apache v2.0
15 Group:          Applications/Graphics
16 #Source0Download: https://github.com/tesseract-ocr/tesseract/releases
17 Source0:        https://github.com/tesseract-ocr/tesseract/archive/%{version}/%{name}-%{version}.tar.gz
18 # Source0-md5:  53de961804ccbcb83b73122f721d8f83
19 Patch0:         neon-detect.patch
20 URL:            https://github.com/tesseract-ocr/
21 %{?with_opencl:BuildRequires:   OpenCL-devel}
22 BuildRequires:  asciidoc
23 BuildRequires:  autoconf >= 2.69
24 BuildRequires:  automake
25 BuildRequires:  cairo-devel
26 BuildRequires:  curl-devel
27 BuildRequires:  leptonlib-devel >= 1.74
28 BuildRequires:  libarchive-devel
29 %{?with_openmp:BuildRequires:   libgomp-devel}
30 BuildRequires:  libicu-devel >= 52.1
31 BuildRequires:  libstdc++-devel >= 6:7
32 BuildRequires:  libtiff-devel
33 BuildRequires:  libtool >= 2:2
34 BuildRequires:  libxslt-progs
35 BuildRequires:  pango-devel >= 1:1.38.0
36 BuildRequires:  rpmbuild(macros) >= 1.527
37 Requires:       leptonlib >= 1.74
38 Suggests:       tesseract-data >= 3
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41 %description
42 A commercial quality OCR engine originally developed at HP between
43 1985 and 1995. In 1995, this engine was among the top 3 evaluated by
44 UNLV. It was open-sourced by HP and UNLV in 2005.
45
46 %description -l pl.UTF-8
47 Silnik OCR o komercyjnej jakości oryginalnie stworzony przez HP w
48 latach 1985-1995. W 1995 roku był jednym z 3 najlepszych wg UNLV.
49 Źródła zostały uwolnione przez HP i UNLV w 2005 roku.
50
51 %package training
52 Summary:        Tesseract training tools
53 Summary(pl.UTF-8):      Narzędzia treningowe Tesseracta
54 Group:          Applications/Graphics
55 Requires:       %{name} = %{version}-%{release}
56 Requires:       pango >= 1:1.38.0
57
58 %description training
59 This package contains the Tesseract training tools.
60
61 %description training -l pl.UTF-8
62 Ten pakiet zawiera programy do trenowania Tesseracta.
63
64 %package devel
65 Summary:        Header files for Tesseract libraries
66 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek Tesseracta
67 Group:          Development/Libraries
68 Requires:       %{name} = %{version}-%{release}
69 Requires:       curl-devel
70 Requires:       leptonlib-devel >= 1.74
71 Requires:       libarchive-devel
72 Requires:       libstdc++-devel >= 6:7
73
74 %description devel
75 This package contains the development header files necessary to
76 develop applications using Tesseract API.
77
78 %description devel -l pl.UTF-8
79 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów
80 wykorzystujących API Tesseracta.
81
82 %package static
83 Summary:        Static Tesseract libraries
84 Summary(pl.UTF-8):      Statyczne biblioteki Tesseracta
85 Group:          Development/Libraries
86 Requires:       %{name}-devel = %{version}-%{release}
87
88 %description static
89 Static Tesseract libraries.
90
91 %description static -l pl.UTF-8
92 Statyczne biblioteki Tesseracta.
93
94 %prep
95 %setup -q
96 %patch0 -p1
97
98 %build
99 %{__libtoolize}
100 %{__aclocal}
101 %{__autoconf}
102 %{__autoheader}
103 %{__automake}
104 %configure \
105         %{?with_opencl:--enable-opencl} \
106         %{!?with_openmp:--disable-openmp} \
107         --disable-silent-rules \
108         %{__enable_disable static_libs static}
109 %{__make}
110 %{__make} training
111
112 %install
113 rm -rf $RPM_BUILD_ROOT
114 install -d $RPM_BUILD_ROOT%{_datadir}/tessdata/script
115
116 %{__make} install \
117         DESTDIR=$RPM_BUILD_ROOT
118
119 %{__make} training-install \
120         DESTDIR=$RPM_BUILD_ROOT
121
122 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libtesseract.la
123
124 %clean
125 rm -rf $RPM_BUILD_ROOT
126
127 %post   -p /sbin/ldconfig
128 %postun -p /sbin/ldconfig
129
130 %files
131 %defattr(644,root,root,755)
132 %doc AUTHORS ChangeLog README.md
133 %attr(755,root,root) %{_bindir}/tesseract
134 %attr(755,root,root) %{_libdir}/libtesseract.so.*.*.*
135 %attr(755,root,root) %ghost %{_libdir}/libtesseract.so.5
136 %dir %{_datadir}/tessdata
137 %{_datadir}/tessdata/configs
138 %dir %{_datadir}/tessdata/script
139 %{_datadir}/tessdata/tessconfigs
140 %{_datadir}/tessdata/pdf.ttf
141 %{_mandir}/man1/tesseract.1*
142
143 %files training
144 %defattr(644,root,root,755)
145 %attr(755,root,root) %{_bindir}/ambiguous_words
146 %attr(755,root,root) %{_bindir}/classifier_tester
147 %attr(755,root,root) %{_bindir}/cntraining
148 %attr(755,root,root) %{_bindir}/combine_lang_model
149 %attr(755,root,root) %{_bindir}/combine_tessdata
150 %attr(755,root,root) %{_bindir}/dawg2wordlist
151 %attr(755,root,root) %{_bindir}/lstmeval
152 %attr(755,root,root) %{_bindir}/lstmtraining
153 %attr(755,root,root) %{_bindir}/merge_unicharsets
154 %attr(755,root,root) %{_bindir}/mftraining
155 %attr(755,root,root) %{_bindir}/set_unicharset_properties
156 %attr(755,root,root) %{_bindir}/shapeclustering
157 %attr(755,root,root) %{_bindir}/text2image
158 %attr(755,root,root) %{_bindir}/unicharset_extractor
159 %attr(755,root,root) %{_bindir}/wordlist2dawg
160 %{_mandir}/man1/ambiguous_words.1*
161 %{_mandir}/man1/classifier_tester.1*
162 %{_mandir}/man1/cntraining.1*
163 %{_mandir}/man1/combine_lang_model.1*
164 %{_mandir}/man1/combine_tessdata.1*
165 %{_mandir}/man1/dawg2wordlist.1*
166 %{_mandir}/man1/lstmeval.1*
167 %{_mandir}/man1/lstmtraining.1*
168 %{_mandir}/man1/merge_unicharsets.1*
169 %{_mandir}/man1/mftraining.1*
170 %{_mandir}/man1/set_unicharset_properties.1*
171 %{_mandir}/man1/shapeclustering.1*
172 %{_mandir}/man1/text2image.1*
173 %{_mandir}/man1/unicharset_extractor.1*
174 %{_mandir}/man1/wordlist2dawg.1*
175
176 %files devel
177 %defattr(644,root,root,755)
178 %attr(755,root,root) %{_libdir}/libtesseract.so
179 %{_includedir}/%{name}
180 %{_pkgconfigdir}/tesseract.pc
181 %{_mandir}/man5/unicharambigs.5*
182 %{_mandir}/man5/unicharset.5*
183
184 %if %{with static_libs}
185 %files static
186 %defattr(644,root,root,755)
187 %{_libdir}/libtesseract.a
188 %endif
This page took 0.516932 seconds and 3 git commands to generate.