e78e645
%global python_version %(%{__python2} -c "import sys ; print(sys.version[:3])")
e78e645
e78e645
%{!?python2_sitearch: %global python2_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
e78e645
e78e645
Name:           openvdb
e78e645
Version:        4.0.1
8b308a5
Release:        3%{?dist}
e78e645
Summary:        C++ library for sparse volumetric data discretized on three-dimensional grids
e78e645
License:        MPLv2.0
e78e645
URL:            http://www.openvdb.org/
e78e645
e78e645
Source0:        https://github.com/dreamworksanimation/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
e78e645
e78e645
BuildRequires:  blosc-devel >= 1.5.0
e78e645
BuildRequires:  boost-devel >= 1.57.0
e78e645
BuildRequires:  cmake >= 2.8
e78e645
BuildRequires:  cppunit-devel >= 1.10
e78e645
BuildRequires:  doxygen >= 1.8.11
e78e645
BuildRequires:  epydoc
e78e645
BuildRequires:  ghostscript >= 8.70
e78e645
BuildRequires:  glfw-devel >= 2.7
e78e645
BuildRequires:  ilmbase-devel
e78e645
BuildRequires:  libXi-devel
e78e645
BuildRequires:  log4cplus-devel >= 1.0
e78e645
BuildRequires:  OpenEXR-devel
e78e645
BuildRequires:  python
e78e645
BuildRequires:  python2-numpy
e78e645
BuildRequires:  python-devel
e78e645
BuildRequires:  tbb-devel >= 3.0
e78e645
BuildRequires:  zlib-devel
e78e645
e78e645
%description
e78e645
OpenVDB is an Academy Award-winning open-source C++ library comprising a novel
e78e645
hierarchical data structure and a suite of tools for the efficient storage and
e78e645
manipulation of sparse volumetric data discretized on three-dimensional grids.
e78e645
It is developed and maintained by DreamWorks Animation for use in volumetric
e78e645
applications typically encountered in feature film production.
e78e645
e78e645
This package contains some graphical tools.
e78e645
e78e645
%package        libs
e78e645
Summary:        Core OpenVDB libraries
e78e645
e78e645
%description    libs
e78e645
OpenVDB is an Academy Award-winning open-source C++ library comprising a novel
e78e645
hierarchical data structure and a suite of tools for the efficient storage and
e78e645
manipulation of sparse volumetric data discretized on three-dimensional grids.
e78e645
It is developed and maintained by DreamWorks Animation for use in volumetric
e78e645
applications typically encountered in feature film production.
e78e645
e78e645
%package        devel
e78e645
Summary:        Development files for %{name}
e78e645
Requires:       %{name}%{?_isa} = %{version}-%{release}
e78e645
e78e645
%description    devel
e78e645
The %{name}-devel package contains libraries and header files for developing
e78e645
applications that use %{name}.
e78e645
e78e645
%package        python
e78e645
Summary:        OpenVDB Python module
e78e645
Requires:       %{name}%{?_isa} = %{version}-%{release}
e78e645
e78e645
%description    python
e78e645
OpenVDB is an Academy Award-winning open-source C++ library comprising a novel
e78e645
hierarchical data structure and a suite of tools for the efficient storage and
e78e645
manipulation of sparse volumetric data discretized on three-dimensional grids.
e78e645
It is developed and maintained by DreamWorks Animation for use in volumetric
e78e645
applications typically encountered in feature film production.
e78e645
e78e645
This package contains the Python module.
e78e645
a1261af
%package        doc
a1261af
Summary:        Documentation for %{name}
a1261af
BuildArch:      noarch
a1261af
a1261af
%description    doc
a1261af
The %{name}-doc package contains documentation for developing applications that
a1261af
use %{name}.
a1261af
e78e645
%prep
e78e645
%setup -q
e78e645
a1261af
iconv -f iso8859-1 -t utf-8 %{name}/CHANGES > %{name}/CHANGES.conv && \
a1261af
    mv -f %{name}/CHANGES.conv %{name}/CHANGES
a1261af
e78e645
# Hardcoded paths for installation, as described in the INSTALL file
e78e645
sed -i -e 's@lib@%{_lib}@g' %{name}/CMakeLists.txt
e78e645
e78e645
# Save Makefile that contains doc building instructions, new cmake build system
e78e645
# does not build docs yet
e78e645
cp %{name}/Makefile %{name}/Makefile.docbuild
e78e645
e78e645
%build
a1261af
export CXXFLAGS="%{optflags} -Wl,--as-needed"
e78e645
%cmake \
e78e645
    -DBLOSC_LOCATION=%{_prefix} \
e78e645
    -DCPPUNIT_LOCATION=%{_prefix} \
e78e645
    -DGLEW_LOCATION=%{_prefix} \
e78e645
    -DGLFW3_LOCATION=%{_prefix} \
e78e645
    -DILMBASE_NAMESPACE_VERSIONING=OFF \
e78e645
    -DILMBASE_LOCATION=%{_prefix} \
e78e645
    -DOPENEXR_LOCATION=%{_prefix} \
e78e645
    -DOPENEXR_NAMESPACE_VERSIONING=OFF \
e78e645
    -DOPENVDB_ENABLE_RPATH=OFF \
e78e645
    -DOPENVDB_ENABLE_3_ABI_COMPATIBLE=ON \
e78e645
    -DPYTHON_VERSION=%{python_version} \
e78e645
    -DTBB_LOCATION=%{_prefix} \
e78e645
    -DUSE_GLFW3=True
e78e645
e78e645
%make_build
e78e645
e78e645
# Build docs with previously saved Makefile
e78e645
pushd %{name}
e78e645
make -f Makefile.docbuild doc
e78e645
popd
e78e645
e78e645
# vdb_unit_test fails everywhere except on x86_64
e78e645
%ifarch x86_64
e78e645
%check
e78e645
make test
e78e645
%endif
e78e645
e78e645
%install
e78e645
%make_install
e78e645
e78e645
# Remove CMakeFiles from includes
a1261af
rm -fr %{buildroot}/%{_includedir}/%{name}/CMakeFiles
e78e645
e78e645
# Let RPM pick up HTML documents in the files section
e78e645
rm -fr %{buildroot}/%{_datadir}/doc
e78e645
e78e645
find %{buildroot} -name '*.a' -delete
e78e645
e78e645
%post libs -p /sbin/ldconfig
e78e645
e78e645
%postun libs -p /sbin/ldconfig
e78e645
e78e645
%files
e78e645
%{_bindir}/vdb_view
e78e645
%{_bindir}/vdb_print
e78e645
%{_bindir}/vdb_render
e78e645
e78e645
%files libs
e78e645
%license %{name}/LICENSE %{name}/COPYRIGHT
e78e645
%doc README.md %{name}/CHANGES
e78e645
%{_libdir}/*.so.*
e78e645
e78e645
%files python
e78e645
%{_libdir}/python%{python_version}/py%{name}.so
e78e645
e78e645
%files devel
e78e645
%{_includedir}/*
e78e645
%{_libdir}/*.so
e78e645
a1261af
%files doc
a1261af
%doc %{name}/doc/html
a1261af
e78e645
%changelog
8b308a5
* Tue Jul 18 2017 Jonathan Wakely <jwakely@redhat.com> - 4.0.1-3
8b308a5
- Rebuilt for Boost 1.64
8b308a5
a1261af
* Sat May 06 2017 Simone Caronni <negativo17@gmail.com> - 4.0.1-2
a1261af
- Review fixes.
a1261af
e78e645
* Sat Apr 22 2017 Simone Caronni <negativo17@gmail.com> - 4.0.1-1
e78e645
- Update to 4.0.1.
e78e645
- Perform tests, build HTML documentation.
e78e645
- Require main OpenVDB library for Python module.
e78e645
e78e645
* Wed Nov 23 2016 Simone Caronni <negativo17@gmail.com> - 4.0.0-2
e78e645
- Update to 4.0.0.
e78e645
e78e645
* Sun Oct 16 2016 Simone Caronni <negativo17@gmail.com> - 4.0.0-1.20161015git40271e7
e78e645
- First build.