Revert to autotools
This commit is contained in:
parent
60e83f645c
commit
3361cdfe52
|
@ -2,19 +2,18 @@
|
|||
|
||||
Name: tesseract
|
||||
Version: 5.0.0
|
||||
Release: 2%{?pre:.%pre}%{?dist}
|
||||
Release: 3%{?pre:.%pre}%{?dist}
|
||||
Summary: Raw OCR Engine
|
||||
|
||||
License: ASL 2.0
|
||||
URL: https://github.com/tesseract-ocr/%{name}
|
||||
Source0: https://github.com/tesseract-ocr/tesseract/archive/%{version}%{?pre:-%pre}/%{name}-%{version}%{?pre:-%pre}.tar.gz
|
||||
|
||||
# Expose symbol used when linking dawg2wordlist
|
||||
Patch0: tesseract_api.patch
|
||||
# Also install training libs
|
||||
Patch1: tesseract_install_training_libs.patch
|
||||
# Place tessdata below /usr/share/tesseract
|
||||
Patch0: tesseract_tessdata_prefix.patch
|
||||
|
||||
BuildRequires: cmake
|
||||
|
||||
BuildRequires: automake autoconf libtool
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: libtool
|
||||
|
@ -23,6 +22,8 @@ BuildRequires: leptonica-devel
|
|||
BuildRequires: cairo-devel
|
||||
BuildRequires: libicu-devel
|
||||
BuildRequires: pango-devel
|
||||
BuildRequires: /usr/bin/asciidoc
|
||||
BuildRequires: /usr/bin/xsltproc
|
||||
|
||||
Requires: tesseract-langpack-eng
|
||||
|
||||
|
@ -55,17 +56,16 @@ The %{name}-tools package contains tools for training %{name}.
|
|||
|
||||
|
||||
%build
|
||||
%cmake \
|
||||
-DUSE_SYSTEM_ICU=ON \
|
||||
-DENABLE_LTO=ON \
|
||||
-DTESSDATA_PREFIX=%{_datadir}/%{name} \
|
||||
-DCMAKE_INSTALL_LIBDIR=%{_lib}
|
||||
%cmake_build
|
||||
./autogen.sh
|
||||
%configure --disable-static
|
||||
%make_build
|
||||
%make_build training
|
||||
|
||||
|
||||
%install
|
||||
%cmake_install
|
||||
mkdir -p %{buildroot}%{_datadir}/%{name}/tessdata
|
||||
%make_install training-install
|
||||
|
||||
find %{buildroot} -name '*.la' -delete
|
||||
|
||||
|
||||
%files
|
||||
|
@ -75,11 +75,12 @@ mkdir -p %{buildroot}%{_datadir}/%{name}/tessdata
|
|||
%dir %{_datadir}/%{name}
|
||||
%dir %{_datadir}/%{name}/tessdata
|
||||
%{_libdir}/lib%{name}.so.5*
|
||||
%{_datadir}/tesseract/
|
||||
%{_mandir}/man1/tesseract.1*
|
||||
|
||||
%files devel
|
||||
%{_includedir}/%{name}
|
||||
%{_libdir}/lib%{name}.so
|
||||
%{_libdir}/cmake/%{name}/
|
||||
%{_libdir}/pkgconfig/%{name}.pc
|
||||
|
||||
%files tools
|
||||
|
@ -98,12 +99,30 @@ mkdir -p %{buildroot}%{_datadir}/%{name}/tessdata
|
|||
%{_bindir}/text2image
|
||||
%{_bindir}/unicharset_extractor
|
||||
%{_bindir}/wordlist2dawg
|
||||
%{_libdir}/libtesseract_common_training.so
|
||||
%{_libdir}/libtesseract_pango_training.so
|
||||
%{_libdir}/libtesseract_unicharset_training.so
|
||||
%{_mandir}/man1/ambiguous_words.1*
|
||||
%{_mandir}/man1/classifier_tester.1*
|
||||
%{_mandir}/man1/cntraining.1*
|
||||
%{_mandir}/man1/combine_lang_model.1*
|
||||
%{_mandir}/man1/combine_tessdata.1*
|
||||
%{_mandir}/man1/dawg2wordlist.1*
|
||||
%{_mandir}/man1/lstmeval.1*
|
||||
%{_mandir}/man1/lstmtraining.1*
|
||||
%{_mandir}/man1/merge_unicharsets.1*
|
||||
%{_mandir}/man1/mftraining.1*
|
||||
%{_mandir}/man1/set_unicharset_properties.1*
|
||||
%{_mandir}/man1/shapeclustering.1*
|
||||
%{_mandir}/man1/text2image.1*
|
||||
%{_mandir}/man1/unicharset_extractor.1*
|
||||
%{_mandir}/man1/wordlist2dawg.1*
|
||||
%{_mandir}/man5/unicharambigs.5.gz*
|
||||
%{_mandir}/man5/unicharset.5.gz*
|
||||
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri Dec 17 2021 Sandro Mani <manisandro@gmail.com> - 5.0.0-3
|
||||
- Switch back to autotools
|
||||
|
||||
* Wed Dec 15 2021 Sandro Mani <manisandro@gmail.com> - 5.0.0-2
|
||||
- Also install training libraries
|
||||
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
diff -rupN tesseract-5.0.0/src/lstm/plumbing.h tesseract-5.0.0-new/src/lstm/plumbing.h
|
||||
--- tesseract-5.0.0/src/lstm/plumbing.h 2021-11-30 18:48:16.000000000 +0100
|
||||
+++ tesseract-5.0.0-new/src/lstm/plumbing.h 2021-12-10 21:24:35.113774177 +0100
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
void SetRandomizer(TRand *randomizer) override;
|
||||
|
||||
// Adds the given network to the stack.
|
||||
- virtual void AddToStack(Network *network);
|
||||
+ TESS_API virtual void AddToStack(Network *network);
|
||||
|
||||
// Sets needs_to_backprop_ to needs_backprop and returns true if
|
||||
// needs_backprop || any weights in this network so the next layer forward
|
|
@ -1,39 +0,0 @@
|
|||
diff -rupN tesseract-5.0.0/src/training/CMakeLists.txt tesseract-5.0.0-new/src/training/CMakeLists.txt
|
||||
--- tesseract-5.0.0/src/training/CMakeLists.txt 2021-11-30 18:48:16.000000000 +0100
|
||||
+++ tesseract-5.0.0-new/src/training/CMakeLists.txt 2021-12-15 14:05:18.100992047 +0100
|
||||
@@ -102,6 +102,11 @@ target_include_directories (common_trai
|
||||
target_link_libraries (common_training PUBLIC libtesseract)
|
||||
generate_export_header (common_training EXPORT_MACRO_NAME TESS_COMMON_TRAINING_API)
|
||||
project_group (common_training "Training Tools")
|
||||
+set_target_properties (common_training PROPERTIES OUTPUT_NAME tesseract_common_training)
|
||||
+install(TARGETS common_training
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
########################################
|
||||
# EXECUTABLE ambiguous_words
|
||||
@@ -216,6 +221,11 @@ endif()
|
||||
target_include_directories (unicharset_training PUBLIC unicharset ${CMAKE_CURRENT_BINARY_DIR})
|
||||
generate_export_header (unicharset_training EXPORT_MACRO_NAME TESS_UNICHARSET_TRAINING_API)
|
||||
project_group (unicharset_training "Training Tools")
|
||||
+set_target_properties (unicharset_training PROPERTIES OUTPUT_NAME tesseract_unicharset_training)
|
||||
+install(TARGETS unicharset_training
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
|
||||
########################################
|
||||
@@ -323,6 +333,11 @@ endif()
|
||||
target_include_directories (pango_training PUBLIC pango ${CMAKE_CURRENT_BINARY_DIR})
|
||||
generate_export_header (pango_training EXPORT_MACRO_NAME TESS_PANGO_TRAINING_API)
|
||||
project_group (pango_training "Training Tools")
|
||||
+set_target_properties (pango_training PROPERTIES OUTPUT_NAME tesseract_pango_training)
|
||||
+install(TARGETS pango_training
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
|
||||
########################################
|
|
@ -0,0 +1,47 @@
|
|||
diff -rupN --no-dereference tesseract-5.0.0/Makefile.am tesseract-5.0.0-new/Makefile.am
|
||||
--- tesseract-5.0.0/Makefile.am 2021-11-30 18:48:16.000000000 +0100
|
||||
+++ tesseract-5.0.0-new/Makefile.am 2021-12-17 11:28:40.773210872 +0100
|
||||
@@ -338,7 +338,7 @@ endif
|
||||
libtesseract_ccutil_la_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
libtesseract_ccutil_la_CPPFLAGS += $(libarchive_CFLAGS)
|
||||
if !NO_TESSDATA_PREFIX
|
||||
-libtesseract_ccutil_la_CPPFLAGS += -DTESSDATA_PREFIX='"@datadir@"'
|
||||
+libtesseract_ccutil_la_CPPFLAGS += -DTESSDATA_PREFIX='"@datadir@/tesseract"'
|
||||
endif
|
||||
|
||||
noinst_HEADERS += src/ccutil/ccutil.h
|
||||
@@ -504,7 +504,7 @@ libtesseract_lstm_la_CPPFLAGS += -DINCLU
|
||||
libtesseract_lstm_la_CPPFLAGS += -I/usr/include/tensorflow
|
||||
endif
|
||||
if !NO_TESSDATA_PREFIX
|
||||
-libtesseract_lstm_la_CPPFLAGS += -DTESSDATA_PREFIX='"@datadir@"'
|
||||
+libtesseract_lstm_la_CPPFLAGS += -DTESSDATA_PREFIX='"@datadir@/tessdata"'
|
||||
endif
|
||||
|
||||
noinst_HEADERS += src/lstm/convolve.h
|
||||
diff -rupN --no-dereference tesseract-5.0.0/tessdata/configs/Makefile.am tesseract-5.0.0-new/tessdata/configs/Makefile.am
|
||||
--- tesseract-5.0.0/tessdata/configs/Makefile.am 2021-11-30 18:48:16.000000000 +0100
|
||||
+++ tesseract-5.0.0-new/tessdata/configs/Makefile.am 2021-12-17 11:28:40.773210872 +0100
|
||||
@@ -1,4 +1,4 @@
|
||||
-datadir = @datadir@/tessdata/configs
|
||||
+datadir = @datadir@/tesseract/tessdata/configs
|
||||
data_DATA = inter makebox box.train unlv ambigs.train lstm.train lstmdebug
|
||||
data_DATA += api_config kannada box.train.stderr quiet logfile digits get.images
|
||||
data_DATA += lstmbox wordstrbox
|
||||
diff -rupN --no-dereference tesseract-5.0.0/tessdata/Makefile.am tesseract-5.0.0-new/tessdata/Makefile.am
|
||||
--- tesseract-5.0.0/tessdata/Makefile.am 2021-11-30 18:48:16.000000000 +0100
|
||||
+++ tesseract-5.0.0-new/tessdata/Makefile.am 2021-12-17 11:28:40.774210870 +0100
|
||||
@@ -1,4 +1,4 @@
|
||||
-datadir = @datadir@/tessdata
|
||||
+datadir = @datadir@/tesseract/tessdata
|
||||
|
||||
data_DATA = pdf.ttf
|
||||
EXTRA_DIST = $(data_DATA)
|
||||
diff -rupN --no-dereference tesseract-5.0.0/tessdata/tessconfigs/Makefile.am tesseract-5.0.0-new/tessdata/tessconfigs/Makefile.am
|
||||
--- tesseract-5.0.0/tessdata/tessconfigs/Makefile.am 2021-11-30 18:48:16.000000000 +0100
|
||||
+++ tesseract-5.0.0-new/tessdata/tessconfigs/Makefile.am 2021-12-17 11:28:40.774210870 +0100
|
||||
@@ -1,3 +1,3 @@
|
||||
-datadir = @datadir@/tessdata/tessconfigs
|
||||
+datadir = @datadir@/tesseract/tessdata/tessconfigs
|
||||
data_DATA = batch batch.nochop nobatch matdemo segdemo msdemo
|
||||
EXTRA_DIST = batch batch.nochop nobatch matdemo segdemo msdemo
|
Loading…
Reference in New Issue