tesseract ocr specs

Tesseract OCR and Leptonica image processing library RPM specs and packages

9
5
Ruby

Description

This repo contains rpm spec-files to build Tesseract OCR engine and Leptonica.

Actual versions are: leptonica 1.69 and tesseract 3.02.

Building

Build process is tested on CentOS 6.4. To study RPM building and specs writting see Fedora wiki.

Prepare build environment (for CentOS 6)

Install base and development tools (or only development tools if you have not a miniman CentOS installation):

yum groupinstall 'Base' 'Development Tools'
yum install rpmdevtools rpmlint createrepo

Create non-privileged user to build RPMs and setup build environment:

/usr/sbin/useradd --gid users --create-home makerpm
passwd makerpm

su - makerpm
rpmdev-setuptree

Actual build

Log in as makerpm, download source files, install build dependencies and build package itself:

su - makerpm

curl https://raw.githubusercontent.com/grossws/tesseract-ocr-specs/master/utils/download_sources.sh | bash

sudo yum-builddep leptonica.spec
rpmbuild -ba leptonica.spec

Then install built leptonica-devel and build tesseract with its langpacks:

sudo yum install $HOME/rpmbuild/RPMS/$(uname -m)/leptonica{,-devel}-1.69-*.rpm

sudo yum-builddep tesseract.spec
rpmbuild -ba tesseract.spec

sudo yum install $HOME/rpmbuild/RPMS/$(uname -m)/tesseract{,-devel}-3.02-*.rpm
rpmbuild -ba tesseract-langpack.spec

Now you have all RPMs in $HOME/rpmbuild/RPMS/$(uname -m)/.

Create repository

If you want to start you own repo with this files, you should create appropriate directory structure,
generate metadata and serve it using you web (nginx, lighttpd or apache) or ftp server (any of ftpd’s).

mkdir -p $HOME/repo/centos/6/{i386,x86_64,SRPMS}
cp $HOME/rpmbuild/SRPMS/* $HOME/repo/centos/6/SRPMS/
cp $HOME/rpmbuild/RPMS/$(uname -m)/* $HOME/repo/centos/6/$(uname -m)/
cp $HOME/rpmbuild/RPMS/noarch/* $HOME/repo/centos/6/$(uname -m)/

createrepo $HOME/repo/centos/6/$(uname -m)
createrepo $HOME/repo/centos/6/SRPMS

After that you can serve files from repo directory via web or ftp server and add repo-file to /etc/yum.repos.d:

[my-repo-name]
name = My CentOS $releasever Repository
baseurl = http://example.org/repo/centos/$releasever/$basearch # if you use http
#baseurl = ftp://example.org/repo/centos/$releasever/$basearch # if you use ftp
#baseurl = file:///home/makerpm/repo/centos/$releasever/$basearch # if you use local filesystem/nfs/cifs
enabled = 1
protect = 0
gpgcheck = 0

Contributors

  • Karol Trzcionka (tesseract package initial maintainer)
  • Caolán McNamara
  • Lars Kiesow (@lkiesow). This specs are based on his specs from lkiesow/matterhorn-rpms repo.
  • Konstantin Gribov