File OpenGTL.spec of Package OpenGTL

#
# spec file for package OpenGTL
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright 2009 Buschmann <buschmann23@opensuse.org>
# Copyright (c) 2013 Asterios Dramis <asterios.dramis@gmail.com>.
#
# 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 libver 0_8
%define soversion 0.8

Name:           OpenGTL
Version:        0.9.18
Release:        0
Summary:        Graphics Transformation Languages
License:        LGPL-2.0+
Group:          Productivity/Graphics/Other
Url:            http://www.opengtl.org/
Source0:        http://download.opengtl.org/%{name}-%{version}.tar.bz2
# PATCH-FIX-OPENSUSE GTLImageIO-Extensions-Installdir.patch -- Change GTLImageIO Extensions installation path to use the OpenGTL version
Patch0:         GTLImageIO-Extensions-Installdir.patch
# PATCH-FIX-UPSTREAM OpenGTL-libpng16.patch pgajdos@suse.com -- build also with libpng16; sent to  cberger (at) cberger.net
Patch1:         OpenGTL-libpng16.patch
# PATCH-FIX-OPENSUSE opengtl-0.9.18-llvm-3.3svn.patch asterios.dramis@gmail.com -- Fix compilation with llvm-3.3svn (taken from Fedora)
Patch2:         opengtl-0.9.18-llvm-3.3svn.patch
# PATCH-FIX-OPENSUSE fix_linking.patch asterios.dramis@gmail.com -- Fix multiple definition linking error
Patch3:         fix_linking.patch
# PATCH-FIX-OPENSUSE OpenGTL-0.9.18-pkgconfig_llvm_libs_private.patch asterios.dramis@gmail.com -- Mark llvm-libs private/static in pkgconfig files (taken from Fedora)
Patch4:         OpenGTL-0.9.18-pkgconfig_llvm_libs_private.patch
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  libpng-devel
BuildRequires:  llvm-devel >= 3.1
BuildRequires:  zlib-devel
Recommends:     shiva-collections
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The Graphics Transformation Languages is a set of library for using and
integrating transformation algorithms (such as filter or color conversion) in
graphics applications.

The goal is to provide the tools, languages and libraries to create generic
transformation for graphics. Those transformations could then be used by
different programs.

%package devel
Summary:        Include Files and Libraries Mandatory for Development with OpenGTL
Group:          Development/Libraries/C and C++
Requires:       libGTLCore%{libver} = %{version}
Requires:       libGTLFragment%{libver} = %{version}
Requires:       libGTLImageIO%{libver} = %{version}
Requires:       libOpenCTL%{libver} = %{version}
Requires:       libOpenShiva%{libver} = %{version}

%description devel
This package contains include files and libraries mandatory for development
with OpenGTL.

%package -n libGTLCore%{libver}
Summary:        Graphics Transformation Languages - Core Functionnalities
Group:          System/Libraries
Requires:       llvm >= 3.1

%description -n libGTLCore%{libver}
The Graphics Transformation Languages is a set of library for using and
integrating transformation algorithms (such as filter or color conversion) in
graphics applications.

The goal is to provide the tools, languages and libraries to create generic
transformation for graphics. Those transformations could then be used by
different programs.

GTLCore: this library provides Core functionnalities, such as debug, or memory
buffer.

%package -n libGTLFragment%{libver}
Summary:        Graphics Transformation Languages - Core Functionnalities
Group:          System/Libraries
Requires:       llvm >= 3.1

%description -n libGTLFragment%{libver}
The Graphics Transformation Languages is a set of library for using and
integrating transformation algorithms (such as filter or color conversion) in
graphics applications.

The goal is to provide the tools, languages and libraries to create generic
transformation for graphics. Those transformations could then be used by
different programs.

GTLFragment: base Library for Shiva and Rijn.

%package -n libGTLImageIO%{libver}
Summary:        Graphics Transformation Languages - Decode/Encode Images
Group:          System/Libraries
Requires:       llvm >= 3.1

%description -n libGTLImageIO%{libver}
The Graphics Transformation Languages is a set of library for using and
integrating transformation algorithms (such as filter or color conversion) in
graphics applications.

The goal is to provide the tools, languages and libraries to create generic
transformation for graphics. Those transformations could then be used by
different programs.

GTLImageIO: library to decode/encode images.

%package -n libOpenCTL%{libver}
Summary:        Color Transformation Language
Group:          System/Libraries
Requires:       llvm >= 3.1

%description -n libOpenCTL%{libver}
OpenCTL is a GPL compatible of the Color Transformation Language, this language
is dedicated at transforming the value of a single pixel (for instance
Brightness adjustement or desaturate). CTL is designed to be part of the Color
Management process.

%package -n libOpenShiva%{libver}
Summary:        Image Transformation Library
Group:          System/Libraries
Requires:       llvm >= 3.1

%description -n libOpenShiva%{libver}
Shiva is a language that apply a kernel-like transformations on an image, that
means it works using more than one pixel.

%prep
%setup -q
%patch0
%patch1 -p1
%if 0%{?suse_version} > 1230
%patch2 -p1
%endif
%patch3
%patch4 -p1

%build
mkdir build
cd build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
__libsuffix=$(echo %{_lib} | cut -b4-)
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
      -DLIB_SUFFIX="$__libsuffix" \
      -DCMAKE_BUILD_TYPE=release \
      ..
make %{?_smp_mflags} VERBOSE=1
cd ..

%install
%make_install -C build

%post -n libGTLCore%{libver} -p /sbin/ldconfig

%postun -n libGTLCore%{libver} -p /sbin/ldconfig

%post -n libGTLFragment%{libver} -p /sbin/ldconfig

%postun -n libGTLFragment%{libver} -p /sbin/ldconfig

%post -n libGTLImageIO%{libver} -p /sbin/ldconfig

%postun -n libGTLImageIO%{libver} -p /sbin/ldconfig

%post -n libOpenCTL%{libver} -p /sbin/ldconfig

%postun -n libOpenCTL%{libver} -p /sbin/ldconfig

%post -n libOpenShiva%{libver} -p /sbin/ldconfig

%postun -n libOpenShiva%{libver} -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc COPYING
%{_bindir}/ctlc
%{_bindir}/ctli
%{_bindir}/ctltc
%{_bindir}/gtlconvert
%{_bindir}/imagecompare
%{_bindir}/shiva
%{_bindir}/shivacheck
%{_bindir}/shivanimator
%{_bindir}/shivac
%{_bindir}/shivainfo
%{_bindir}/shivatester
%{_datadir}/OpenGTL/

%files devel
%defattr(-,root,root,-)
%{_includedir}/GTLCore/
%{_includedir}/GTLFragment/
%{_includedir}/GTLImageIO/
%{_includedir}/OpenCTL/
%{_includedir}/OpenShiva/
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc

%files -n libGTLCore%{libver}
%defattr(-,root,root,-)
%{_libdir}/libGTLCore.so.%{soversion}
%{_libdir}/libGTLCore.so.%{version}

%files -n libGTLFragment%{libver}
%defattr(-,root,root,-)
%{_libdir}/libGTLFragment.so.%{soversion}
%{_libdir}/libGTLFragment.so.%{version}

%files -n libGTLImageIO%{libver}
%defattr(-,root,root,-)
%{_libdir}/libGTLImageIO.so.%{soversion}
%{_libdir}/libGTLImageIO.so.%{version}
%{_libdir}/GTLImageIO-%{version}/

%files -n libOpenCTL%{libver}
%defattr(-,root,root,-)
%{_libdir}/libOpenCTL.so.%{soversion}
%{_libdir}/libOpenCTL.so.%{version}

%files -n libOpenShiva%{libver}
%defattr(-,root,root,-)
%{_libdir}/libOpenShiva.so.%{soversion}
%{_libdir}/libOpenShiva.so.%{version}

%changelog
openSUSE Build Service is sponsored by