%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}

Name: lcms
Summary: Little CMS - color management engine
Summary(ja): Little CMS - カラーマネージメントエンジン
Version: 1.19
Release: 2%{?_dist_release}

Group: System Environment/Libraries
License: MIT
URL: http://www.littlecms.com/

Source0: http://www.littlecms.com/%{name}-%{version}.tar.gz
Patch100: lcms-1.18_cmsxfrom_CVE-2009-0793.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: zlib-devel
BuildRequires: libtiff-devel
BuildRequires: libjpeg-turbo-devel
BuildRequires: pkgconfig

Vendor: Project Vine
Distribution: Vine Linux

%description
Little cms intends to be a small-footprint, speed optimized color management
engine in open source form.

%package devel
Summary: Header files and library for development with LCMS
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
Development files for development with LCMS

%package static
Summary: Static library for development with LCMS
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}

%description static
Static libraries for development with LCMS

%package utils
Summary: Additional Command Line Utilities for littlecms
Group: Applications/Graphics
Requires: %{name} = %{version}-%{release}

%description utils
Command line utilities which can perform icc transforms and provide info 
about icc profiles.

# compat32
%package -n compat32-%{name}
Summary: Little CMS - color management engine
Summary(ja): Little CMS - カラーマネージメントエンジン
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}

%description -n compat32-%{name}
Little cms intends to be a small-footprint, speed optimized color management
engine in open source form.

%package -n compat32-%{name}-devel
Summary: Header files and library for development with LCMS
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
Requires: compat32-%{name} = %{version}-%{release}

%description -n compat32-%{name}-devel
Development files for development with LCMS

%prep
%setup -q

%patch100 -p1 -b .CVE-2009-0793

%build
%configure
make all

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

rm $RPM_BUILD_ROOT%{_libdir}/*.la

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post -n compat32-%{name} -p /sbin/ldconfig

%postun -n compat32-%{name} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog README.1ST doc/ 
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/lcms.pc

%files static
%defattr(-,root,root)
%{_libdir}/*.a

%files utils
%defattr(-,root,root)
%{_bindir}/*
%{_mandir}/man1/*.gz

# compat32
%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-,root,root)
%{_libdir}/*.so.*

%files -n compat32-%{name}-devel
%defattr(-,root,root)
%{_libdir}/*.so
%{_libdir}/pkgconfig/lcms.pc
%endif

%changelog
* Sat Jan 04 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.19-2
- rebuild with VineSeed environment

* Sun Sep 26 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.19-1
- new upstream release
- built with rpm-4.8.1 for pkg-config
- BR: libjpeg-turbo-devel instead of libjpeg-devel

* Mon Jul 20 2009 NAKAMURA Kenta <kenta@vinelinux.org> 1.18-3
- added compat32 package for x86_64 arch support

* Sat Apr 11 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 1.18-2
- add patch100 for fix CVE-2009-0793 (Monochrome Profiles Transform DoS)

* Sat Apr 04 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 1.18-1
- new upstream release with security fixes (CVE-2009-0581, 0723, 0733)

* Fri Mar 27 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.17-2
- add lcms-static which is needed by tuxonice-userui

* Wed Mar 19 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.17-1
- new upstream release
- delete *.la
- add --disable-static

* Wed May 16 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.16-0vl1
- new upstream release

* Mon Mar  6 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.15-0vl2
- rebuid for VineSeed

* Mon Mar  6 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.15-0vl1
- new upstream release
- add %%{_mandir}/man1/*.gz to utils package

* Wed May 11 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.14-0vl1
- new upstream release

* Tue Aug 10 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.13-0vl1
- source upgrade
- add BuildPrereq: pkgconfig
- add %%{_libdir}/pkgconfig/lcms.pc to devel package

* Sat May  1 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.12-0vl1
- source upgrade
- change build method, %%files and Group for VineSeed

* Sat May 10 2003 Peter Linnell
- more spec file tweaks
- no need to patch makefiles - wtpt executible is obsoleted per Marti

* Sat Apr 26 2003 Peter Linnell
- split out and compile utils separately
- add RH80 versioning to avoid confusion with 9 packages
- needs patched samples makefile

* Wed Apr 23 2003  Peter Linnell
- new package with 1.10 final
- takeout profiles - add later

* Fri Mar 14 2003  Peter Linnell
- rebuild - test target= option works
