504b3c8
%global modname simplewrap
504b3c8
504b3c8
Name:           python-%{modname}
504b3c8
Version:        0.3.0
781d6e4
Release:        2%{?dist}
504b3c8
Summary:        Easy to use wrappers generator for C libraries based on ctypes
504b3c8
504b3c8
# https://github.com/spedemon/simplewrap/pull/2
504b3c8
# not license text in PyPi archive
504b3c8
License:        BSD
504b3c8
URL:            https://pypi.python.org/pypi/%{modname}
504b3c8
Source0:        https://pypi.python.org/packages/source/s/simplewrap/%{modname}-%{version}.tar.gz
504b3c8
504b3c8
BuildRequires:  gcc
504b3c8
504b3c8
%description
504b3c8
%{summary}.
504b3c8
504b3c8
%package -n python2-%{modname}
504b3c8
Summary:        %{summary}
504b3c8
%{?python_provide:%python_provide python2-%{modname}}
504b3c8
BuildRequires:  python2-devel python2-setuptools
504b3c8
%if 0%{?fedora} > 23
504b3c8
BuildRequires:  python2-numpy
504b3c8
Requires:       python2-numpy
504b3c8
%else
504b3c8
BuildRequires:  numpy
504b3c8
Requires:       numpy
504b3c8
%endif
504b3c8
504b3c8
%description -n python2-%{modname}
504b3c8
%{summary}.
504b3c8
504b3c8
Python 2 version.
504b3c8
504b3c8
%package -n python3-%{modname}
504b3c8
Summary:        %{summary}
504b3c8
%{?python_provide:%python_provide python3-%{modname}}
504b3c8
BuildRequires:  /usr/bin/2to3
504b3c8
BuildRequires:  python3-devel python3-setuptools
504b3c8
BuildRequires:  python3-numpy
504b3c8
Requires:       python3-numpy
504b3c8
504b3c8
%description -n python3-%{modname}
504b3c8
%{summary}.
504b3c8
504b3c8
Python 3 version.
504b3c8
504b3c8
%prep
504b3c8
%autosetup -c
504b3c8
mv %{modname}-%{version} python2
504b3c8
rm -rf python2/*.egg-info
504b3c8
find python2 -type f -exec chmod -x {} ';'
504b3c8
504b3c8
cp -a python2 python3
504b3c8
2to3 --write --nobackups python3
504b3c8
504b3c8
%build
504b3c8
pushd python2
504b3c8
  %py2_build
504b3c8
popd
504b3c8
504b3c8
pushd python3
504b3c8
  %py3_build
504b3c8
popd
504b3c8
504b3c8
%install
504b3c8
pushd python2
504b3c8
  %py2_install
504b3c8
popd
504b3c8
504b3c8
pushd python3
504b3c8
  %py3_install
504b3c8
popd
504b3c8
504b3c8
find %{buildroot}%{python2_sitearch} -name '*.so' -exec chmod 755 {} ';'
504b3c8
find %{buildroot}%{python3_sitearch} -name '*.so' -exec chmod 755 {} ';'
504b3c8
504b3c8
%check
504b3c8
pushd python2
504b3c8
  %{__python2} setup.py test
504b3c8
popd
504b3c8
504b3c8
pushd python3
504b3c8
  %{__python2} setup.py test
504b3c8
popd
504b3c8
504b3c8
%files -n python2-%{modname}
504b3c8
%doc python2/README.rst
504b3c8
%{python2_sitearch}/%{modname}*
504b3c8
504b3c8
%files -n python3-%{modname}
504b3c8
%doc python3/README.rst
504b3c8
%{python3_sitearch}/%{modname}*
504b3c8
504b3c8
%changelog
781d6e4
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-2
781d6e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
781d6e4
504b3c8
* Sun Dec 06 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.3.0-1
504b3c8
- Initial package