90e880c
%global sover 1.8
90e880c
7a63317
Name:           OpenImageIO
b73085a
Version:        1.8.8
8122e40
Release:        3%{?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
cabde45
Patch0:         OpenImageIO-man.patch
33da6d4
a03ab4c
BuildRequires:  cmake gcc-c++
ebab20c
BuildRequires:  txt2man
1eed71f
BuildRequires:  qt5-devel
2f57d9f
BuildRequires:  boost-devel
2f57d9f
BuildRequires:  glew-devel
2f57d9f
BuildRequires:  OpenEXR-devel ilmbase-devel
2f57d9f
BuildRequires:  python2-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
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
e603759
%package -n python2-openimageio
b9ab72a
Summary:        Python 2 bindings for %{name}
b9ab72a
Requires:       %{name}%{?_isa} = %{version}-%{release}
22a6838
%{?python_provide:%python_provide python2-%{srcname}}
b9ab72a
e603759
%description -n python2-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
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} \
7a63317
       -DPYLIB_INSTALL_DIR:PATH=%{python_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) \
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
45c2a19
%doc CHANGES.md README.md
90e880c
%license LICENSE
90e880c
%{_libdir}/libOpenImageIO.so.%{sover}*
90e880c
%{_libdir}/libOpenImageIO_Util.so.%{sover}*
b9ab72a
e603759
%files -n python2-openimageio
b74dc29
%{python2_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
7a63317
%{_includedir}/*
7a63317
5371afc
7a63317
%changelog
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.