09965ff
%global modname nipy
09965ff
09965ff
%global _docdir_fmt %{name}
09965ff
09965ff
Name:           python-%{modname}
ead1986
Version:        0.4.1
dc4440a
Release:        3%{?dist}
09965ff
Summary:        Neuroimaging in Python FMRI analysis package
09965ff
09965ff
License:        BSD
09965ff
URL:            http://nipy.org/nipy
09965ff
Source0:        https://github.com/nipy/nipy/archive/%{version}/%{modname}-%{version}.tar.gz
09965ff
BuildRequires:  git-core
09965ff
BuildRequires:  gcc
057009b
BuildRequires:  lapack-devel blas-devel atlas-devel
09965ff
09965ff
%description
09965ff
Neuroimaging tools for Python.
09965ff
09965ff
The aim of NIPY is to produce a platform-independent Python environment for the
09965ff
analysis of functional brain imaging data using an open development model.
09965ff
09965ff
%package -n python2-%{modname}
09965ff
Summary:        %{summary}
09965ff
%{?python_provide:%python_provide python2-%{modname}}
09965ff
BuildRequires:  python2-devel python-setuptools
09965ff
BuildRequires:  numpy scipy python2-nibabel sympy
09965ff
BuildRequires:  Cython
09965ff
# Test deps
09965ff
BuildRequires:  python2-nose
e52227a
BuildRequires:  python2-six python2-transforms3d
09965ff
BuildRequires:  nipy-data
09965ff
Requires:       numpy scipy python2-nibabel sympy
e52227a
Requires:       python2-six python2-transforms3d
09965ff
Requires:       python-matplotlib
09965ff
Suggests:       nipy-data
09965ff
09965ff
%description -n python2-%{modname}
09965ff
Neuroimaging tools for Python.
09965ff
09965ff
The aim of NIPY is to produce a platform-independent Python environment for the
09965ff
analysis of functional brain imaging data using an open development model.
09965ff
09965ff
Python 2 version.
09965ff
09965ff
%package -n python3-%{modname}
09965ff
Summary:        %{summary}
09965ff
%{?python_provide:%python_provide python3-%{modname}}
09965ff
BuildRequires:  python3-devel python3-setuptools
09965ff
BuildRequires:  python3-numpy python3-scipy python3-nibabel python3-sympy
09965ff
BuildRequires:  python3-Cython
09965ff
# Test deps
09965ff
BuildRequires:  python3-nose
09965ff
BuildRequires:  python3-six python3-transforms3d
09965ff
BuildRequires:  nipy-data
09965ff
Requires:       python3-numpy python3-scipy python3-nibabel python3-sympy
09965ff
Requires:       python3-six python3-transforms3d
09965ff
Requires:       python3-matplotlib
09965ff
Suggests:       nipy-data
09965ff
09965ff
%description -n python3-%{modname}
09965ff
Neuroimaging tools for Python.
09965ff
09965ff
The aim of NIPY is to produce a platform-independent Python environment for the
09965ff
analysis of functional brain imaging data using an open development model.
09965ff
09965ff
Python 3 version.
09965ff
09965ff
%prep
09965ff
%autosetup -n %{modname}-%{version} -p1 -Sgit
09965ff
09965ff
# Hard fix for bundled libs
09965ff
find -type f -name '*.py' -exec sed -i \
09965ff
  -e "s/from \.*externals.six/from six/"                             \
09965ff
  -e "s/from nipy.externals.six/from six/"                           \
09965ff
  -e "s/from nipy.externals import six/import six/"                  \
09965ff
  -e "s/from nipy.externals.argparse/from argparse/"                 \
09965ff
  -e "s/import nipy.externals.argparse as argparse/import argparse/" \
09965ff
  -e "s/from \.*externals.transforms3d/from transforms3d/"           \
09965ff
  {} ';'
09965ff
find scripts/ -type f -exec sed -i \
09965ff
  -e "s/from nipy.externals.argparse/from argparse/"                 \
09965ff
  -e "s/import nipy.externals.argparse as argparse/import argparse/" \
09965ff
  {} ';'
09965ff
sed -i -e "/config.add_subpackage(.externals.)/d" nipy/setup.py
09965ff
rm -vrf nipy/externals/
09965ff
rm -rf lib/lapack_lite/
09965ff
9a90368
find examples -type f -name '*.py' -exec sed -i '1{\@^#!/usr/bin/env python@d}' {} ';'
9a90368
09965ff
%build
09965ff
export NIPY_EXTERNAL_LAPACK=1
09965ff
09965ff
%py2_build
09965ff
%py3_build
09965ff
09965ff
%install
09965ff
export NIPY_EXTERNAL_LAPACK=1
09965ff
09965ff
%py3_install
09965ff
%py2_install
09965ff
09965ff
find %{buildroot}%{python2_sitearch} -name '*.so' -exec chmod 755 {} ';'
09965ff
find %{buildroot}%{python3_sitearch} -name '*.so' -exec chmod 755 {} ';'
09965ff
09965ff
find %{buildroot}%{python2_sitearch}/%{modname}/ %{buildroot}%{python3_sitearch}/%{modname}/ -name '*.py' -type f > tmp
09965ff
while read lib
09965ff
do
09965ff
 sed -i '1{\@^#!/usr/bin/env python@d}' $lib
09965ff
done < tmp
09965ff
rm -f tmp
09965ff
09965ff
%check
ead1986
TESTING_DATA=(                                             \
09965ff
nipy/testing/functional.nii.gz                             \
09965ff
nipy/modalities/fmri/tests/spm_hrfs.mat                    \
09965ff
nipy/modalities/fmri/tests/spm_dmtx.npz                    \
09965ff
nipy/testing/anatomical.nii.gz                             \
09965ff
nipy/algorithms/statistics/models/tests/test_data.bin      \
09965ff
nipy/algorithms/diagnostics/tests/data/tsdiff_results.mat  \
09965ff
nipy/modalities/fmri/tests/spm_bases.mat                   \
ead1986
nipy/labs/spatial_models/tests/some_blobs.nii              \
ead1986
nipy/modalities/fmri/tests/cond_test1.txt                  \
ead1986
nipy/modalities/fmri/tests/dct_5.txt                       \
ead1986
nipy/modalities/fmri/tests/dct_10.txt                      \
ead1986
nipy/modalities/fmri/tests/dct_100.txt                     \
09965ff
)
09965ff
09965ff
pushd build/lib.*-%{python2_version}
09965ff
  for i in ${TESTING_DATA[@]}
09965ff
  do
09965ff
    mkdir -p ./${i%/*}/
09965ff
    cp -a ../../$i ./$i
09965ff
  done
09965ff
  nosetests-%{python2_version} -v %{?skip_tests:-e %{skip_tests}} -I test_scripts.py
09965ff
popd
09965ff
09965ff
pushd build/lib.*-%{python3_version}
09965ff
  for i in ${TESTING_DATA[@]}
09965ff
  do
09965ff
    mkdir -p ./${i%/*}/
09965ff
    cp -a ../../$i ./$i
09965ff
  done
09965ff
  PATH="%{buildroot}%{_bindir}:$PATH" nosetests-%{python3_version} -v %{?skip_tests:-e %{skip_tests}}
09965ff
popd
09965ff
09965ff
%files -n python2-%{modname}
09965ff
%license LICENSE
09965ff
%doc README.rst AUTHOR THANKS examples
09965ff
%{python2_sitearch}/%{modname}*
09965ff
09965ff
%files -n python3-%{modname}
09965ff
%license LICENSE
09965ff
%doc README.rst AUTHOR THANKS examples
09965ff
%{_bindir}/nipy_3dto4d
09965ff
%{_bindir}/nipy_4d_realign
09965ff
%{_bindir}/nipy_4dto3d
09965ff
%{_bindir}/nipy_diagnose
09965ff
%{_bindir}/nipy_tsdiffana
09965ff
%{python3_sitearch}/%{modname}*
09965ff
09965ff
%changelog
dc4440a
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-3
dc4440a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
dc4440a
4eb0922
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-2
4eb0922
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
4eb0922
ead1986
* Sun Feb 12 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.4.1-1
ead1986
- Update to latest version
ead1986
f7a415b
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-8
f7a415b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
f7a415b
72dbefd
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.4.0-7
72dbefd
- Rebuild for Python 3.6
72dbefd
8a4c1a8
* Sat Oct 15 2016 Peter Robinson <pbrobinson@fedoraproject.org> - 0.4.0-6
8a4c1a8
- rebuilt for matplotlib-2.0.0
8a4c1a8
335e8a8
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.0-5
335e8a8
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
335e8a8
3eb9263
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-4
3eb9263
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
3eb9263
09965ff
* Sun Nov 29 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.4.0-3
09965ff
- Use one directory for building
09965ff
09965ff
* Sat Nov 28 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.4.0-2
09965ff
- Do not use obsolete py3dir
09965ff
- Have only one binary
09965ff
09965ff
* Sun Nov 01 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.4.0-1
09965ff
- Initial package