File argyllcms.spec of Package argyllcms

# spec file for package argyllcms
# Copyright (c) 2015 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

%define _udevrulesdir %(pkg-config --variable=udevdir udev)/rules.d

%define archivename Argyll_V%{version}%{?alphaversion}

Name:           argyllcms
Version:        1.6.3
Release:        0
Summary:        ICC compatible color management system
License:        AGPL-3.0 and GPL-2.0+ and MIT
Group:          System/X11/Utilities

Url:            http://www.%{name}.com/

Source0:        %{url}%{archivename}
Source1:        19-color.fdi
Source2:        color-device-file.policy
Source3:        ajam-2.5.2-1.3.3.tgz
Source99:       argyllcms.changes
# drop udev-acl stuff, handled by udev directly (Mandriva)
Patch5:         argyllcms-udev151.patch
Patch7:         ajam-include.patch
Patch8:         argyllcms-1.4.0-warnings.patch
# PATCH-FIX-UPSTREAM argyllcms-udev-builtin.patch -- usb-db is now builtin in udev
Patch9:         argyllcms-udev-builtin.patch
# PATCH-FIX-UPSTREAM argyllcms-udev-hwdb.patch -- usb-db is replaced by hwdb in recent udev
Patch10:        argyllcms-udev-hwdb.patch
# PATCH-FIX-UPSTREAM argyllcms-decl.patch -- Add missing headers.
Patch12:        argyllcms-decl.patch

BuildRequires:  libjpeg-devel
BuildRequires:  libtiff-devel
BuildRequires:  libtool
BuildRequires:  unzip
BuildRequires:  xorg-x11-devel
#needed for ajam
BuildRequires:  bison
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  pkgconfig(udev)
Requires:       udev
%if 0%{?suse_version} < 1120
BuildRequires:  hal
Requires:       hal
# FIXME: The application dlopens, which does not
# exists in openSUSE colord package. We should use Suggests
# or Recommends here, and change its name in the source code
# to not read file from colord-devel.

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

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

%package doc
Summary:        Argyll CMS documentation
Group:          System/X11/Utilities
# Does not really make sense without Argyll CMS itself
Requires:       %{name} = %{version}

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

This package contains the Argyll color management system documentation.

%setup -q -n Argyll_V%{version}
%if 0%{?suse_version} >= 1120
%patch5 -p1 -b .udev151
%if 0%{?suse_version} >= 1220
%if 0%{?suse_version} >= 1310
%patch10 -p1 -b .hwdb
%patch9 -p1 -b .builtin
%patch8 -p1 -b .warnings
%patch12 -p1

tar xf %{SOURCE3}
cd ajam-2.5.2-1.3.3
%patch7 -p1 -b .include
cd ..

# remove unused source code
rm -fr usb/{*.inf,*.rtf,*.inf,*.cat,*.vcproj,*.sys,*.dsw,*.sln,*.dsp,*template*,WinCo*,winsub*,*kext*,KDRIVER_LICENSE,README_MSVC.txt,msvc,*.cmd,bin,driver,binfiles.*}

cd ajam-2.5.2-1.3.3
make CFLAGS="-std=gnu89 ${RPM_OPT_FLAGS}"
ln -s $PWD/bin.unix/jam ../jam
cd ..

echo "CCFLAGS += -std=gnu89 ${RPM_OPT_FLAGS} -fno-strict-aliasing ;" >> Jamtop
# Evil hack to get --as-needed working. The build system unfortunately lists all
# the shared libraries by default on the command line _before_ the object to be built...
echo "STDLIBS += -ldl -lrt -lX11 -lXext -lXxf86vm -lXinerama -lXrandr -lXau -lXdmcp -lXss -ltiff -ljpeg ;" >> Jamtop

./jam  -fJambase %{?_smp_mflags}

./jam -q -fJambase install

rm bin/License.txt

mkdir -p $RPM_BUILD_ROOT/{%{_bindir},%{_datadir}/color/argyll/ref}

install -m 0755 -D bin/* $RPM_BUILD_ROOT/%{_bindir}

install -m 0644 -D ref/*  %{buildroot}/%{_datadir}/color/argyll/ref
rm -f $RPM_BUILD_ROOT/%{_datadir}/color/argyll/License.txt

# ensure timestamp is shipped files is not changing for each rebuild (boo#916158)
TIMESTAMP=$(LC_ALL=C date -r %{SOURCE99} +%c)

sed -i -e 's/^CREATED .*/CREATED "$TIMESTAMP"/g' %{buildroot}%{_datadir}/color/argyll/ref/RefMediumGamut.gam

%if 0%{?suse_version} < 1120
# Do some device permission magic
install -d -m 0755 %{buildroot}%{_datadir}/hal/fdi/policy/10osvendor/
install -p -m 0644 %{SOURCE1} \

install -d -m 0755 %{buildroot}%{_datadir}/PolicyKit/policy/
install -p -m 0644 %{SOURCE2} \
install -d -m 0755 %{buildroot}%{_udevrulesdir}
install -p -m 0644 usb/55-Argyll.rules \

rm -rf %{buildroot}

%doc *.txt

%dir %{_datadir}/color

%if 0%{?suse_version} < 1120

%files doc
%doc doc/*.html doc/*.jpg doc/*.txt

openSUSE Build Service is sponsored by