File OpenImageIO.spec of Package OpenImageIO

#
# spec file for package OpenImageIO
#
# 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 http://bugs.opensuse.org/
#

%define so_ver 1_5

Name:           OpenImageIO
Version:        1.5.12
Release:        0
Summary:        Library for Reading and Writing Images
License:        BSD-3-Clause
Group:          Productivity/Graphics/Other
Url:            http://www.openimageio.org/
#DL-URL: https://github.com/OpenImageIO/oiio/archive/Release-%%{version}/OpenImageIO-%%{version}.tar.gz
Source0:        oiio-Release-%{version}.tar.bz2
#BuildRequires:  Field3D-devel
BuildRequires:  OpenColorIO-devel
BuildRequires:  boost-devel
BuildRequires:  cmake
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  freetype2-devel
BuildRequires:  glew-devel
#BuildRequires:  hdf5-devel
%if 0%{?suse_version} > 1220
BuildRequires:  ilmbase-devel
%else
BuildRequires:  libilmbase-devel
%endif
BuildRequires:  libjpeg-devel
BuildRequires:  libopenssl-devel
BuildRequires:  libpng-devel
BuildRequires:  libqt4-devel
BuildRequires:  libtiff-devel
BuildRequires:  libwebp-devel
BuildRequires:  opencv-devel
%if 0%{?suse_version} > 1220
BuildRequires:  openexr-devel
%else
BuildRequires:  OpenEXR-devel
%endif
#BuildRequires:  openjpeg-devel
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glu)
BuildRequires:  pugixml-devel
BuildRequires:  python-devel
# NOTE: txt2man is needed for the man pages but not in factory.
#BuildRequires:  txt2man
BuildRequires:  zlib-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
OpenImageIO is a library for reading and writing images, and a bunch of related
classes, utilities, and applications. There is a particular emphasis on formats
and functionality used in professional, large-scale animation and visual
effects work for film. OpenImageIO is used extensively in animation and VFX
studios all over the world, and is also incorporated into several commercial
products.

%package devel
Summary:        Development Files for OpenImageIO
Group:          Development/Libraries/C and C++
Requires:       libOpenImageIO%{so_ver} = %{version}
Requires:       libOpenImageIO_Util%{so_ver} = %{version}

%description devel
This package provides development libraries and headers needed to build
software using OpenImageIO.

%package -n libOpenImageIO%{so_ver}
Summary:        Library for Reading and Writing Images
Group:          System/Libraries

%description -n libOpenImageIO%{so_ver}
OpenImageIO is a library for reading and writing images, and a bunch of related
classes, utilities, and applications. There is a particular emphasis on formats
and functionality used in professional, large-scale animation and visual
effects work for film. OpenImageIO is used extensively in animation and VFX
studios all over the world, and is also incorporated into several commercial
products.

%package -n libOpenImageIO_Util%{so_ver}
Summary:        Library for Reading and Writing Images
Group:          System/Libraries

%description -n libOpenImageIO_Util%{so_ver}
OpenImageIO is a library for reading and writing images, and a bunch of related
classes, utilities, and applications. There is a particular emphasis on formats
and functionality used in professional, large-scale animation and visual
effects work for film. OpenImageIO is used extensively in animation and VFX
studios all over the world, and is also incorporated into several commercial
products.

%package -n python-OpenImageIO
Summary:        Python Bindings for OpenImageIO
Group:          Development/Libraries/Python
%{py_requires}

%description -n python-OpenImageIO
This package contains python bindings for OpenImageIO.

%prep
%setup -q -n oiio-Release-%{version}

# Make sure that bundled libraries are not used
rm -f src/include/pugiconfig.hpp \
      src/include/pugixml.hpp
rm -rf src/include/tbb/

%build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
mkdir -p build
cd build
# CMAKE_SKIP_RPATH is OK here because it is set to FALSE internally and causes
# CMAKE_INSTALL_RPATH to be cleared, which is the desired result.
cmake \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    -DLIB_INSTALL_DIR=%{_libdir} \
    -DPYLIB_INSTALL_DIR=%{python_sitearch} \
    -DDOC_INSTALL_DIR=%{_docdir}/%{name} \
    -DBUILDSTATIC=OFF \
    -DLINKSTATIC=OFF \
    -DUSE_EXTERNAL_PUGIXML=ON \
    -DUSE_FFMPEG:BOOL=OFF \
    -DUSE_TBB=OFF \
    -DCMAKE_SKIP_RPATH=ON \
%ifarch ppc ppc64
    -DNOTHREADS=ON \
%endif
    ..
make %{?_smp_mflags} VERBOSE=1
cd ..

make doxygen

%install
%make_install -C build

# Move devel documentation to the right location
mkdir -p %{buildroot}%{_docdir}/%{name}-devel
mv %{buildroot}%{_docdir}/%{name}/openimageio.pdf %{buildroot}%{_docdir}/%{name}-devel/
%if 1 == 0
# Install additional devel documentation
cp -a src/doc/doxygen/html/ %{buildroot}%{_docdir}/%{name}-devel/
%endif

%fdupes -s %{buildroot}

%post -n libOpenImageIO%{so_ver} -p /sbin/ldconfig

%postun -n libOpenImageIO%{so_ver} -p /sbin/ldconfig

%post -n libOpenImageIO_Util%{so_ver} -p /sbin/ldconfig

%postun -n libOpenImageIO_Util%{so_ver} -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc CHANGES CREDITS LICENSE README.rst
%{_bindir}/*
%if 1 == 0
%doc %{_mandir}/man1/*.1%{ext_man}
%endif

%files devel
%defattr(-,root,root,-)
%doc %{_docdir}/%{name}-devel/
%{_includedir}/OpenImageIO/
%{_libdir}/*.so

%files -n libOpenImageIO%{so_ver}
%defattr(-,root,root,-)
%{_libdir}/libOpenImageIO.so.*

%files -n libOpenImageIO_Util%{so_ver}
%defattr(-,root,root,-)
%{_libdir}/libOpenImageIO_Util.so.*

%files -n python-OpenImageIO
%defattr(-,root,root,-)
%{python_sitearch}/OpenImageIO.so

%changelog
openSUSE Build Service is sponsored by