R-tesseract/R-tesseract.spec

103 lines
2.7 KiB
RPMSpec
Raw Permalink Normal View History

2020-08-08 16:28:14 +00:00
# Examples and vignettes use the network.
%bcond_with network
# Need to bootstrap for magick
2022-09-03 15:05:33 +00:00
%bcond_with bootstrap
2021-09-20 09:09:57 +00:00
%global packname tesseract
%global packver 5.1.0
2021-09-20 09:09:57 +00:00
%global rlibdir %{_libdir}/R/library
2020-08-08 16:28:14 +00:00
Name: R-%{packname}
Version: %{packver}
2021-09-20 09:04:16 +00:00
Release: %autorelease
2020-08-08 16:28:14 +00:00
Summary: Open Source OCR Engine
# Automatically converted from old format: ASL 2.0 - review is highly recommended.
License: Apache-2.0
2020-08-08 16:28:14 +00:00
URL: https://CRAN.R-project.org/package=%{packname}
2021-09-20 09:09:57 +00:00
Source0: https://cran.r-project.org/src/contrib/%{packname}_%{packver}.tar.gz
2020-08-08 16:28:14 +00:00
2022-03-10 12:59:12 +00:00
# Fix leptonica include
Patch0: R-tesseract_include.patch
2020-08-08 16:28:14 +00:00
# Here's the R view of the dependencies world:
# Depends:
# Imports: R-Rcpp >= 0.12.12, R-pdftools >= 1.5, R-curl, R-rappdirs, R-digest
# Suggests: R-magick >= 1.7, R-spelling, R-knitr, R-tibble, R-rmarkdown
# LinkingTo:
# Enhances:
BuildRequires: R-devel
BuildRequires: tex(latex)
BuildRequires: R-Rcpp-devel >= 0.12.12
BuildRequires: R-pdftools >= 1.5
BuildRequires: R-curl
BuildRequires: R-rappdirs
BuildRequires: R-digest
%if %{without bootstrap}
2020-08-08 16:28:14 +00:00
BuildRequires: R-magick >= 1.7
BuildRequires: R-spelling
BuildRequires: R-knitr
BuildRequires: R-tibble
BuildRequires: R-rmarkdown
%endif
2021-12-14 13:11:24 +00:00
BuildRequires: pkgconfig(lept)
2020-08-08 16:28:14 +00:00
BuildRequires: pkgconfig(tesseract)
2022-03-04 09:40:28 +00:00
%if %{with network}
# For rmarkdown, because docs get built.
BuildRequires: glyphicons-halflings-fonts
%endif
2020-08-08 16:28:14 +00:00
%description
2021-09-20 09:09:57 +00:00
Bindings to 'Tesseract' <https://opensource.google/projects/tesseract>: a
powerful optical character recognition (OCR) engine that supports over 100
languages. The engine is highly configurable in order to tune the detection
algorithms and obtain the best possible results.
2020-08-08 16:28:14 +00:00
%prep
2021-12-14 13:11:24 +00:00
%autosetup -p1 -c -n %{packname}
2020-08-08 16:28:14 +00:00
%build
%install
mkdir -p %{buildroot}%{rlibdir}
%{_bindir}/R CMD INSTALL -l %{buildroot}%{rlibdir} %{packname}
test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so)
rm -f %{buildroot}%{rlibdir}/R.css
%check
%if %{without bootstrap}
2020-08-08 16:28:14 +00:00
%if %{with network}
%{_bindir}/R CMD check %{packname}
%else
%{_bindir}/R CMD check %{packname} --no-examples --no-vignettes
%endif
%endif
2020-08-08 16:28:14 +00:00
%files
%dir %{rlibdir}/%{packname}
%doc %{rlibdir}/%{packname}/doc
%doc %{rlibdir}/%{packname}/html
%{rlibdir}/%{packname}/DESCRIPTION
%doc %{rlibdir}/%{packname}/NEWS
%doc %{rlibdir}/%{packname}/AUTHORS
%license %{rlibdir}/%{packname}/COPYRIGHT
%{rlibdir}/%{packname}/INDEX
%{rlibdir}/%{packname}/NAMESPACE
%{rlibdir}/%{packname}/Meta
%{rlibdir}/%{packname}/R
%{rlibdir}/%{packname}/help
%dir %{rlibdir}/%{packname}/libs
%{rlibdir}/%{packname}/libs/%{packname}.so
%{rlibdir}/%{packname}/WORDLIST
%changelog
2021-09-20 09:04:16 +00:00
%autochangelog