Blob Blame History Raw
%global sover 2.0

Name:           OpenImageIO
Version:        2.0.7
Release:        1%{?dist}
Summary:        Library for reading and writing images

License:        BSD
URL:            https://sites.google.com/site/openimageio/home
Source0:        https://github.com/%{name}/oiio/archive/Release-%{version}/%{name}-%{version}.tar.gz
# Images for test suite
#Source1:        oiio-images.tar.gz

BuildRequires:  cmake gcc-c++
BuildRequires:  txt2man
BuildRequires:  qt5-qtbase-devel
BuildRequires:  boost-devel
BuildRequires:  boost-python3-devel
BuildRequires:  glew-devel
BuildRequires:  OpenEXR-devel ilmbase-devel
BuildRequires:  python3-devel
BuildRequires:  libpng-devel libtiff-devel libjpeg-turbo-devel openjpeg2-devel
BuildRequires:  giflib-devel
BuildRequires:  libwebp-devel
BuildRequires:  Field3D-devel
BuildRequires:  hdf5-devel
BuildRequires:  dcmtk-devel
BuildRequires:  zlib-devel
BuildRequires:  jasper-devel
BuildRequires:  pugixml-devel
BuildRequires:  opencv-devel
BuildRequires:  LibRaw-devel
BuildRequires:  openssl-devel
# New build requirements for 2.0
BuildRequires:  robin-map-devel
BuildRequires:  pybind11-devel

# WARNING: OpenColorIO and OpenImageIO are cross dependent.
# If an ABI incompatible update is done in one, the other also needs to be
# rebuilt.
BuildRequires:  OpenColorIO-devel


%description
OpenImageIO is a library for reading and writing images, and a bunch of related
classes, utilities, and applications. Main features include:
- Extremely simple but powerful ImageInput and ImageOutput APIs for reading and
  writing 2D images that is format agnostic.
- Format plugins for TIFF, JPEG/JFIF, OpenEXR, PNG, HDR/RGBE, Targa, JPEG-2000,
  DPX, Cineon, FITS, BMP, ICO, RMan Zfile, Softimage PIC, DDS, SGI,
  PNM/PPM/PGM/PBM, Field3d.
- An ImageCache class that transparently manages a cache so that it can access
  truly vast amounts of image data.


%package -n python3-openimageio
Summary:        Python 3 bindings for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-openimageio
Python bindings for %{name}.


%package utils
Summary:        Command line utilities for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description utils
Command-line tools to manipulate and get information on images using the
%{name} library.


%package iv
Summary:        %{name} based image viewer
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description iv
A really nice image viewer, iv, based on %{name} classes (and so will work
with any formats for which plugins are available).


%package devel
Summary:        Documentation for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description devel
Development files for package %{name}


%prep
%autosetup -p1 -n oiio-Release-%{version}

# Remove bundled pugixml
rm -f src/include/OpenImageIO/pugixml.hpp \
      src/include/OpenImageIO/pugiconfig.hpp \
      src/libutil/OpenImageIO/pugixml.cpp 

# Remove bundled tbb
rm -rf src/include/tbb

# Install test images
#rm -rf ../oiio-images && mkdir ../oiio-images && pushd ../oiio-images
#tar --strip-components=1 -xzf %{SOURCE1}

# Try disabeling old CMP
sed -i "s/SET CMP0046 OLD/SET CMP0046 NEW/" CMakeLists.txt


%build
rm -rf build/linux && mkdir -p build/linux && pushd build/linux
# CMAKE_SKIP_RPATH is OK here because it is set to FALSE internally and causes
# CMAKE_INSTALL_RPATH to be cleared, which is the desiered result.
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
       -DCMAKE_SKIP_RPATH:BOOL=TRUE \
       -DINCLUDE_INSTALL_DIR:PATH=/usr/include/%{name} \
       -DPYTHON_VERSION=%{python3_version} \
       -DPYLIB_INSTALL_DIR:PATH=%{python3_sitearch} \
       -DBUILD_DOCS:BOOL=TRUE \
       -DINSTALL_DOCS:BOOL=FALSE \
       -DINSTALL_FONTS:BOOL=FALSE \
       -DUSE_EXTERNAL_PUGIXML:BOOL=TRUE \
       -DUSE_OPENSSL:BOOL=TRUE \
       -DSTOP_ON_WARNING:BOOL=FALSE \
       -DUSE_CPP:STRING=14 \
%ifarch ppc ppc64
       -DNOTHREADS:BOOL=FALSE \
%endif
       -DJPEG_INCLUDE_DIR=%{_includedir} \
       -DOPENJPEG_INCLUDE_DIR=$(pkgconf --variable=includedir libopenjp2) \
       -DOpenGL_GL_PREFERENCE=GLVND \
       -DVERBOSE=TRUE \
       ../../

%make_build


%install
pushd build/linux
%make_install

# Move man pages to the right directory
mkdir -p %{buildroot}%{_mandir}/man1
cp -a src/doc/*.1 %{buildroot}%{_mandir}/man1


%check
# Not all tests pass on linux
#pushd build/linux && make test


%files
%doc CHANGES.md CREDITS.md README.md
%license LICENSE.md LICENSE-THIRD-PARTY.md
%{_libdir}/libOpenImageIO.so.%{sover}*
%{_libdir}/libOpenImageIO_Util.so.%{sover}*

%files -n python3-openimageio
%{python3_sitearch}/OpenImageIO.so

%files utils
%exclude %{_bindir}/iv
%{_bindir}/*
%exclude %{_mandir}/man1/iv.1.gz
%{_mandir}/man1/*.1.gz

%files iv
%{_bindir}/iv
%{_mandir}/man1/iv.1.gz

%files devel
%doc src/doc/*.pdf
%{_libdir}/libOpenImageIO.so
%{_libdir}/libOpenImageIO_Util.so
%{_libdir}/pkgconfig/%{name}.pc
%{_datadir}/cmake/Modules/FindOpenImageIO.cmake
%{_includedir}/%{name}/


%changelog
* Mon Apr 01 2019 Richard Shaw <hobbes1069@gmail.com> - 2.0.7-1
- Update to 2.0.7.

* Mon Mar 18 2019 Orion Poplawski <orion@nwra.com>
- Rebuild for hdf5 1.10.5

* Sun Mar 17 2019 Richard Shaw <hobbes1069@gmail.com> - 2.0.6-1
- Update to 2.0.6.

* Thu Mar 14 2019 Mohan Boddu <mboddu@bhujji.com> - 2.0.5-2
- Rebuilt for dcmtk 3.6.4

* Mon Feb 04 2019 Richard Shaw <hobbes1069@gmail.com> - 2.0.5-1
- Update to 2.0.5.

* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Thu Jan 24 2019 Jonathan Wakely <jwakely@redhat.com> - 2.0.4-2
- Rebuilt for Boost 1.69

* Sun Jan 06 2019 Richard Shaw <hobbes1069@gmail.com> - 2.0.4-1
- Update to 2.0.4:
  http://lists.openimageio.org/pipermail/oiio-dev-openimageio.org/2019-January/001391.html

* Sat Dec 08 2018 Richard Shaw <hobbes1069@gmail.com> - 2.0.3-1
- Update to 2.0.3.

* Mon Dec 03 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.17-1
- Update to 1.8.17.

* Fri Nov 02 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.16-1
- Update to 1.8.16.

* Tue Oct 02 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.15-1
- Update to 1.8.15.

* Mon Sep 24 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.14-2
- Remove python2 module and replace with python3 module.

* Mon Sep 03 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.14-1
- Update to 1.8.14.

* Wed Jul 18 2018 Simone Caronni <negativo17@gmail.com> - 1.8.12-3
- Rebuild for LibRaw update.

* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Fri Jun 01 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.12-1
- Update to 1.8.12.

* Mon Apr 02 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.10-1
- Update to 1.8.10.

* Fri Mar 02 2018 Adam Williamson <awilliam@redhat.com> - 1.8.9-2
- Rebuild for opencv 3.4.1

* Thu Mar 01 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.9-1
- Update to 1.8.9

* Fri Feb 23 2018 Peter Robinson <pbrobinson@fedoraproject.org> 1.8.8-3
- Rebuild

* Tue Feb 13 2018 Sandro Mani <manisandro@gmail.com> - 1.8.8-2
- Rebuild (giflib)

* Fri Feb 02 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.8-1
- Update to 1.8.8.

* Thu Jan 18 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.7-3
- Add openjpeg2 to build dependencies.
- Re-enable dcmtk for 32bit arches.

* Sat Jan 13 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.7-2
- Rebuild for OpenColorIO 1.1.0.

* Wed Jan 03 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.7-1
- Update to latest upstream release.
- Disable building with dcmtk until fixed, see:
  https://github.com/OpenImageIO/oiio/issues/1841

* Thu Nov 02 2017 Richard Shaw <hobbes1069@gmail.com> - 1.8.6-1
- Update to latest upstream release.
- Add dcmtk to build to enable DICOM plugin.