Blob Blame History Raw
%define alphaversion Beta8
%define alphatag    .%{alphaversion}
%define archivename argyllV%{version}%{?alphaversion}_src.zip

Name:    argyllcms
Version: 0.70
Release: 0.10%{?alphatag}%{?dist}
Summary: ICC compatible color management system

Group:   User Interface/X
License: GPLv3 and MIT
URL:     http://www.%{name}.com/

Source0: %{url}%{archivename}
Source1: %{name}-0.70-19-color.fdi
Source2: %{name}-0.70-color-device-file.policy
Patch0:  %{name}-0.70-build.patch
# Patch by Stefan Brüns, bz421921#c18
Patch1:  %{name}-0.70-printf.patch
# Patch by Stefan Brüns, bz421921#c24
Patch2:  %{name}-0.70-scanin-doublefree-fix.patch
# Patch applied for legal reasons
Patch3: %{name}-0.70-legal.patch

BuildRoot:     %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: jam, libtiff-devel, libusb-devel
BuildRequires: libX11-devel, libXext-devel, libXxf86vm-devel, libXinerama-devel
BuildRequires: libXScrnSaver-devel

Requires: udev, PolicyKit

%description
The Argyll color management system supports accurate ICC profile creation for
scanners, CMYK printers, film recorders and calibration and profiling of
displays.

Spectral sample data is supported, allowing a selection of illuminants observer
types, and paper fluorescent whitener additive compensation. Profiles can also
incorporate source specific gamut mappings for perceptual and saturation
intents. Gamut mapping and profile linking uses the CIECAM02 appearance model,
a unique gamut mapping algorithm, and a wide selection of rendering intents. It
also includes code for the fastest portable 8 bit raster color conversion
engine available anywhere, as well as support for fast, fully accurate 16 bit
conversion. Device color gamuts can also be viewed and compared using a VRML
viewer.


%package doc
Summary: Argyll CMS documentation
Group:   User Interface/X
# Does not really make sense without Argyll CMS itself
Requires: %{name} = %{version}-%{release}

%description doc
The Argyll color management system supports accurate ICC profile creation for
scanners, CMYK printers, film recorders and calibration and profiling of
displays.

This package contains the Argyll color management system documentation.


%prep
%setup -q -c
# Remove useless bundled libs to make sure we don't accidentally include them
rm -fr tiff libusb libusbw
# Make argyllcms actually build on a modern Linux system
%patch0 -p1 -b .build

# Code fixes
%patch1 -p1 -b .printf
%patch2 -p1 -b .scanin

# Legal patch required
%patch3 -p1 -b .legal

%build
CCOPTFLAG="%{optflags}"
PATH=$PATH:.
export CCOPTFLAG PATH

%define jam jam -d x -f../Jambase %{?_smp_mflags}

# Patching and running makeall.ksh would be easier, but that would hide build
# errors from rpm. If the build process was a real DAG a single for loop would
# be sufficient

for dir in numlib plot icc cgats ; do
   pushd $dir
      %{jam}
   popd
done

pushd rspl
   %{jam} librspl.a
popd

pushd xicc
   %{jam} libxicc.a libxcolorants.a
popd

pushd gamut
   %{jam}
popd

pushd spectro
   %{jam} libinsttypes.a
popd

for dir in xicc imdi target scanin profile link tweak render spectro rspl ; do
   pushd $dir
      %{jam}
   popd
done


%install
rm -rf %{buildroot}

# Use upstream's install logic targetting a temp dir so files can be re-sorted
# sanely later

PATH=$PATH:.
DOTDOT=$PWD/tmp

export DOTDOT PATH

for dir in gamut icc imdi link profile render scanin spectro target tweak xicc
do
   pushd $dir
      %{jam} install
   popd
done

# No business in bin
rm $DOTDOT/bin/*.txt
mv $DOTDOT/bin/*.gam .

# Licensing madness
install -p -m 0644 icc/License.txt License-icc.txt
install -p -m 0644 cgats/License.txt License-cgats.txt

ln -s ArgyllDoc.html doc/index.html

# Little CMS conflict
mv $DOTDOT/bin/icclink $DOTDOT/bin/icclink-%{name}

# Actual install phase

install -d -m 0755 %{buildroot}%{_bindir}
install -p -m 0755 tmp/bin/* %{buildroot}%{_bindir}

install -d -m 0755 %{buildroot}%{_datadir}/%{name}
install -p -m 0644 ref/* scanin/QPcard_201.c* *.gam \
        %{buildroot}%{_datadir}/%{name}
rm %{buildroot}%{_datadir}/%{name}/afiles

# Do some device permission magic
install -d -m 0755 %{buildroot}%{_datadir}/hal/fdi/policy/10osvendor/
install -p -m 0644 %{SOURCE1} \
        %{buildroot}%{_datadir}/hal/fdi/policy/10osvendor/19-color.fdi

install -d -m 0755 %{buildroot}%{_datadir}/PolicyKit/policy/
install -p -m 0644 %{SOURCE2} \
        %{buildroot}%{_datadir}/PolicyKit/policy/color-device-file.policy


%clean
rm -rf %{buildroot}


%files
%defattr(0644,root,root,0755)
%doc *.txt

%attr(0755,root,root) %{_bindir}/*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*
%{_datadir}/hal/fdi/policy/10osvendor/19-color.fdi
%{_datadir}/PolicyKit/policy/color-device-file.policy


%files doc
%defattr(0644,root,root,0755)
%doc doc/*.html doc/*.jpg doc/*.txt


%changelog
* Wed Mar 26 2008 Tom "spot" Callaway <tcallawa@redhat.com>
- patch applied for legal reasons

* Thu Feb 8 2008 Nicolas Mailhot <nicolas.mailhot at laposte.net>
- 0.70-0.8.Beta9
✓ Another code fix (Stefan Brüns)
- 0.70-0.8.Beta8
✓ update to Stefan Brüns' latest safe-printf patch (bz421921#c18)

* Thu Feb 7 2008 Nicolas Mailhot <nicolas.mailhot at laposte.net>
- 0.70-0.7.Beta8
  Finally got around packaging beta8, I suck
✓ Fedora patches merged upstream, dropped from rpm
✓ Huey handling seems sanitized (needs testing by Huey users)
⚖ Upstream relicensed icc and cgats library to plain MIT license (Thanks!)

* Thu Dec 14 2007 Nicolas Mailhot <nicolas.mailhot at laposte.net>
- 0.70-0.6.Beta7
☹ fix udev typo
- 0.70-0.5.Beta7
⚖ Remove files that may be GPLv2-only according to upstream

* Thu Dec 13 2007 Nicolas Mailhot <nicolas.mailhot at laposte.net>
- 0.70-0.4.Beta7
✓ move to modern PolicyKit world (David Zeuthen, Frédéric Crozat, me)

* Wed Dec 12 2007 Nicolas Mailhot <nicolas.mailhot at laposte.net>
- 0.70-0.3.Beta7
✓ integrate review feedback
- 0.70-0.2.Beta7
✓ fix buffer overflows in dispread and iccdump (credits Daniel Berrangé)
- 0.70-0.1.Beta7
✓ 0.70 beta7
➤ initial laborious packaging
✌ Build system from hell untangling by Frédéric Crozat (Mandriva), and me
✌ device permission magic by me
☣ Massively under-tested package, please report problems