Add mingw subpackages
This commit is contained in:
parent
2de82b3be1
commit
ba095eadde
103
tesseract.spec
103
tesseract.spec
|
@ -2,7 +2,7 @@
|
|||
|
||||
Name: tesseract
|
||||
Version: 5.0.1
|
||||
Release: 2%{?pre:.%pre}%{?dist}
|
||||
Release: 3%{?pre:.%pre}%{?dist}
|
||||
Summary: Raw OCR Engine
|
||||
|
||||
License: ASL 2.0
|
||||
|
@ -25,6 +25,24 @@ BuildRequires: pango-devel
|
|||
BuildRequires: /usr/bin/asciidoc
|
||||
BuildRequires: /usr/bin/xsltproc
|
||||
|
||||
BuildRequires: mingw32-filesystem >= 95
|
||||
BuildRequires: mingw32-gcc
|
||||
BuildRequires: mingw32-binutils
|
||||
BuildRequires: mingw32-icu
|
||||
BuildRequires: mingw32-libtiff
|
||||
BuildRequires: mingw32-leptonica
|
||||
BuildRequires: mingw32-libgomp
|
||||
BuildRequires: mingw32-pango
|
||||
|
||||
BuildRequires: mingw64-filesystem >= 95
|
||||
BuildRequires: mingw64-gcc
|
||||
BuildRequires: mingw64-binutils
|
||||
BuildRequires: mingw64-icu
|
||||
BuildRequires: mingw64-libtiff
|
||||
BuildRequires: mingw64-leptonica
|
||||
BuildRequires: mingw64-libgomp
|
||||
BuildRequires: mingw64-pango
|
||||
|
||||
Requires: tesseract-langpack-eng
|
||||
|
||||
|
||||
|
@ -51,12 +69,50 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
|
|||
The %{name}-tools package contains tools for training %{name}.
|
||||
|
||||
|
||||
%package -n mingw32-%{name}
|
||||
Summary: MinGW Windows tesseract-ocr library
|
||||
|
||||
%description -n mingw32-%{name}
|
||||
MinGW Windows tesseract-ocr library.
|
||||
|
||||
|
||||
%package -n mingw32-%{name}-tools
|
||||
Summary: MinGW Windows tesseract-ocr library tools
|
||||
Requires: mingw32-%{name} = %{version}-%{release}
|
||||
|
||||
%description -n mingw32-%{name}-tools
|
||||
MinGW Windows tesseract-ocr library tools.
|
||||
|
||||
|
||||
%package -n mingw64-%{name}
|
||||
Summary: MinGW Windows tesseract-ocr library
|
||||
|
||||
%description -n mingw64-%{name}
|
||||
MinGW Windows tesseract-ocr library.
|
||||
|
||||
|
||||
%package -n mingw64-%{name}-tools
|
||||
Summary: MinGW Windows tesseract-ocr library tools
|
||||
Requires: mingw64-%{name} = %{version}-%{release}
|
||||
|
||||
%description -n mingw64-%{name}-tools
|
||||
MinGW Windows tesseract-ocr library tools.
|
||||
|
||||
|
||||
%{?mingw_debug_package}
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{name}-%{version}%{?pre:-%pre}
|
||||
|
||||
|
||||
%build
|
||||
./autogen.sh
|
||||
|
||||
# Native build
|
||||
mkdir build_native
|
||||
pushd build_native
|
||||
%global _configure ../configure
|
||||
%ifarch armv7hl
|
||||
export CFLAGS="`echo %{optflags} | sed 's|-mfpu=vfpv3-d16||'`"
|
||||
export CXXFLAGS="`echo %{optflags} | sed 's|-mfpu=vfpv3-d16||'`"
|
||||
|
@ -64,22 +120,35 @@ export CXXFLAGS="`echo %{optflags} | sed 's|-mfpu=vfpv3-d16||'`"
|
|||
%configure --disable-static
|
||||
%make_build
|
||||
%make_build training
|
||||
popd
|
||||
|
||||
# MinGW build
|
||||
# Fix error: unable to find numeric literal operator 'operator""Q'
|
||||
MINGW32_CXXFLAGS="%{mingw32_cflags} -fext-numeric-literals" \
|
||||
MINGW64_CXXFLAGS="%{mingw32_cflags} -fext-numeric-literals" \
|
||||
%mingw_configure --disable-static
|
||||
%mingw_make_build
|
||||
%mingw_make_build training
|
||||
|
||||
|
||||
%install
|
||||
%make_install training-install
|
||||
%make_install training-install -C build_native
|
||||
%mingw_make_install training-install
|
||||
rm -rf %{buildroot}%{mingw32_mandir}/
|
||||
rm -rf %{buildroot}%{mingw64_mandir}/
|
||||
|
||||
find %{buildroot} -name '*.la' -delete
|
||||
|
||||
|
||||
%mingw_debug_install_post
|
||||
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%doc AUTHORS ChangeLog README.md
|
||||
%{_bindir}/%{name}
|
||||
%dir %{_datadir}/%{name}
|
||||
%dir %{_datadir}/%{name}/tessdata
|
||||
%{_libdir}/lib%{name}.so.5*
|
||||
%{_datadir}/tesseract/
|
||||
%{_datadir}/%{name}/
|
||||
%{_mandir}/man1/tesseract.1*
|
||||
|
||||
%files devel
|
||||
|
@ -121,9 +190,33 @@ find %{buildroot} -name '*.la' -delete
|
|||
%{_mandir}/man5/unicharambigs.5.gz*
|
||||
%{_mandir}/man5/unicharset.5.gz*
|
||||
|
||||
%files -n mingw32-%{name}
|
||||
%license LICENSE
|
||||
%{mingw32_bindir}/libtesseract-5.dll
|
||||
%{mingw32_includedir}/tesseract/
|
||||
%{mingw32_libdir}/libtesseract.dll.a
|
||||
%{mingw32_libdir}/pkgconfig/tesseract.pc
|
||||
%{mingw32_datadir}/%{name}/
|
||||
|
||||
%files -n mingw32-%{name}-tools
|
||||
%{mingw32_bindir}/*.exe
|
||||
|
||||
%files -n mingw64-%{name}
|
||||
%license LICENSE
|
||||
%{mingw64_bindir}/libtesseract-5.dll
|
||||
%{mingw64_includedir}/tesseract/
|
||||
%{mingw64_libdir}/libtesseract.dll.a
|
||||
%{mingw64_libdir}/pkgconfig/tesseract.pc
|
||||
%{mingw64_datadir}/%{name}/
|
||||
|
||||
%files -n mingw64-%{name}-tools
|
||||
%{mingw64_bindir}/*.exe
|
||||
|
||||
|
||||
%changelog
|
||||
* Sat Feb 19 2022 Sandro Mani <manisandro@gmail.com> - 5.0.1-3
|
||||
- Add mingw subpackage
|
||||
|
||||
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
|
|
Loading…
Reference in New Issue