File jbig2enc.spec of Package jbig2enc

#
# spec file for package jbig2enc
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define major   0

Name:           jbig2enc
Version:        0.28
Release:        0
License:        Apache-2.0
Summary:        Encoder for JBIG2
Url:            http://github.com/agl/jbig2enc
Group:          Productivity/Graphics/Other
# Repacked from https://github.com/agl/jbig2enc/tarball/0.28-dist
Source0:        %{name}-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM jbig2enc-tiff_single.patch -- Avoid infinite loop when processing TIFF file with a single image
# Fixed upstream in git: https://github.com/agl/jbig2enc/issues/36
Patch0:         jbig2enc-tiff_single.patch
# PATCH-FIX-UPSTREAM jbig2enc-leptonica170.patch -- Fix build with leptonica 1.70
# Fixed upstream in git: https://github.com/agl/jbig2enc/issues/45
Patch1:         jbig2enc-leptonica170.patch
# PATCH-FIX-UPSTREAM jbig2enc-disable-rpath.patch -- Add option '--disable-rpath' to configure
# Fixed upstream in git: https://github.com/agl/jbig2enc/issues/42
Patch2:         jbig2enc-disable-rpath.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gcc-c++
BuildRequires:  giflib-devel
BuildRequires:  libjpeg-devel
BuildRequires:  pkgconfig(lept)
BuildRequires:  pkgconfig(libpng)
%if 0%{?suse_version} >= 1210
BuildRequires:  pkgconfig(libwebp)
%endif
BuildRequires:  pkgconfig(libtiff-4)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
JBIG2 encodes bi-level (1 bpp) images using a number of clever tricks
to get better compression than G4.

This encoder can:
   * Generate JBIG2 files or fragments for embedding in PDFs.
   * Generic region encoding.
   * Perform symbol extraction, classification and text region coding.
   * Perform refinement coding.
   * Compress multipage documents.

%package -n jbig2
Summary:        Encoder for JBIG2
Group:          Productivity/Graphics/Other
Provides:       jbig2enc = %{version}
Obsoletes:      jbig2enc < 0.28

%description -n jbig2
JBIG2 encodes bi-level (1 bpp) images using a number of clever tricks
to get better compression than G4.

This encoder can:
   * Generate JBIG2 files or fragments for embedding in PDFs.
   * Generic region encoding.
   * Perform symbol extraction, classification and text region coding.
   * Perform refinement coding.
   * Compress multipage documents.

This package includes jbig2 CLI util and pdf.py script.

%package -n libjbig2enc%{major}
Summary:        JBIG2 Shared Library
Group:          System/Libraries

%description -n libjbig2enc%{major}
JBIG2 encodes bi-level (1 bpp) images using a number of clever tricks
to get better compression than G4.

This encoder can:
   * Generate JBIG2 files or fragments for embedding in PDFs.
   * Generic region encoding.
   * Perform symbol extraction, classification and text region coding.
   * Perform refinement coding.
   * Compress multipage documents.

This package includes libjbig2enc library.

%package devel
Summary:        JBIG2 Development Files
Group:          Development/Libraries/C and C++
Requires:       libjbig2enc%{major} = %{version}
Requires:       liblept-devel
Provides:       libjbig2enc-devel = %{version}
Obsoletes:      libjbig2enc-devel <= 0.28

%description devel
JBIG2 encodes bi-level (1 bpp) images using a number of clever tricks
to get better compression than G4.

This encoder can:
   * Generate JBIG2 files or fragments for embedding in PDFs.
   * Generic region encoding.
   * Perform symbol extraction, classification and text region coding.
   * Perform refinement coding.
   * Compress multipage documents.

This package includes jbig2enc development files.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1

%build
%configure \
    --disable-static \
    --disable-rpath
make %{?_smp_mflags}

%install
%make_install
rm -f %{buildroot}%{_libdir}/*.la
# Remove installed docs. Install them myself.
rm -rf %{buildroot}%{_datadir}/doc/

%post -n libjbig2enc%{major} -p /sbin/ldconfig

%postun -n libjbig2enc%{major} -p /sbin/ldconfig

%files -n jbig2
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog NEWS README doc/{jbig2enc.html,PATENTS}
%{_bindir}/jbig2
%{_bindir}/pdf.py

%files -n libjbig2enc%{major}
%defattr(-,root,root,-)
%{_libdir}/libjbig2enc.so.*

%files devel
%defattr(-,root,root,-)
%{_includedir}/jbig2*.h
%{_libdir}/libjbig2enc.so

%changelog
openSUSE Build Service is sponsored by