c4e6407
%global modname gradunwarp
c4e6407
c4e6407
Name:           python-%{modname}
33cb39b
Version:        1.0.3
ff833b8
Release:        11%{?dist}
c4e6407
Summary:        Gradient Unwarping
c4e6407
c4e6407
License:        MIT
c4e6407
URL:            https://github.com/Washington-University/gradunwarp
c4e6407
Source0:        https://github.com/Washington-University/gradunwarp/archive/v%{version}/%{modname}-%{version}.tar.gz
c4e6407
# Python 3 support
c4e6407
# https://github.com/Washington-University/gradunwarp/pull/4
c4e6407
Patch0:         0001-py3-make-modules-compatible.patch
c4e6407
Patch1:         0002-py3-make-other-stuff-compatible.patch
c4e6407
c4e6407
BuildRequires:  gcc
c4e6407
c4e6407
%description
c4e6407
Python/Numpy package used to unwarp the distorted volumes (due to the gradient
c4e6407
field inhomogenities).
c4e6407
c4e6407
%package -n python3-%{modname}
c4e6407
Summary:        %{summary}
c4e6407
%{?python_provide:%python_provide python3-%{modname}}
c4e6407
BuildRequires:  python3-devel
9c0076f
BuildRequires:  python3-numpy
9c0076f
BuildRequires:  python3-scipy
c4e6407
BuildRequires:  python3-nibabel
c4e6407
BuildRequires:  python3-nose
9c0076f
Requires:       python3-numpy
9c0076f
Requires:       python3-scipy
c4e6407
Requires:       python3-nibabel
c4e6407
c4e6407
%description -n python3-%{modname}
c4e6407
Python/Numpy package used to unwarp the distorted volumes (due to the gradient
c4e6407
field inhomogenities).
c4e6407
c4e6407
Python 3 version.
c4e6407
c4e6407
%prep
9c0076f
%autosetup -n %{modname}-%{version} -p1
c4e6407
c4e6407
%build
c4e6407
%py3_build
c4e6407
c4e6407
%install
c4e6407
%py3_install
c4e6407
c4e6407
mv %{buildroot}%{_bindir}/gradient_unwarp.py %{buildroot}%{_bindir}/gradient_unwarp
c4e6407
sed -i -e '1s|^.*$|#!%{__python3}|' %{buildroot}%{_bindir}/gradient_unwarp
c4e6407
c4e6407
find %{buildroot}%{python3_sitearch}/%{modname} -name '*.c' -delete
c4e6407
c4e6407
# remove file which installs into bindir
c4e6407
rm -f %{buildroot}%{python3_sitearch}/%{modname}/core/gradient_unwarp.py*
c4e6407
c4e6407
# fix perms on .so
9c0076f
find %{buildroot}%{python3_sitearch}/%{modname}/ -name '*.so' -exec chmod 755 {} \+
c4e6407
c4e6407
%check
c4e6407
pushd gradunwarp/core/tests/
c4e6407
  PYTHONPATH=%{buildroot}%{python3_sitearch} nosetests-%{python3_version} -v
c4e6407
popd
c4e6407
c4e6407
%files -n python3-%{modname}
c4e6407
%license Copying.md
c4e6407
%doc README.md
c4e6407
%{_bindir}/gradient_unwarp
c4e6407
%{python3_sitearch}/%{modname}*
c4e6407
c4e6407
%changelog
ff833b8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-11
ff833b8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
ff833b8
ac93aba
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-10
ac93aba
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
ac93aba
9c0076f
* Mon Aug 13 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.3-9
9c0076f
- Drop python2 subpackage
9c0076f
c03e4f1
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-8
c03e4f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
c03e4f1
fcae553
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.0.3-7
fcae553
- Rebuilt for Python 3.7
fcae553
fc0803c
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-6
fc0803c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
fc0803c
1d78be1
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-5
1d78be1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
1d78be1
ee86942
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-4
ee86942
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
ee86942
3402883
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-3
3402883
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
3402883
8857257
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.0.3-2
8857257
- Rebuild for Python 3.6
8857257
33cb39b
* Thu Oct 20 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.0.3-1
33cb39b
- Update to 1.0.3
33cb39b
a495efa
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.2-5
a495efa
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
a495efa
0c657b1
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-4
0c657b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
0c657b1
d8d20a9
* Sun Nov 29 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.0.2-3
d8d20a9
- Drop unused provides_exclude
d8d20a9
c4e6407
* Wed Nov 25 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.0.2-2
c4e6407
- Fix shebang
c4e6407
- Add python3 version
c4e6407
- Fix perms on so
c4e6407
c4e6407
* Sun Nov 08 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.0.2-1
c4e6407
- Initial package