File leptonica.spec of Package leptonica

Name:           leptonica
# List of additional build dependencies
BuildRequires:  gcc-c++
Version:        1.60
Release:        1
License:        Apache License 2.0
Source:         leptonlib-1.60.tar.gz
Group:          Productivity/Other
Summary:        An open source C library for efficient image processing and image analysis operations

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description

Leptonica Library
The library supports many operations that are useful on

    * Document images
    * Natural images 

Fundamental image processing and image analysis operations

    * Rasterop (aka bitblt)
    * Affine transforms (scaling, translation, rotation, shear) on
images of arbitrary pixel depth
    * Binary and grayscale morphology, rank order filters, and
convolution
    * Seedfill and connected components
    * Image transformations with changes in pixel depth, both at the
same scale and with scale change
    * Pixelwise masking, blending, enhancement, arithmetic ops, etc. 

Ancillary utilities

    * I/O for standard image formats (jpg, png, tiff, bmp, pnm, gif,
ps)
    * Utilities to handle arrays of image-related data types (e.g.,
pixa, boxa, pta)
    * Utilities for stacks, generic arrays, queues, heaps, lists;
number and string arrays; etc. 

Examples of some applications enabled and implemented

    * Octcube-based color quantization (w/ and w/out dithering)
    * Modified median cut color quantization (w/ and w/out dithering)
    * Skew determination of text images
    * Segmentation of page images with mixed text and images
    * jbig2 unsupervised classifier
    * Border representations of 1 bit/pixel images and raster
conversion for SVG
    * Postscript wrapping (levels 1, 2) of images for
device-independent output
    * Connectivity-preserving thinning and thickening of 1 bit/pixel
images
    * Search for least-cost paths on binary and grayscale images
    * Barcode reader for 1D barcodes (very early version as of 1.55) 

Implementation characteristics

    * Efficient: image data is packed binary (into 32-bit words);
operations on 32-bit data whenever possible
    * Simple: small number of data structures; simplest
implementations provided that are efficient
    * Thread-safe: no non-const global vars
    * Consistent: data allocated on the heap with simple ownership
rules; function names usually begin with primary data structure (e.g.,
pix)
    * Robust: all ptr args checked; extensive use of accessors; exit
not permitted
    * Tested: thorough regression tests provided for most basic
functions; valgrind tested
    * Ansi C: automatically generated prototype header file
    * Portable: endian-independent; builds in linux, osx, mingw,
cygwin, windows
    * Documentation: large number of in-line comments; web pages for
further background
    * Examples: many programs provided to test and show usage of
approx. 1500 functions in the library 

Open Source Projects that use Leptonica

    * php (scripting language for dynamic web pages)
    * tesseract (optical character recognition)
    * jbig2enc (encodes multipage binary image documents with jbig2
compression) 


%package devel
Summary: devel package for %{name}
Group:   Development/Libraries
Requires: %{name}

%description devel
devel package for %{name}


%prep
%setup -q -n leptonlib-%version

%build

# Assume that the package is built by plain 'make' if there's no ./configure.
# This test is there only because the wizard doesn't know much about the
# package, feel free to clean it up
if test -x ./configure; then
	%configure
fi
make
mkdir -p %buildroot/%_docdir/
echo "no non-devel files in this package, please install %{name}-devel" > %buildroot/%_docdir/README

%install
make DESTDIR=%buildroot install



# Write a proper %%files section and remove these two commands and
# the '-f filelist' option to %%files
echo '%%defattr(-,root,root)' >filelist
find %buildroot -type f -printf '/%%P*\n' >>filelist


%clean
rm -rf %buildroot

%files
%defattr(644,root,root,755)
%_docdir/*

%files devel
%defattr(644,root,root,755)
%{_includedir}/*
%{_libdir}/*

# This is a place for a proper filelist:
# /usr/bin/leptonica
# You can also use shell wildcards:
# /usr/share/leptonica/*
# This installs documentation files from the top build directory
# into /usr/share/doc/...
# %doc README COPYING
# The advantage of using a real filelist instead of the '-f filelist' trick is
# that rpmbuild will detect if the install section forgets to install
# something that is listed here


%changelog
* Thu Jan 22 2009 dbornkessel@novell.com
- packaged leptonica version 1.60 using the buildservice spec file wizard
openSUSE Build Service is sponsored by