527c81
%global githash1 gad1950d
527c81
%global githash2 7b7590f
527c81
7a6331
Name:           OpenImageIO
527c81
Version:        0.10.4
527c81
Release:        1%{?dist}
7a6331
Summary:        Library for reading and writing images
7a6331
7a6331
Group:          Development/Libraries
7a6331
License:        BSD
7a6331
URL:            https://sites.google.com/site/openimageio/home
7a6331
527c81
Source0:        https://download.github.com/%{name}-oiio-Release-%{version}-0-%{githash1}.tar.gz
527c81
Source1:        FindTBB.cmake
527c81
927d71
Patch0:         OpenImageIO-0.10.2-git_backports.patch
7a6331
Patch1:         OpenImageIO-0.10.0-atomic_test_fix.patch
527c81
Patch2:         OpenImageIO-0.10.3-use_external_tbb.patch
1a39c4
Patch3:         OpenImageIO-0.10.2-Z_BEST_COMPRESSION.patch
33234c
Patch4:         OpenImageIO-0.10.4-gcc47_unistd_h.fix
7a6331
7a6331
BuildRequires:  boost-devel glew-devel qt-devel OpenEXR-devel ilmbase-devel
7a6331
BuildRequires:  python2-devel txt2man
31d9ad
BuildRequires:  libpng-devel libtiff-devel
7a6331
BuildRequires:  zlib-devel jasper-devel
7a6331
BuildRequires:  pugixml-devel
527c81
BuildRequires:  tbb-devel
7a6331
# Field3D support is not considered stable at this time and no package
7a6331
# currently exists for Fedora. Re-enable when fixed.
527c81
# Field3D Review Request: https://bugzilla.redhat.com/show_bug.cgi?id=753453
527c81
BuildRequires:  hdf5-devel Field3D-devel
7a6331
66ec4f
# We don't want to provide private python extension libs
66ec4f
%{?filter_setup:
66ec4f
%filter_provides_in %{python_sitearch}/.*\.so$ 
66ec4f
%filter_setup
66ec4f
}
66ec4f
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.
7a6331
- A really nice image viewer, iv, also based on OpenImageIO classes (and so 
7a6331
  will work with any formats for which plugins are available).
7a6331
527c81
7a6331
%package devel
527c81
Summary:        Documentation for %{name}
7a6331
Group:          Development/Libraries
7a6331
Requires:       %{name}%{?_isa} = %{version}-%{release}
7a6331
7a6331
%description devel
7a6331
Development files for package %{name}
7a6331
7a6331
7a6331
%prep
527c81
%setup -q -n %{name}-oiio-%{githash2}
927d71
%patch0 -p1 -b .backport
927d71
%patch1 -p1 -b .atomic
527c81
%patch2 -p1 -b .tbb
1a39c4
%patch3 -p1 -b .zlib
33234c
%patch4 -p1 -b .gcc47
7a6331
7a6331
# Remove bundled pugixml
7a6331
rm -f src/include/pugixml.hpp \
7a6331
      src/include/pugiconfig.hpp \
5371af
      src/libutil/pugixml.cpp 
527c81
1a39c4
# Remove bundled tbb
7a6331
rm -rf src/include/tbb
527c81
# Install FindTBB.cmake
527c81
install -pm 0644 %{SOURCE1} src/cmake/modules/
7a6331
7a6331
7a6331
%build
7a6331
mkdir -p build
7a6331
pushd build
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.
7a6331
%cmake -DCMAKE_SKIP_RPATH:BOOL=TRUE \
7a6331
       -DINCLUDE_INSTALL_DIR:PATH=/usr/include/%{name} \
7a6331
       -DPYLIB_INSTALL_DIR:PATH=%{python_sitearch} \
527c81
       -DINSTALL_DOCS:BOOL=FALSE \
7a6331
       -DUSE_EXTERNAL_PUGIXML:BOOL=TRUE \
527c81
       -DUSE_TBB:BOOL=TRUE \
7a6331
       ../src
7a6331
7a6331
make %{?_smp_mflags}
7a6331
7a6331
7a6331
%install
7a6331
pushd build
7a6331
make DESTDIR=%{buildroot} install
7a6331
7a6331
# Move man pages to the right directory
7a6331
mkdir -p %{buildroot}%{_mandir}/man1
7a6331
cp -a doc/*.1 %{buildroot}%{_mandir}/man1
7a6331
7a6331
7a6331
%post -p /sbin/ldconfig
7a6331
%postun -p /sbin/ldconfig
7a6331
7a6331
527c81
%check
527c81
#pushd build && make test
527c81
527c81
7a6331
%files
7a6331
%doc CHANGES LICENSE
7a6331
%{_bindir}/*
7a6331
%{_libdir}/libOpenImageIO.so.*
7a6331
%{python_sitearch}/OpenImageIO.so
7a6331
%{_mandir}/man1/*
7a6331
7a6331
%files devel
7a6331
%doc src/doc/*.pdf
7a6331
%{_libdir}/libOpenImageIO.so
7a6331
%{_includedir}/*
7a6331
5371af
7a6331
%changelog
989180
* Thu Jan 05 2012 Richard Shaw <hobbes1069@gmail.com> - 0.10.4-1
527c81
- Update to 0.10.4.
527c81
- Rebuild for GCC 4.7.0.
527c81
527c81
* Fri Dec 02 2011 Richard Shaw <hobbes1069@gmail.com> - 0.10.3-1
527c81
- Build against TBB library.
c3a3da
527c81
* Sat Nov 05 2011 Richard Shaw <hobbes1069@gmail.com> - 0.10.3-1
1a39c4
- Update to 0.10.3
1a39c4
- Rebuild for libpng 1.5.
527c81
- Fixed bulding against tbb library.
2a7b94
927d71
* Thu Aug 27 2011 Tom Callaway <spot@fedoraproject.org> - 0.10.2-1
1a39c4
- Update to 0.10.2
927d71
66ec4f
* Thu Aug 04 2011 Richard Shaw <hobbes1069@gmail.com> - 0.10.1-2
5371af
- New upstream release.
66ec4f
- Fix private shared object provides with python library.
5371af
7a6331
* Mon Jul 18 2011 Richard Shaw <hobbes1069@gmail.com> - 0.10.0-2
7a6331
- Disabled use of the TBB library.
5371af
- Moved headers to named directory.
7a6331
7a6331
* Tue Jul 05 2011 Richard Shaw <hobbes1069@gmail.com> - 0.10.0-1
7a6331
- Inital Release.