Blob Blame History Raw
Name:           Mayavi
Version:        4.6.2
Release:        7%{?dist}
Summary:        Scientific data 3-dimensional visualizer
License:        BSD and EPL and LGPLv2+ and LGPLv2 and LGPLv3
URL:            http://code.enthought.com/projects/mayavi/
Source0:        https://github.com/enthought/mayavi/archive/%{version}/mayavi-%{version}.tar.gz
Source1:        mayavi2.desktop
BuildRequires:  gcc
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-Cython
BuildRequires:  python%{python3_pkgversion}-setuptools
# For tests
BuildRequires:  python%{python3_pkgversion}-traits
BuildRequires:  python%{python3_pkgversion}-numpy
BuildRequires:  python%{python3_pkgversion}-vtk
# For HTML docs
BuildRequires:  /usr/bin/sphinx-build-3
Requires:       python%{python3_pkgversion}-mayavi
BuildRequires:  desktop-file-utils 
BuildRequires:  /usr/bin/pathfix.py
BuildRequires:  xorg-x11-server-Xvfb

%description
The Mayavi project includes two related packages for 3-dimensional 
visualization:

 * Mayavi2: A tool for easy and interactive visualization of data.
 * TVTK: A Traits-based wrapper for the Visualization Toolkit, a
   popular open-source visualization library.

These operate at different levels of abstraction. TVTK manipulates
visualization objects, while Mayavi2 lets you operate on your data,
and then see the results. Most users either use the Mayavi user
interface or program to its scripting interface; you probably don't
need to interact with TVTK unless you want to create a new Mayavi
module.


%package -n python%{python3_pkgversion}-mayavi
Summary:        Python 3 mayavi module
Requires:       python%{python3_pkgversion}-vtk
Requires:       python%{python3_pkgversion}-apptools
Requires:       python%{python3_pkgversion}-traitsui
Requires:       python%{python3_pkgversion}-envisage
Requires:       python%{python3_pkgversion}-pyface-qt
%{?python_provide:%python_provide python%{python3_pkgversion}-mayavi}

%description -n python%{python3_pkgversion}-mayavi
Python 3 mayavi module


%package doc
Summary:        Documentation for %{name}

%description doc
Documentation for %{name}.


%prep
%setup -q -n mayavi-%{version}
rm -rf *.egg-info

# vtk not discoverable by pkg_resources
sed -i -e "/^ *'vtk'/d" mayavi/__init__.py

# Remove pregenerated C sources
grep -lr '/\* Generated by Cython' | xargs rm -v

# fix wrong-file-end-of-line-encoding
for file in *.txt examples/mayavi/data/room_vis.wrl examples/tvtk/dscene.py \
 examples/mayavi/interactive/wx_mayavi_embed*.py ; do
 sed "s|\r||g" $file > $file.new && \
 touch -r $file $file.new && \
 mv $file.new $file
done

# file-not-utf8
for file in *.txt docs/*.txt; do
 iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
 touch -r $file $file.new && \
 mv $file.new $file
done

# remove shebang
for file in mayavi/scripts/*.py; do
 sed '/^#!\//, 1d' $file > $file.new && \
 touch -r $file $file.new && \
 mv $file.new $file
done

# fix shebang
pathfix.py -i %{__python3} -p -n mayavi mayavi/tests/csv_files/csv_2_py

# remove exec permission
find examples -type f -exec chmod 0644 {} ";"
chmod 0644 mayavi/tests/data/cellsnd.ascii.inp

%build
# Recythonize the sources
find -name '*.pyx' -exec cython {} \;

# Need xvfb-run for html doc building
%set_build_flags
SPHINXBUILD=/usr/bin/sphinx-build-3 xvfb-run %{__python3} setup.py build --executable="%{__python3} %{py3_shbang_opts}"

%install
%py3_install

# remove useless files
rm $RPM_BUILD_ROOT%{python3_sitearch}/tvtk/setup.py*

# fix wrong-file-end-of-line-encoding
for file in $RPM_BUILD_ROOT%{python3_sitearch}/mayavi/html/_downloads/wx_mayavi*.py; do
 sed "s|\r||g" $file > $file.new && \
 touch -r $file $file.new && \
 mv $file.new $file
done

# non-executable-script
chmod +x $RPM_BUILD_ROOT%{python3_sitearch}/mayavi/tests/runtests.py

mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1/
cp -p docs/mayavi2.man $RPM_BUILD_ROOT/%{_mandir}/man1/mayavi2.1

desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{SOURCE1}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/
install -p -m 644 ./docs/source/mayavi/images/mayavi2-48x48.png \
 $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/mayavi2.png

%check
# This isn't working yet
libdir=`echo build/lib.*`
ln tvtk/tvtk_classes.zip ${libdir}/tvtk/
# Mayavi tests appear to hang running under xvfb-run
PYTHONPATH=${libdir} mayavi/scripts/mayavi2 -t || :

%files
%license *LICENSE*
%doc README-tvtk.txt docs/*.txt
%{_bindir}/mayavi2
%{_bindir}/tvtk_doc
%{_mandir}/man1/mayavi2.1.*
%{_datadir}/applications/mayavi2.desktop
%{_datadir}/icons/hicolor/48x48/apps/mayavi2.png

%files -n python%{python3_pkgversion}-mayavi
%license *LICENSE*
%doc docs/*.txt README-tvtk.txt
%dir %{python3_sitearch}/mayavi
%{python3_sitearch}/mayavi/[_a-gi-z]*
%{python3_sitearch}/mayavi*.egg-info
%{python3_sitearch}/tvtk/

%files doc
%license *LICENSE*
%doc README-tvtk.txt docs/*.txt examples/
%doc %{python3_sitearch}/mayavi/html
%doc %{python3_sitearch}/tvtk/html


%changelog
* Sat Dec 28 2019 Orion Poplawski <orion@nwra.com> - 4.6.2-7
- Remove setuptools requirement on vtk (bz#1786402)
- Drop old python2 suppot from spec

* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 4.6.2-6
- Rebuilt for Python 3.8.0rc1 (#1748018)

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 4.6.2-5
- Rebuilt for Python 3.8

* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.6.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sun Feb 24 2019 Orion Poplawski <orion@nwra.com> - 4.6.2-3
- Use pyface-qt with python3 (bug #1680381)

* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.6.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Sat Oct 27 2018 Orion Poplawski <orion@cora.nwra.com> - 4.6.2-1
- Update to 4.6.2
- Use Python 3 for Fedora 30+

* Fri Jul 20 2018 Orion Poplawski <orion@cora.nwra.com> - 4.6.1-1
- Update to 4.6.1
- Split python libraries into separate package (bug #1279193)

* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Aug 9 2016 Orion Poplawski <orion@cora.nwra.com> - 4.5.0-1
- Update to 4.5.0

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.4.4-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Wed Mar 16 2016 Orion Poplawski <orion@cora.nwra.com> - 4.4.4-1
- Update to 4.4.4
- Drop upstream patch
- Use %%license

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.4.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Nov 25 2015 Orion Poplawski <orion@cora.nwra.com> - 4.4.3-3
- BR /usr/bin/sphinx-build instead of python-sphinx

* Thu Nov 5 2015 Orion Poplawski <orion@cora.nwra.com> - 4.4.3-2
- Add upstream PR for vtk 6.3.0 support

* Thu Oct 29 2015 Orion Poplawski <orion@cora.nwra.com> - 4.4.3-2
- Rebuild for vtk 6.3.0

* Wed Sep 9 2015 Orion Poplawski <orion@cora.nwra.com> - 4.4.3-1
- Update to 4.4.3

* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.4.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Jun 11 2015 Orion Poplawski <orion@cora.nwra.com> - 4.4.2-1
- Update to 4.4.2

* Tue Mar 3 2015 Orion Poplawski <orion@cora.nwra.com> - 4.4.0-1
- Update to 4.4.0

* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.3.2-0.3.20140421git2054fd4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Fri Jun 06 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.3.2-0.2.20140421git2054fd4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri May 9 2014 Orion Poplawski <orion@cora.nwra.com> - 4.3.2-0.1.20140421git2054fd4
- Update to latest git snapshot for VTK 6 support

* Thu Mar 13 2014 Orion Poplawski <orion@cora.nwra.com> - 4.3.1-1
- Update to 4.3.1
- Split docs into separate subpackage

* Thu Sep 19 2013 Orion Poplawski <orion@cora.nwra.com> - 4.3.0-8
- Update to current git to build against vtk 6

* Wed Sep 18 2013 Orion Poplawski <orion@cora.nwra.com> - 4.3.0-7
- Add patch to fix vtkQt class loading issue (bug #1008392)

* Mon Sep 16 2013 Orion Poplawski <orion@cora.nwra.com> - 4.3.0-6
- Require python-pyface-wx (bug #1008392)

* Tue Aug 06 2013 Orion Poplawski <orion@cora.nwra.com> - 4.3.0-5
- Drop BR on python-setupdocs, no longer used

* Fri Aug 02 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.3.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed May 22 2013 Orion Poplawski <orion@cora.nwra.com> - 4.3.0-3
- Use lowercase names in BR

* Mon May 13 2013 Orion Poplawski <orion@cora.nwra.com> - 4.3.0-2
- Change requires to python-envisage

* Fri May 10 2013 Orion Poplawski <orion@cora.nwra.com> - 4.3.0-1
- Update to 4.3.0

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri May 25 2012 Orion Poplawski <orion@cora.nwra.com> - 4.2.0-1
- Update to 4.2.0
- Add BR python-sphinx and patch to set new html build location
- Drop %%defattr()
 
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Jan 05 2011 Rakesh Pandit <rakesh@fedoraproject.org> 3.4.0-1
- Updated to 3.4.0

* Fri Aug 13 2010 Chen Lei <supercyper@163.com> 3.3.2-1
- Update spec to match latest guidelines w.r.t %%clean
- Remove explict dependency on python-TraitsBackendQt.spec
- Rename man page(Mayavi -> mayavi2)
- Remove docs src
- Remove tvtk_doc.desktop to avoid confusion
- Fix timestampes for example files

* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 3.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Sun Jan 31 2010 Rakesh Pandit <rakesh@fedoraproject.org> 3.3.0-1
- Updated to 3.2.0

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Fri Jun 26 2009 Rakesh Pandit <rakesh@fedoraproject.org> 3.2.0-6
- Fixed BR, and removed .template & .static directories from docs/source
- Included missing icon from .desktop

* Fri Jun 26 2009 Rakesh Pandit <rakesh@fedoraproject.org> 3.2.0-5
- Using mayavi2-48x48.png has icons for both .desktop files
- Added Categories to .desktop files

* Thu Jun 25 2009 Rakesh Pandit <rakesh@fedoraproject.org> 3.2.0-4
- Removed wrong scriplets and corrected 'commets' in
-  tvtk_doc.desktop file.

* Wed Jun 24 2009 Rakesh Pandit <rakesh@fedoraproject.org> 3.2.0-3
- Fixed license issue and group tag
- Added a .desktop file

* Mon Jun 15 2009 Rakesh Pandit <rakesh@fedoraproject.org> 3.2.0-3
- included man page, adjusted description, removed useless BR's,
- fixed owned directory issue, cleaned up spec

* Fri Jun 12 2009 Rakesh Pandit <rakesh@fedoraproject.org> 3.2.0-2
- Saving timestamp, and fixed indentation

* Fri Jun 12 2009 Rakesh Pandit <rakesh@fedoraproject.org> 3.2.0-1
- Updated

* Wed Jun 10 2009 Rakesh Pandit <rakesh@fedoraproject.org> 3.1.0-3
- Changed name to Mayavi

* Tue Jan 27 2009 Rakesh Pandit <rakesh@fedoraproject.org> 3.1.0-2
- Fixed description.

* Tue Jan 27 2009 Rakesh Pandit <rakesh@fedoraproject.org> 3.1.0-1
- Initial package