4618ef8
# No py3 since it depends on nibabel which we only provide for py3
4618ef8
%global srcname dipy
4618ef8
4618ef8
%global desc %{expand: \
4618ef8
DIPY is a python toolbox for analysis of MR diffusion imaging.
4618ef8
DIPY is for research only; please do not use results from DIPY for clinical
4618ef8
decisions.
4618ef8
4618ef8
Current information can always be found from the DIPY website - http://dipy.org}
4618ef8
4618ef8
# Full documentation downloads 100+MB of data, so we'd rather users look at the
4618ef8
# upstream documentation
85798e5
%bcond_with docs
4618ef8
4618ef8
# Fail because of xvfb related errors
4618ef8
%bcond_with tests
4618ef8
4618ef8
%{?python_enable_dependency_generator}
4618ef8
4618ef8
Name:           python-%{srcname}
26bd5b6
Version:        1.3.0
35206d1
Release:        1%{?dist}
4618ef8
Summary:        Diffusion MRI utilities in python
4618ef8
4618ef8
License:        BSD
4618ef8
URL:            http://nipy.org/dipy/
4a14fa2
Source0:        https://github.com/nipy/dipy/archive/%{version}/%{name}-%{version}.tar.gz
4618ef8
4618ef8
%description
4618ef8
%{desc}
4618ef8
4618ef8
%package -n python3-%{srcname}
4618ef8
Summary:        %{summary}
4618ef8
BuildRequires:      python3-devel
4618ef8
BuildRequires:      gcc
4618ef8
BuildRequires:      %{py3_dist setuptools}
4a14fa2
BuildRequires:      %{py3_dist pytest}
4618ef8
BuildRequires:      %{py3_dist Cython}
d45fbb4
BuildRequires:      %{py3_dist numpy} >= 1.7.1
d45fbb4
BuildRequires:      %{py3_dist scipy} >= 0.9
26bd5b6
BuildRequires:      %{py3_dist tqdm}
dc1a5e5
BuildRequires:      %{py3_dist nibabel} >= 3.0
f30a72b
BuildRequires:      %{py3_dist h5py} >= 2.4
4618ef8
BuildRequires:      %{py3_dist matplotlib}
4618ef8
%if %{with tests}
4618ef8
BuildRequires:      %{py3_dist xvfbwrapper}
4618ef8
BuildRequires:      xorg-x11-server-Xvfb
4618ef8
%endif
f30a72b
Requires:           %{py3_dist h5py} >= 2.4
f30a72b
Requires:           %{py3_dist nibabel} >= 2.3
d45fbb4
Requires:           %{py3_dist scipy} >= 0.9
d45fbb4
Requires:           %{py3_dist numpy} >= 1.7.1
4618ef8
4618ef8
# Required for some modules but not in Fedora yet
4618ef8
# BuildRequires:      %%{py3_dist cvxpy}
4618ef8
4618ef8
Suggests:           %{py3_dist ipython}
26bd5b6
%py_provides python3-%{srcname}
4618ef8
4618ef8
%description -n python3-%{srcname}
4618ef8
%{desc}
4618ef8
4618ef8
%package doc
4618ef8
BuildArch:      noarch
4618ef8
Summary:        %{summary}
4618ef8
4618ef8
%description doc
4618ef8
Documentation for %{name}.
4618ef8
4618ef8
4618ef8
%prep
4a14fa2
%autosetup -n %{srcname}-%{version}
4618ef8
export TEST_WITH_XVFB=true
4618ef8
# clean it all up (from the Makefile)
4618ef8
find . -name "*.so" -print -delete
4618ef8
find . -name "*.pyd" -print -delete
4618ef8
find . -name "*.c" -print -delete
4618ef8
find . -name "*.html" -print -delete
4618ef8
rm -rf build
4618ef8
rm -rf docs/_build
4618ef8
rm -rf docs/dist
4618ef8
rm -rf dipy/dipy.egg-info
4618ef8
4618ef8
# Correct interpreter for these---used in building docs and so on
4618ef8
sed -i 's/#!\/usr\/bin\/env python/#!\/usr\/bin\/python3/' doc/tools/docgen_cmd.py
4618ef8
sed -i 's/#!\/usr\/bin\/env python/#!\/usr\/bin\/python3/' doc/tools/build_modref_templates.py
4618ef8
find tools/ -name "*.py" -exec sed -i 's/#!\/usr\/bin\/env python/#!\/usr\/bin\/python3/' '{}' \;
4618ef8
4618ef8
# Other shebangs and permission fixes
4618ef8
for f in "dipy/boots/resampling.py" "dipy/reconst/benchmarks/bench_csd.py" "dipy/reconst/dki.py" "dipy/reconst/dti.py"  "dipy/workflows/mask.py" "dipy/workflows/tracking.py" "dipy/reconst/dki_micro.py"
4618ef8
do
4618ef8
    chmod -x "$f"
4618ef8
    sed -i '/^#!\/usr\/bin\/env python/ d' "$f"
4618ef8
    sed -i '/^#!\/usr\/bin\/python/ d' "$f"
4618ef8
done
4618ef8
4618ef8
%build
4618ef8
export TEST_WITH_XVFB=true
4618ef8
%py3_build
4618ef8
4618ef8
%if %{with docs}
4618ef8
pushd doc
4618ef8
    export PYTHONPATH=../build/
4618ef8
    make SPHINXBUILD=sphinx-build-3 PYTHON=%{__python3} html
4618ef8
    rm -rf _build/html/.doctrees
4618ef8
    rm -rf _build/html/.buildinfo
4618ef8
popd
4618ef8
%endif
4618ef8
4618ef8
%install
4618ef8
%py3_install
4618ef8
4618ef8
%check
4618ef8
export TEST_WITH_XVFB=True
4618ef8
%if %{with tests}
4618ef8
%{__python3} -c 'import dipy; dipy.test()'
4618ef8
%endif
4618ef8
4618ef8
%files -n python3-%{srcname}
4618ef8
%license LICENSE
4618ef8
%doc README.rst Changelog AUTHOR
4a14fa2
%{_bindir}/dipy_align_affine
4a14fa2
%{_bindir}/dipy_align_syn
4a14fa2
%{_bindir}/dipy_apply_transform
35206d1
%{_bindir}/dipy_buan_lmm
35206d1
%{_bindir}/dipy_buan_profiles
35206d1
%{_bindir}/dipy_buan_shapes
dc1a5e5
%{_bindir}/dipy_denoise_lpca
dc1a5e5
%{_bindir}/dipy_denoise_mppca
dc1a5e5
%{_bindir}/dipy_denoise_nlmeans
a73e5be
%{_bindir}/dipy_fetch
4618ef8
%{_bindir}/dipy_fit_csa
4618ef8
%{_bindir}/dipy_fit_csd
4618ef8
%{_bindir}/dipy_fit_dki
4618ef8
%{_bindir}/dipy_fit_dti
4a14fa2
%{_bindir}/dipy_fit_ivim
4618ef8
%{_bindir}/dipy_fit_mapmri
dc1a5e5
%{_bindir}/dipy_gibbs_ringing
4a14fa2
%{_bindir}/dipy_horizon
4618ef8
%{_bindir}/dipy_info
4618ef8
%{_bindir}/dipy_labelsbundles
4618ef8
%{_bindir}/dipy_mask
4618ef8
%{_bindir}/dipy_median_otsu
4618ef8
%{_bindir}/dipy_recobundles
4618ef8
%{_bindir}/dipy_reslice
4618ef8
%{_bindir}/dipy_slr
4a14fa2
%{_bindir}/dipy_snr_in_cc
35206d1
%{_bindir}/dipy_track
4a14fa2
%{_bindir}/dipy_track_pft
dc1a5e5
%{_bindir}/dipy_split
4618ef8
%{python3_sitearch}/%{srcname}
a09059b
%{python3_sitearch}/%{srcname}-%{version}-py%{python3_version}.egg-info
4618ef8
4618ef8
%files doc
4618ef8
%license LICENSE
4618ef8
# Installed by package
4618ef8
%{_docdir}/%{srcname}/examples
4618ef8
%if %{with docs}
4618ef8
%doc doc/_build/html
4618ef8
%endif
4618ef8
4618ef8
%changelog
26bd5b6
* Sat Nov 28 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.3.0-1
26bd5b6
- Update to 1.3.0
26bd5b6
35206d1
* Sun Sep 13 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.2.0-1
35206d1
- Update to new release
35206d1
34c3d56
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-3
34c3d56
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
34c3d56
ea53abb
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.1.1-2
ea53abb
- Rebuilt for Python 3.9
ea53abb
dc1a5e5
* Sat Feb 01 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.1.1-1
dc1a5e5
- Update to new version
dc1a5e5
- Bump nibabel requirement version
dc1a5e5
eb9c6a9
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-3
eb9c6a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
eb9c6a9
e8b8ff3
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.0-2
e8b8ff3
- Rebuilt for Python 3.8.0rc1 (#1748018)
e8b8ff3
a73e5be
* Sat Aug 31 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.0.0-1
a73e5be
- update to 1.0.0
a73e5be
e4f8ce6
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.16.0-3
e4f8ce6
- Rebuilt for Python 3.8
e4f8ce6
53ac0ac
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-2
53ac0ac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
53ac0ac
4a14fa2
* Mon Apr 08 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.16.0-1
4a14fa2
- Update to latest upstream release
4a14fa2
- Use gittag instead of snapshot
4a14fa2
- Add new binaries
4a14fa2
5b0154a
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-0.5.git756b519
5b0154a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
5b0154a
d45fbb4
* Tue Nov 27 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.15.0-0.4.git756b519
d45fbb4
- Provide Requires explictly as they are not picked up by the autogenerator
d45fbb4
2bc9bab
* Mon Nov 19 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.15.0-0.3.git756b519
2bc9bab
- remove python3-vtk dep
2bc9bab
- not available in F29 currently, and only needed for doc generation which is disabled
2bc9bab
85798e5
* Mon Nov 19 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.15.0-0.2.git756b519
85798e5
- Disable doc generation
85798e5
4618ef8
* Thu Nov 15 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.15.0-0.1.git756b519
4618ef8
- Initial rpm build