90e880
%global sover 1.8
90e880
7a6331
Name:           OpenImageIO
53c00d
Version:        1.8.12
bdcb30
Release:        2%{?dist}
7a6331
Summary:        Library for reading and writing images
7a6331
7a6331
License:        BSD
7a6331
URL:            https://sites.google.com/site/openimageio/home
22a683
Source0:        https://github.com/%{name}/oiio/archive/Release-%{version}/%{name}-%{version}.tar.gz
3bbc3b
# Images for test suite
a0d96e
#Source1:        oiio-images.tar.gz
527c81
cabde4
Patch0:         OpenImageIO-man.patch
33da6d
a03ab4
BuildRequires:  cmake gcc-c++
ebab20
BuildRequires:  txt2man
1eed71
BuildRequires:  qt5-devel
9a2156
BuildRequires:  boost-devel
47f692
%if 0%{?fedora} > 28
9a2156
BuildRequires:  boost-python2-devel
9a2156
%else
9a2156
BuildRequires:  boost-python-devel
9a2156
%endif
2f57d9
BuildRequires:  glew-devel
2f57d9
BuildRequires:  OpenEXR-devel ilmbase-devel
2f57d9
BuildRequires:  python2-devel
b74dc2
BuildRequires:  libpng-devel libtiff-devel libjpeg-turbo-devel openjpeg2-devel
b74dc2
BuildRequires:  giflib-devel
ebab20
BuildRequires:  libwebp-devel
ebab20
BuildRequires:  Field3D-devel
ebab20
BuildRequires:  hdf5-devel
4b1984
BuildRequires:  dcmtk-devel
2f57d9
BuildRequires:  zlib-devel
2f57d9
BuildRequires:  jasper-devel
7a6331
BuildRequires:  pugixml-devel
fd7f92
BuildRequires:  opencv-devel
3392bf
BuildRequires:  LibRaw-devel
f1580b
BuildRequires:  openssl-devel
92eeec
92eeec
# WARNING: OpenColorIO and OpenImageIO are cross dependent.
92eeec
# If an ABI incompatible update is done in one, the other also needs to be
92eeec
# rebuilt.
b8cbdd
BuildRequires:  OpenColorIO-devel
7a6331
7a6331
7a6331
%description
7a6331
OpenImageIO is a library for reading and writing images, and a bunch of related
7a6331
classes, utilities, and applications. Main features include:
7a6331
- Extremely simple but powerful ImageInput and ImageOutput APIs for reading and
7a6331
  writing 2D images that is format agnostic.
7a6331
- Format plugins for TIFF, JPEG/JFIF, OpenEXR, PNG, HDR/RGBE, Targa, JPEG-2000,
7a6331
  DPX, Cineon, FITS, BMP, ICO, RMan Zfile, Softimage PIC, DDS, SGI,
7a6331
  PNM/PPM/PGM/PBM, Field3d.
7a6331
- An ImageCache class that transparently manages a cache so that it can access
7a6331
  truly vast amounts of image data.
2f57d9
2f57d9
e60375
%package -n python2-openimageio
b9ab72
Summary:        Python 2 bindings for %{name}
b9ab72
Requires:       %{name}%{?_isa} = %{version}-%{release}
22a683
%{?python_provide:%python_provide python2-%{srcname}}
b9ab72
e60375
%description -n python2-openimageio
b9ab72
Python bindings for %{name}.
b9ab72
b9ab72
2f57d9
%package utils
92eeec
Summary:        Command line utilities for %{name}
2f57d9
Requires:       %{name}%{?_isa} = %{version}-%{release}
2f57d9
2f57d9
%description utils
92eeec
Command-line tools to manipulate and get information on images using the
2f57d9
%{name} library.
2f57d9
2f57d9
2f57d9
%package iv
92eeec
Summary:        %{name} based image viewer
2f57d9
Requires:       %{name}%{?_isa} = %{version}-%{release}
2f57d9
2f57d9
%description iv
c37941
A really nice image viewer, iv, based on %{name} classes (and so will work
c37941
with any formats for which plugins are available).
7a6331
527c81
7a6331
%package devel
527c81
Summary:        Documentation for %{name}
7a6331
Requires:       %{name}%{?_isa} = %{version}-%{release}
7a6331
7a6331
%description devel
7a6331
Development files for package %{name}
7a6331
7a6331
7a6331
%prep
79e7f9
%autosetup -p1 -n oiio-Release-%{version}
3bbc3b
7a6331
# Remove bundled pugixml
e5a740
rm -f src/include/OpenImageIO/pugixml.hpp \
e5a740
      src/include/OpenImageIO/pugiconfig.hpp \
e5a740
      src/libutil/OpenImageIO/pugixml.cpp 
527c81
1a39c4
# Remove bundled tbb
7a6331
rm -rf src/include/tbb
3bbc3b
3bbc3b
# Install test images
3bbc3b
#rm -rf ../oiio-images && mkdir ../oiio-images && pushd ../oiio-images
3bbc3b
#tar --strip-components=1 -xzf %{SOURCE1}
7a6331
7a6331
7a6331
%build
3bbc3b
rm -rf build/linux && mkdir -p build/linux && pushd build/linux
527c81
# CMAKE_SKIP_RPATH is OK here because it is set to FALSE internally and causes
527c81
# CMAKE_INSTALL_RPATH to be cleared, which is the desiered result.
fdddaa
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
fdddaa
       -DCMAKE_SKIP_RPATH:BOOL=TRUE \
7a6331
       -DINCLUDE_INSTALL_DIR:PATH=/usr/include/%{name} \
7a6331
       -DPYLIB_INSTALL_DIR:PATH=%{python_sitearch} \
85af7b
       -DBUILD_DOCS:BOOL=TRUE \
85af7b
       -DINSTALL_DOCS:BOOL=FALSE \
631720
       -DINSTALL_FONTS:BOOL=FALSE \
7a6331
       -DUSE_EXTERNAL_PUGIXML:BOOL=TRUE \
f1580b
       -DUSE_OPENSSL:BOOL=TRUE \
e1ef02
       -DSTOP_ON_WARNING:BOOL=FALSE \
85af7b
       -DUSE_CPP:STRING=14 \
5d225e
%ifarch ppc ppc64
8dcfcd
       -DNOTHREADS:BOOL=FALSE \
f84394
%endif
b74dc2
       -DJPEG_INCLUDE_DIR=%{_includedir} \
b74dc2
       -DOPENJPEG_INCLUDE_DIR=$(pkgconf --variable=includedir libopenjp2) \
39a295
       -DVERBOSE=TRUE \
92eeec
       ../../
7a6331
1eed71
%make_build
7a6331
7a6331
7a6331
%install
3bbc3b
pushd build/linux
1eed71
%make_install
7a6331
7a6331
# Move man pages to the right directory
7a6331
mkdir -p %{buildroot}%{_mandir}/man1
92eeec
cp -a src/doc/*.1 %{buildroot}%{_mandir}/man1
7a6331
7a6331
527c81
%check
5d225e
# Not all tests pass on linux
3bbc3b
#pushd build/linux && make test
527c81
527c81
7a6331
%files
45c2a1
%doc CHANGES.md README.md
90e880
%license LICENSE
90e880
%{_libdir}/libOpenImageIO.so.%{sover}*
90e880
%{_libdir}/libOpenImageIO_Util.so.%{sover}*
b9ab72
e60375
%files -n python2-openimageio
b74dc2
%{python2_sitearch}/OpenImageIO.so
2f57d9
2f57d9
%files utils
2f57d9
%exclude %{_bindir}/iv
2f57d9
%{_bindir}/*
cabde4
%exclude %{_mandir}/man1/iv.1.gz
2f57d9
%{_mandir}/man1/*.1.gz
2f57d9
2f57d9
%files iv
2f57d9
%{_bindir}/iv
cabde4
%{_mandir}/man1/iv.1.gz
7a6331
7a6331
%files devel
7a6331
%doc src/doc/*.pdf
7a6331
%{_libdir}/libOpenImageIO.so
054dab
%{_libdir}/libOpenImageIO_Util.so
7a6331
%{_includedir}/*
7a6331
5371af
7a6331
%changelog
bdcb30
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.12-2
bdcb30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
bdcb30
53c00d
* Fri Jun 01 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.12-1
53c00d
- Update to 1.8.12.
53c00d
eedcd8
* Mon Apr 02 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.10-1
eedcd8
- Update to 1.8.10.
eedcd8
dd39d2
* Fri Mar 02 2018 Adam Williamson <awilliam@redhat.com> - 1.8.9-2
dd39d2
- Rebuild for opencv 3.4.1
dd39d2
d7bdc6
* Thu Mar 01 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.9-1
d7bdc6
- Update to 1.8.9
d7bdc6
8122e4
* Fri Feb 23 2018 Peter Robinson <pbrobinson@fedoraproject.org> 1.8.8-3
8122e4
- Rebuild
8122e4
91369e
* Tue Feb 13 2018 Sandro Mani <manisandro@gmail.com> - 1.8.8-2
91369e
- Rebuild (giflib)
91369e
b73085
* Fri Feb 02 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.8-1
b73085
- Update to 1.8.8.
b73085
b74dc2
* Thu Jan 18 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.7-3
b74dc2
- Add openjpeg2 to build dependencies.
b74dc2
- Re-enable dcmtk for 32bit arches.
b74dc2
fec3e2
* Sat Jan 13 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.7-2
fec3e2
- Rebuild for OpenColorIO 1.1.0.
fec3e2
a6324e
* Wed Jan 03 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.7-1
a6324e
- Update to latest upstream release.
a6324e
- Disable building with dcmtk until fixed, see:
a6324e
  https://github.com/OpenImageIO/oiio/issues/1841
a6324e
d96454
* Thu Nov 02 2017 Richard Shaw <hobbes1069@gmail.com> - 1.8.6-1
d96454
- Update to latest upstream release.
85af7b
- Add dcmtk to build to enable DICOM plugin.