music / rpms / python-dipy

Forked from rpms/python-dipy 2 years ago
Clone

Blame python-dipy.spec

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}
4a14fa2
Version:        0.16.0
4a14fa2
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
f30a72b
BuildRequires:      %{py3_dist nibabel} >= 2.3
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}
4618ef8
%{?python_provide:%python_provide 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
4a14fa2
%{_bindir}/dipy_ba
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
4a14fa2
%{_bindir}/dipy_horizon
4618ef8
%{_bindir}/dipy_info
4618ef8
%{_bindir}/dipy_labelsbundles
4a14fa2
%{_bindir}/dipy_lmm
4618ef8
%{_bindir}/dipy_mask
4618ef8
%{_bindir}/dipy_median_otsu
4618ef8
%{_bindir}/dipy_nlmeans
4618ef8
%{_bindir}/dipy_recobundles
4618ef8
%{_bindir}/dipy_reslice
4618ef8
%{_bindir}/dipy_slr
4a14fa2
%{_bindir}/dipy_snr_in_cc
4a14fa2
%{_bindir}/dipy_track_local
4a14fa2
%{_bindir}/dipy_track_pft
4618ef8
%{python3_sitearch}/%{srcname}
4a14fa2
%{python3_sitearch}/%{srcname}-%{version}-py3.?.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
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