Name:           lcms2
Version:        2.9
Release:        7
Summary:        Color Management Engine
License:        MIT
URL:            https://www.littlecms.com/
Source0:        https://www.littlecms.com/lcms2-%{version}.tar.gz

#patches come from lcms2 official
Patch17:        0017-Upgrade-Visual-studio-2017-15.8.patch
Patch6000:      fix-arry-bounds-on-writing-matrices.patch
BuildRequires:  gcc libjpeg-devel libtiff-devel zlib-devel

%description
LittleCMS intends to be an OPEN SOURSE small-footprint color management
engine,with special focus on accuracy and performence.It uses the
International Color Consortium standard (ICC), which is the modern
standard when regarding to color management. The ICC specification
is widely used and is referred to in many International and other
de-facto standards.

%package        utils
Summary:        Utility applications for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    utils
The %{name}-utils package contains utility applications for %{name}.

%package        devel
Summary:        Development files for LittleCMS
Requires:       %{name}%{?_isa} = %{version}-%{release}
Provides:       littlecms-devel = %{version}-%{release}

%description    devel
Development files for LittleCMS.

%package_help

%prep
%autosetup -n %{name}-%{version} -p1

%build
%configure --program-suffix=2

%disable_rpath
%make_build

%install
%make_install
cp -alf doc/LittleCMS2.?\ API.pdf API.pdf
cp -alf doc/LittleCMS2.?\ Plugin\ API.pdf Plugin_API.pdf
cp -alf doc/LittleCMS2.?\ tutorial.pdf tutorial.pdf
%delete_la

%check
%make_build check -k ||:

%ldconfig_scriptlets

%files
%defattr(-,root,root)
%doc AUTHORS  API.pdf Plugin_API.pdf tutorial.pdf
%license COPYING
%{_libdir}/liblcms2.so.2*

%files utils
%{_bindir}/*

%files devel
%defattr(-,root,root)
%{_includedir}/lcms2*.h
%{_libdir}/*.a
%{_libdir}/liblcms2.so
%{_libdir}/pkgconfig/*.pc

%files help
%defattr(-,root,root)
%{_mandir}/*

%changelog
* Tue Dec 31 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.9-7
- Type:NA
- Id:NA
- SUG:NA
- DESC:update tarball

* Wed Sep 11 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.9-6
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:Recovery utils package for lcms2

* Tue Aug 27 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.9-5
- Package init
