94795ee
%global sover 2.0
90e880c
7a63317
Name:           OpenImageIO
338d48f
Version:        2.0.4
c956bea
Release:        2%{?dist}
7a63317
Summary:        Library for reading and writing images
7a63317
7a63317
License:        BSD
7a63317
URL:            https://sites.google.com/site/openimageio/home
22a6838
Source0:        https://github.com/%{name}/oiio/archive/Release-%{version}/%{name}-%{version}.tar.gz
3bbc3b7
# Images for test suite
a0d96ee
#Source1:        oiio-images.tar.gz
527c815
a03ab4c
BuildRequires:  cmake gcc-c++
ebab20c
BuildRequires:  txt2man
38f03aa
BuildRequires:  qt5-qtbase-devel
9a21561
BuildRequires:  boost-devel
1deb182
BuildRequires:  boost-python3-devel
2f57d9f
BuildRequires:  glew-devel
2f57d9f
BuildRequires:  OpenEXR-devel ilmbase-devel
1deb182
BuildRequires:  python3-devel
b74dc29
BuildRequires:  libpng-devel libtiff-devel libjpeg-turbo-devel openjpeg2-devel
b74dc29
BuildRequires:  giflib-devel
ebab20c
BuildRequires:  libwebp-devel
ebab20c
BuildRequires:  Field3D-devel
ebab20c
BuildRequires:  hdf5-devel
4b19846
BuildRequires:  dcmtk-devel
2f57d9f
BuildRequires:  zlib-devel
2f57d9f
BuildRequires:  jasper-devel
7a63317
BuildRequires:  pugixml-devel
fd7f923
BuildRequires:  opencv-devel
3392bf1
BuildRequires:  LibRaw-devel
f1580b7
BuildRequires:  openssl-devel
94795ee
# New build requirements for 2.0
94795ee
BuildRequires:  robin-map-devel
94795ee
BuildRequires:  pybind11-devel
92eeec4
92eeec4
# WARNING: OpenColorIO and OpenImageIO are cross dependent.
92eeec4
# If an ABI incompatible update is done in one, the other also needs to be
92eeec4
# rebuilt.
b8cbdd9
BuildRequires:  OpenColorIO-devel
7a63317
7a63317
7a63317
%description
7a63317
OpenImageIO is a library for reading and writing images, and a bunch of related
7a63317
classes, utilities, and applications. Main features include:
7a63317
- Extremely simple but powerful ImageInput and ImageOutput APIs for reading and
7a63317
  writing 2D images that is format agnostic.
7a63317
- Format plugins for TIFF, JPEG/JFIF, OpenEXR, PNG, HDR/RGBE, Targa, JPEG-2000,
7a63317
  DPX, Cineon, FITS, BMP, ICO, RMan Zfile, Softimage PIC, DDS, SGI,
7a63317
  PNM/PPM/PGM/PBM, Field3d.
7a63317
- An ImageCache class that transparently manages a cache so that it can access
7a63317
  truly vast amounts of image data.
2f57d9f
2f57d9f
1deb182
%package -n python3-openimageio
1deb182
Summary:        Python 3 bindings for %{name}
b9ab72a
Requires:       %{name}%{?_isa} = %{version}-%{release}
1deb182
%{?python_provide:%python_provide python3-%{srcname}}
b9ab72a
1deb182
%description -n python3-openimageio
b9ab72a
Python bindings for %{name}.
b9ab72a
b9ab72a
2f57d9f
%package utils
92eeec4
Summary:        Command line utilities for %{name}
2f57d9f
Requires:       %{name}%{?_isa} = %{version}-%{release}
2f57d9f
2f57d9f
%description utils
92eeec4
Command-line tools to manipulate and get information on images using the
2f57d9f
%{name} library.
2f57d9f
2f57d9f
2f57d9f
%package iv
92eeec4
Summary:        %{name} based image viewer
2f57d9f
Requires:       %{name}%{?_isa} = %{version}-%{release}
2f57d9f
2f57d9f
%description iv
c37941e
A really nice image viewer, iv, based on %{name} classes (and so will work
c37941e
with any formats for which plugins are available).
7a63317
527c815
7a63317
%package devel
527c815
Summary:        Documentation for %{name}
7a63317
Requires:       %{name}%{?_isa} = %{version}-%{release}
7a63317
7a63317
%description devel
7a63317
Development files for package %{name}
7a63317
7a63317
7a63317
%prep
79e7f98
%autosetup -p1 -n oiio-Release-%{version}
3bbc3b7
7a63317
# Remove bundled pugixml
e5a7404
rm -f src/include/OpenImageIO/pugixml.hpp \
e5a7404
      src/include/OpenImageIO/pugiconfig.hpp \
e5a7404
      src/libutil/OpenImageIO/pugixml.cpp 
527c815
1a39c4a
# Remove bundled tbb
7a63317
rm -rf src/include/tbb
3bbc3b7
3bbc3b7
# Install test images
3bbc3b7
#rm -rf ../oiio-images && mkdir ../oiio-images && pushd ../oiio-images
3bbc3b7
#tar --strip-components=1 -xzf %{SOURCE1}
7a63317
e62907f
# Try disabeling old CMP
e62907f
sed -i "s/SET CMP0046 OLD/SET CMP0046 NEW/" CMakeLists.txt
e62907f
7a63317
7a63317
%build
3bbc3b7
rm -rf build/linux && mkdir -p build/linux && pushd build/linux
527c815
# CMAKE_SKIP_RPATH is OK here because it is set to FALSE internally and causes
527c815
# CMAKE_INSTALL_RPATH to be cleared, which is the desiered result.
fdddaa9
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
fdddaa9
       -DCMAKE_SKIP_RPATH:BOOL=TRUE \
7a63317
       -DINCLUDE_INSTALL_DIR:PATH=/usr/include/%{name} \
1deb182
       -DPYTHON_VERSION=%{python3_version} \
1deb182
       -DPYLIB_INSTALL_DIR:PATH=%{python3_sitearch} \
85af7b2
       -DBUILD_DOCS:BOOL=TRUE \
85af7b2
       -DINSTALL_DOCS:BOOL=FALSE \
631720a
       -DINSTALL_FONTS:BOOL=FALSE \
7a63317
       -DUSE_EXTERNAL_PUGIXML:BOOL=TRUE \
f1580b7
       -DUSE_OPENSSL:BOOL=TRUE \
e1ef02b
       -DSTOP_ON_WARNING:BOOL=FALSE \
85af7b2
       -DUSE_CPP:STRING=14 \
5d225ec
%ifarch ppc ppc64
8dcfcd4
       -DNOTHREADS:BOOL=FALSE \
f84394c
%endif
b74dc29
       -DJPEG_INCLUDE_DIR=%{_includedir} \
b74dc29
       -DOPENJPEG_INCLUDE_DIR=$(pkgconf --variable=includedir libopenjp2) \
e62907f
       -DOpenGL_GL_PREFERENCE=GLVND \
39a295a
       -DVERBOSE=TRUE \
92eeec4
       ../../
7a63317
1eed71f
%make_build
7a63317
7a63317
7a63317
%install
3bbc3b7
pushd build/linux
1eed71f
%make_install
7a63317
7a63317
# Move man pages to the right directory
7a63317
mkdir -p %{buildroot}%{_mandir}/man1
92eeec4
cp -a src/doc/*.1 %{buildroot}%{_mandir}/man1
7a63317
7a63317
527c815
%check
5d225ec
# Not all tests pass on linux
3bbc3b7
#pushd build/linux && make test
527c815
527c815
7a63317
%files
94795ee
%doc CHANGES.md CREDITS.md README.md
94795ee
%license LICENSE.md LICENSE-THIRD-PARTY.md
90e880c
%{_libdir}/libOpenImageIO.so.%{sover}*
90e880c
%{_libdir}/libOpenImageIO_Util.so.%{sover}*
b9ab72a
1deb182
%files -n python3-openimageio
1deb182
%{python3_sitearch}/OpenImageIO.so
2f57d9f
2f57d9f
%files utils
2f57d9f
%exclude %{_bindir}/iv
2f57d9f
%{_bindir}/*
cabde45
%exclude %{_mandir}/man1/iv.1.gz
2f57d9f
%{_mandir}/man1/*.1.gz
2f57d9f
2f57d9f
%files iv
2f57d9f
%{_bindir}/iv
cabde45
%{_mandir}/man1/iv.1.gz
7a63317
7a63317
%files devel
7a63317
%doc src/doc/*.pdf
7a63317
%{_libdir}/libOpenImageIO.so
054dab7
%{_libdir}/libOpenImageIO_Util.so
94795ee
%{_datadir}/cmake/Modules/FindOpenImageIO.cmake
7a63317
%{_includedir}/*
7a63317
5371afc
7a63317
%changelog
c956bea
* Thu Jan 24 2019 Jonathan Wakely <jwakely@redhat.com> - 2.0.4-2
c956bea
- Rebuilt for Boost 1.69
c956bea
338d48f
* Sun Jan 06 2019 Richard Shaw <hobbes1069@gmail.com> - 2.0.4-1
338d48f
- Update to 2.0.4:
338d48f
  http://lists.openimageio.org/pipermail/oiio-dev-openimageio.org/2019-January/001391.html
338d48f
94795ee
* Sat Dec 08 2018 Richard Shaw <hobbes1069@gmail.com> - 2.0.3-1
94795ee
- Update to 2.0.3.
94795ee
38f03aa
* Mon Dec 03 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.17-1
38f03aa
- Update to 1.8.17.
38f03aa
df05381
* Fri Nov 02 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.16-1
df05381
- Update to 1.8.16.
df05381
e62907f
* Tue Oct 02 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.15-1
e62907f
- Update to 1.8.15.
e62907f
1deb182
* Mon Sep 24 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.14-2
1deb182
- Remove python2 module and replace with python3 module.
1deb182
0463cae
* Mon Sep 03 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.14-1
0463cae
- Update to 1.8.14.
0463cae
35827d9
* Wed Jul 18 2018 Simone Caronni <negativo17@gmail.com> - 1.8.12-3
35827d9
- Rebuild for LibRaw update.
35827d9
bdcb305
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.12-2
bdcb305
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
bdcb305
53c00d2
* Fri Jun 01 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.12-1
53c00d2
- Update to 1.8.12.
53c00d2
eedcd8d
* Mon Apr 02 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.10-1
eedcd8d
- Update to 1.8.10.
eedcd8d
dd39d24
* Fri Mar 02 2018 Adam Williamson <awilliam@redhat.com> - 1.8.9-2
dd39d24
- Rebuild for opencv 3.4.1
dd39d24
d7bdc6e
* Thu Mar 01 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.9-1
d7bdc6e
- Update to 1.8.9
d7bdc6e
8122e40
* Fri Feb 23 2018 Peter Robinson <pbrobinson@fedoraproject.org> 1.8.8-3
8122e40
- Rebuild
8122e40
91369ed
* Tue Feb 13 2018 Sandro Mani <manisandro@gmail.com> - 1.8.8-2
91369ed
- Rebuild (giflib)
91369ed
b73085a
* Fri Feb 02 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.8-1
b73085a
- Update to 1.8.8.
b73085a
b74dc29
* Thu Jan 18 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.7-3
b74dc29
- Add openjpeg2 to build dependencies.
b74dc29
- Re-enable dcmtk for 32bit arches.
b74dc29
fec3e20
* Sat Jan 13 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.7-2
fec3e20
- Rebuild for OpenColorIO 1.1.0.
fec3e20
a6324ed
* Wed Jan 03 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.7-1
a6324ed
- Update to latest upstream release.
a6324ed
- Disable building with dcmtk until fixed, see:
a6324ed
  https://github.com/OpenImageIO/oiio/issues/1841
a6324ed
d964540
* Thu Nov 02 2017 Richard Shaw <hobbes1069@gmail.com> - 1.8.6-1
d964540
- Update to latest upstream release.
85af7b2
- Add dcmtk to build to enable DICOM plugin.