Imath/Imath.spec
2022-02-09 17:24:58 +08:00

78 lines
2.4 KiB
RPMSpec

%global srcname Imath
%global sover 29
Name: Imath
Version: 3.1.4
Release: 1
Summary: Library of 2D and 3D vector, matrix, and math operations for computer graphics
License: BSD
URL: https://github.com/AcademySoftwareFoundation/Imath
Source0: https://github.com/AcademySoftwareFoundation/%{srcname}/archive/v%{version}/%{srcname}-%{version}.tar.gz
Patch0: Imath-python-test.patch
BuildRequires: cmake gcc gcc-c++ make boost-devel python3-devel
BuildRequires: python3-breathe python3-numpy doxygen python3-sphinx
%description
Imath is a basic, light-weight, and efficient C++ representation of 2D and 3D
vectors and matrices and other simple but useful mathematical objects,
functions, and data types common in computer graphics applications, including
the “half” 16-bit floating-point type.
%package -n python3-%{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Summary: Python module for Imath
%description -n python3-%{name}
%{summary}.
%package devel
Summary: Development files for Imath
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: python3-%{name}%{?_isa} = %{version}-%{release} boost-devel python3-devel
# provides ilmbase-devel partly only; openexr-devel requires Imath-devel
# and provides/obsoletes it
Obsoletes: ilmbase-devel < 3.0
%description devel
%{summary}.
%prep
%autosetup -n %{srcname}-%{version} -p1
%build
%cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DPYTHON=ON \
-DDOCS=ON \
-DINSTALL_DOCS=OFF \
--trace-source=docs/CMakeLists.txt
%make_build
%install
%make_install
rm -rf ./docs/sphinx/.{doctrees,buildinfo}
mv ./docs/sphinx ./html
%check
make test
%files
%license LICENSE.md
%doc CHANGES.md CODE_OF_CONDUCT.md CONTRIBUTING.md CONTRIBUTORS.md README.md SECURITY.md
%{_libdir}/libImath-3_1.so.%{sover}*
%files -n python3-%{name}
%{_libdir}/libPyImath_Python3_9-3_1.so.%{sover}*
%{python3_sitearch}/imath.so
%{python3_sitearch}/imathnumpy.so
%files devel
%doc html/
%{_includedir}/Imath/
%{_libdir}/pkgconfig/Imath.pc
%{_libdir}/pkgconfig/PyImath.pc
%{_libdir}/cmake/Imath/
%{_libdir}/libImath.so
%{_libdir}/libImath-3_1.so
%{_libdir}/libPyImath_Python3_9-3_1.so
%changelog
* Mon Feb 7 2022 liyanan <liyanan32@huawei.com> - 3.1.4-1
- package init