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
3f70c4b
# Fail because of xvfb related errors, also still depends on nose
4618ef8
%bcond_with tests
4618ef8
3f70c4b
%global forgeurl https://github.com/nipy/dipy/
4618ef8
3f70c4b
Name:           python-dipy
3f70c4b
Version:        1.4.1
3f70c4b
Release:        %autorelease
4618ef8
Summary:        Diffusion MRI utilities in python
4618ef8
3f70c4b
%global tag %{version}
3f70c4b
%forgemeta
3f70c4b
3f70c4b
4618ef8
License:        BSD
4618ef8
URL:            http://nipy.org/dipy/
3f70c4b
Source0:        %forgesource
4618ef8
4618ef8
%description
4618ef8
%{desc}
4618ef8
3f70c4b
%package -n python3-dipy
4618ef8
Summary:        %{summary}
4618ef8
BuildRequires:      python3-devel
4618ef8
BuildRequires:      gcc
4618ef8
%if %{with tests}
4618ef8
BuildRequires:      %{py3_dist xvfbwrapper}
4618ef8
BuildRequires:      xorg-x11-server-Xvfb
3f70c4b
# Not mentioned in setup scripts
3f70c4b
BuildRequires:      %{py3_dist nose}
3f70c4b
# Not mentioned in build scripts
3f70c4b
BuildRequires:      %{py3_dist pytest}
4618ef8
%endif
3f70c4b
Suggests:           %{py3_dist ipython}
4618ef8
4618ef8
# Required for some modules but not in Fedora yet
4618ef8
# BuildRequires:      %%{py3_dist cvxpy}
4618ef8
4618ef8
3f70c4b
%description -n python3-dipy
4618ef8
%{desc}
4618ef8
4618ef8
%package doc
4618ef8
BuildArch:      noarch
4618ef8
Summary:        %{summary}
4618ef8
4618ef8
%description doc
4618ef8
Documentation for %{name}.
4618ef8
4618ef8
4618ef8
%prep
3f70c4b
%forgesetup
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
3f70c4b
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" "dipy/reconst/msdki.py" "dipy/workflows/tests/test_stats.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
3f70c4b
%generate_buildrequires
3f70c4b
%pyproject_buildrequires -r
3f70c4b
4618ef8
%build
4618ef8
export TEST_WITH_XVFB=true
3f70c4b
%pyproject_wheel
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
3f70c4b
%pyproject_install
3f70c4b
%pyproject_save_files dipy
4618ef8
4618ef8
%check
4618ef8
export TEST_WITH_XVFB=True
4618ef8
%if %{with tests}
3f70c4b
export PYTHONPATH="%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}"
4618ef8
%{__python3} -c 'import dipy; dipy.test()'
4618ef8
%endif
4618ef8
3f70c4b
%files -n python3-dipy -f %{pyproject_files}
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
42c0ebc
%{_bindir}/dipy_denoise_patch2self
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
4618ef8
%files doc
4618ef8
%license LICENSE
4618ef8
# Installed by package
3f70c4b
%{_docdir}/dipy/examples
4618ef8
%if %{with docs}
4618ef8
%doc doc/_build/html
4618ef8
%endif
4618ef8
4618ef8
%changelog
3f70c4b
%autochangelog
3f70c4b
8ebc22e
* Tue Jul 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.0-3
8ebc22e
- Second attempt - Rebuilt for
8ebc22e
  https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
8ebc22e
396fb3a
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.4.0-2
396fb3a
- Rebuilt for Python 3.10
396fb3a
42c0ebc
* Sun Mar 28 2021 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.4.0-1
42c0ebc
- Update to latest release
42c0ebc
870620f
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-2
870620f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
870620f
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