750f711
# Use a git commit with fixes
750f711
%global commit 1fab57162a016351f530a7db2c77c1c1b3355476
750f711
%global shortcommit %(c=%{commit}; echo ${c:0:7})
750f711
750f711
# Multiple tests fail on i386
750f711
# https://github.com/nipy/nitime/issues/136
750f711
# https://github.com/nipy/nitime/issues/137
750f711
%global run_tests 0
750f711
750f711
# The documentation fails to build on F29, so we'll just point to upstream
750f711
# documentation
750f711
%if 0%{?fedora} < 30
750f711
%global with_doc 0
750f711
%else
750f711
%global with_doc 1
750f711
%endif%
750f711
750f711
750f711
# Requires nibabel which is only available for python3-nibabel
750f711
%global with_py2 0
750f711
750f711
%global srcname nitime
750f711
750f711
%global desc %{expand: \
750f711
Nitime is library of tools and algorithms for the analysis of time-series data
750f711
from neuroscience experiments. It contains a implementation of numerical
750f711
algorithms for time-series analysis both in the time and spectral domains, a
750f711
set of container objects to represent time-series, and auxiliary objects that
750f711
expose a high level interface to the numerical machinery and make common
750f711
analysis tasks easy to express with compact and semantically clear code.
750f711
750f711
Current information can always be found at the nitime website. Questions and
750f711
comments can be directed to the mailing list:
750f711
http://mail.scipy.org/mailman/listinfo/nipy-devel.
750f711
750f711
Documentation is available at http://nipy.org/nitime/documentation.html
750f711
}
750f711
750f711
750f711
Name:           python-%{srcname}
750f711
Version:        0.8
750f711
Release:        0.2.git%{shortcommit}%{?dist}
750f711
Summary:        Timeseries analysis for neuroscience data
750f711
750f711
License:        BSD
750f711
URL:            http://nipy.org/%{srcname}
750f711
Source0:        https://github.com/nipy/nitime/archive/%{commit}/%{srcname}-%{shortcommit}.tar.gz
750f711
# Remove bundled six
750f711
# Fix matplotlib
750f711
Patch0:         %{srcname}-fix-builds.patch
750f711
750f711
BuildRequires:  python3-devel
750f711
750f711
BuildRequires:  %{py3_dist networkx}
750f711
BuildRequires:  %{py3_dist nibabel}
750f711
BuildRequires:  %{py3_dist cython}
750f711
BuildRequires:  %{py3_dist pytest}
750f711
BuildRequires:  %{py3_dist nose}
750f711
BuildRequires:  %{py3_dist matplotlib}
750f711
BuildRequires:  gcc
750f711
750f711
%if %{with_doc}
750f711
BuildRequires:  %{py3_dist sphinx}
750f711
BuildRequires:  texlive-latex
750f711
BuildRequires:  texlive-ucs
750f711
BuildRequires:  tex(amsthm.sty)
750f711
%endif
750f711
750f711
Requires:       %{py3_dist numpy}
750f711
Requires:       %{py3_dist scipy}
750f711
Requires:       %{py3_dist matplotlib}
750f711
Requires:       %{py3_dist networkx}
750f711
Requires:       %{py3_dist nibabel}
750f711
Requires:       %{py3_dist cython}
750f711
Requires:       %{py3_dist six}
750f711
750f711
%description
750f711
%{desc}
750f711
750f711
%if %{with_py2}
750f711
%package -n python2-%{srcname}
750f711
Summary:        %{summary}
750f711
BuildRequires:  python2-devel
750f711
BuildRequires:  %{py2_dist networkx}
750f711
BuildRequires:  %{py2_dist nibabel}
750f711
BuildRequires:  %{py2_dist cython}
750f711
BuildRequires:  %{py2_dist pytest}
750f711
BuildRequires:  %{py2_dist nose}
750f711
BuildRequires:  %{py2_dist matplotlib}
750f711
750f711
Requires:       %{py2_dist numpy}
750f711
Requires:       %{py2_dist scipy}
750f711
Requires:       %{py2_dist matplotlib}
750f711
Requires:       %{py2_dist networkx}
750f711
Requires:       %{py2_dist nibabel}
750f711
Requires:       %{py2_dist cython}
750f711
Requires:       %{py2_dist six}
750f711
%{?python_provide:%python_provide python2-%{srcname}}
750f711
750f711
%description -n python2-%{srcname}
750f711
%{desc}
750f711
%endif
750f711
750f711
%package -n python3-%{srcname}
750f711
Summary:        %{summary}
750f711
%{?python_provide:%python_provide python3-%{srcname}}
750f711
750f711
%description -n python3-%{srcname}
750f711
%{desc}
750f711
750f711
%if %{with_doc}
750f711
%package doc
750f711
Summary:    Documentation for %{name}
750f711
BuildArch:  noarch
750f711
750f711
%description doc
750f711
Documentation files for %{name}.
750f711
%endif
750f711
750f711
%prep
750f711
%autosetup -n %{srcname}-%{commit} -p1
750f711
rm -rvf %{srcname}.egg-info
750f711
rm -f nitime/six.py
750f711
find . -name "*.so" -exec rm -fv '{}' \;
750f711
750f711
# Correct shebangs to python3
750f711
sed -i 's|^#!/usr/bin/env python|#!/usr/bin/python3|' setup.py
750f711
sed -i 's|python|python3|' doc/Makefile
750f711
pushd tools
750f711
    for f in *; do
750f711
        sed -E -i 's|^#!/usr/bin/env python|#!/usr/bin/python3|' "$f"
750f711
    done
750f711
popd
750f711
750f711
%build
750f711
%py3_build
750f711
750f711
%if %{with_py2}
750f711
%py2_build
750f711
%endif
750f711
750f711
%if %{with_doc}
750f711
pushd doc &&
750f711
    PYTHONPATH=../ make html &&
750f711
    rm -fv _build/html/.buildinfo
750f711
popd
750f711
%endif
750f711
750f711
750f711
%install
750f711
%if %{with_py2}
750f711
%py2_install
750f711
%endif
750f711
750f711
%py3_install
750f711
750f711
%check
750f711
%if %{run_tests}
750f711
# From https://github.com/neurodebian/nitime/blob/3ca5a131ba1ea839e047a7a2e008b754be9fe4bb/debian/rules#L47
750f711
%if %{with_py2}
750f711
PYTHONPATH=$RPM_BUILD_ROOT/%{python2_sitearch} nosetests-2 '--exclude=test_(coherence_linear_dependence|lazy_reload)' nitime
750f711
%endif
750f711
PYTHONPATH=$RPM_BUILD_ROOT/%{python3_sitearch} nosetests-3 '--exclude=test_(coherence_linear_dependence|lazy_reload)' nitime
750f711
%endif
750f711
750f711
%if %{with_py2}
750f711
%files -n python2-%{srcname}
750f711
%license LICENSE
750f711
%doc README.txt THANKS
750f711
%{python2_sitearch}/%{srcname}-%{version}.dev0-py2.?.egg-info
750f711
%{python2_sitearch}/%{srcname}
750f711
%endif
750f711
750f711
%files -n python3-%{srcname}
750f711
%license LICENSE
750f711
%doc README.txt THANKS
750f711
%{python3_sitearch}/%{srcname}-%{version}.dev0-py3.?.egg-info
750f711
%{python3_sitearch}/%{srcname}
750f711
750f711
%if %{with_doc}
750f711
%files doc
750f711
%license LICENSE
750f711
%doc doc/_build/html
750f711
%endif
750f711
750f711
%changelog
750f711
* Tue Nov 06 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.8-0.2.git1fab571
750f711
- Enable documentation on rawhide where build succeeds (F30)
750f711
- Remove extra buildinfo file
750f711
- Make doc package noarch
750f711
- Move THANKS file to correct bits
750f711
750f711
* Sun Nov 04 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.8-0.1.git1fab571
750f711
- Initial build