# Render the awesome-looking PDF diagram of cell types as documentation? %bcond cell_types 1 Name: python-meshio Version: 5.3.5 Release: %autorelease Summary: I/O for many mesh formats License: MIT URL: https://github.com/nschloe/meshio # Certain supplementary documentation files, such as CHANGELOG.md, are only in # the GitHub tarball and not in the PyPI tarball. Source: %{url}/archive/v%{version}/meshio-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel %if %{with cell_types} BuildRequires: /usr/bin/pdflatex BuildRequires: tex(latex) BuildRequires: tex(standalone.sty) BuildRequires: tex(tikz.sty) BuildRequires: tex(tikz-3dplot.sty) %endif %global common_description %{expand: There are various mesh formats available for representing unstructured meshes. meshio can read and write all of the following and smoothly converts between them: Abaqus (.inp), ANSYS msh (.msh), AVS-UCD (.avs), CGNS (.cgns), DOLFIN XML (.xml), Exodus (.e, .exo), FLAC3D (.f3grid), H5M (.h5m), Kratos/MDPA (.mdpa), Medit (.mesh, .meshb), MED/Salome (.med), Nastran (bulk data, .bdf, .fem, .nas), Netgen (.vol, .vol.gz), Neuroglancer precomputed format, Gmsh (format versions 2.2, 4.0, and 4.1, .msh), OBJ (.obj), OFF (.off), PERMAS (.post, .post.gz, .dato, .dato.gz), PLY (.ply), STL (.stl), Tecplot .dat, TetGen .node/.ele, SVG (2D output only) (.svg), SU2 (.su2), UGRID (.ugrid), VTK (.vtk), VTU (.vtu), WKT (TIN) (.wkt), XDMF (.xdmf, .xmf).} %description %{common_description} %package -n python3-meshio Summary: %{summary} %description -n python3-meshio %{common_description} %pyproject_extras_subpkg -n python3-meshio all %prep %autosetup -n meshio-%{version} # Currently, pytest-codeblocks is not packaged. Since it only validates the # code examples in README.md, we don’t find it worth packaging for meshio # alone. Instead, we patch it out of tox.ini. sed -r -i -e '/\bpytest-codeblocks\b/d' -e 's/--codeblocks\b//' tox.ini %generate_buildrequires %pyproject_buildrequires -t %build %pyproject_wheel %if %{with cell_types} pushd doc pdflatex -interaction=nonstopmode cell_types.tex popd %endif for plugindir in \ '%{buildroot}%{_libdir}/paraview/paraview/plugins' \ '%{buildroot}%{_libdir}/mpich/lib/paraview/paraview/plugins' \ '%{buildroot}%{_libdir}/openmpi/lib/paraview/paraview/plugins' do install -t "${plugindir}" -D -m 0644 -p 'tools/paraview-meshio-plugin.py' %py_byte_compile %{python3} "${plugindir}" done %install %pyproject_install %pyproject_save_files meshio %check %tox %files -n python3-meshio -f %{pyproject_files} # pyproject-rpm-macros detects LICENSE.txt; verify with rpm -qL -p … %doc CHANGELOG.md %doc CODE_OF_CONDUCT.md %doc CONTRIBUTING.md %doc README.md %if %{with cell_types} %doc cell_types.pdf %endif # paraview: co-own plugin directory and necessary parents %dir %{_libdir}/paraview %dir %{_libdir}/paraview/paraview %dir %{_libdir}/paraview/paraview/plugins %pycached %{_libdir}/paraview/paraview/plugins/tools/paraview-meshio-plugin.py # paraview-mpich: co-own plugin directory and necessary parents %dir %{_libdir}/mpich %dir %{_libdir}/mpich/lib %dir %{_libdir}/mpich/lib/paraview %dir %{_libdir}/mpich/lib/paraview/paraview %dir %{_libdir}/mpich/lib/paraview/paraview/plugins %pycached %{_libdir}/mpich/lib/paraview/paraview/plugins/tools/paraview-meshio-plugin.py # paraview-openmpi: co-own plugin directory and necessary parents %dir %{_libdir}/openmpi %dir %{_libdir}/openmpi/lib %dir %{_libdir}/openmpi/lib/paraview %dir %{_libdir}/openmpi/lib/paraview/paraview %dir %{_libdir}/openmpi/lib/paraview/paraview/plugins %pycached %{_libdir}/openmpi/lib/paraview/paraview/plugins/tools/paraview-meshio-plugin.py %changelog %autochangelog