c4de1c
%if 0%{?fedora} > 12
c4de1c
%global with_python3 1
c4de1c
%else
c4de1c
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
c4de1c
%endif
c4de1c
c4de1c
Name:           python-cffi
c4de1c
Version:        1.6.0
c4de1c
Release:        5%{?dist}
c4de1c
Summary:        Foreign Function Interface for Python to call C code
c4de1c
License:        MIT
c4de1c
URL:            http://cffi.readthedocs.org/
c4de1c
Source0:        https://pypi.io/packages/source/c/cffi/cffi-%{version}.tar.gz
c4de1c
c4de1c
BuildRequires:  libffi-devel python-sphinx
c4de1c
BuildRequires:  python-devel python-setuptools Cython python-pycparser
c4de1c
%if 0%{?with_python3}
c4de1c
BuildRequires:  python3-devel python3-setuptools python3-Cython python3-pycparser
c4de1c
%endif # if with_python3
c4de1c
c4de1c
Requires:       python-pycparser
c4de1c
c4de1c
# Do not check .so files in the python_sitelib directory
c4de1c
# or any files in the application's directory for provides
c4de1c
%global __provides_exclude_from ^(%{python_sitearch}|%{python3_sitearch})/.*\\.so$
c4de1c
c4de1c
%description
c4de1c
Foreign Function Interface for Python, providing a convenient and
c4de1c
reliable way of calling existing C code from Python. The interface is
c4de1c
based on LuaJIT’s FFI.
c4de1c
c4de1c
%if 0%{?with_python3}
c4de1c
%package -n python3-cffi
c4de1c
Summary:        Foreign Function Interface for Python 3 to call C code
c4de1c
Requires:       python3-pycparser
c4de1c
%{?python_provide:%python_provide python3-cffi}
c4de1c
c4de1c
%description -n python3-cffi
c4de1c
Foreign Function Interface for Python, providing a convenient and
c4de1c
reliable way of calling existing C code from Python. The interface is
c4de1c
based on LuaJIT’s FFI.
c4de1c
%endif # with_python3
c4de1c
c4de1c
%package doc
c4de1c
Summary:        Documentation for CFFI
c4de1c
BuildArch:      noarch
c4de1c
Requires:       %{name} = %{version}-%{release}
c4de1c
c4de1c
%description doc
c4de1c
Documentation for CFFI, the Foreign Function Interface for Python.
c4de1c
c4de1c
%prep
c4de1c
%setup -q -n cffi-%{version}
c4de1c
c4de1c
%if 0%{?with_python3}
c4de1c
rm -rf %{py3dir}
c4de1c
cp -a . %{py3dir}
c4de1c
%endif # with_python3
c4de1c
c4de1c
%build
c4de1c
%if 0%{?with_python3}
c4de1c
pushd %{py3dir}
c4de1c
%{__python3} setup.py build
c4de1c
popd
c4de1c
%endif # with_python3
c4de1c
c4de1c
%{__python} setup.py build
c4de1c
cd doc
c4de1c
make html
c4de1c
rm build/html/.buildinfo
c4de1c
c4de1c
#%check
c4de1c
## The following test procedure works when I run it manually, but fails
c4de1c
## from rpmbuild, complaining that it can't import _cffi_backend, and I'm
c4de1c
## not sure how to make it work
c4de1c
#python setup_base.py build
c4de1c
#PYTHONPATH=build/lib.linux-* py.test c/ testing/
c4de1c
c4de1c
%install
c4de1c
%if 0%{?with_python3}
c4de1c
pushd %{py3dir}
c4de1c
%{__python3} setup.py install --skip-build --prefix=%{_prefix} --root %{buildroot}
c4de1c
popd
c4de1c
%endif # with_python3
c4de1c
%{__python} setup.py install \
c4de1c
    --skip-build --prefix=%{_prefix} --root %{buildroot} \
c4de1c
    --record %{buildroot}%{python_sitearch}/cffi-%{version}-py2.7.egg-info/installed-files.txt
c4de1c
c4de1c
%files
c4de1c
%doc PKG-INFO
c4de1c
%license LICENSE
c4de1c
%{python_sitearch}/*
c4de1c
c4de1c
%if 0%{?with_python3}
c4de1c
%files -n python3-cffi
c4de1c
%doc PKG-INFO
c4de1c
%license LICENSE
c4de1c
%{python3_sitearch}/*
c4de1c
%endif # with_python3
c4de1c
c4de1c
%files doc
c4de1c
%doc doc/build/html
c4de1c
c4de1c
%changelog
c4de1c
* Tue Aug 09 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.6.0-5
c4de1c
- Record installed files (#1255206)
c4de1c
c4de1c
* Tue May 03 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.6.0-4
c4de1c
- Import from Fedora
c4de1c
- Migrate python2-cffi => python-cffi
c4de1c
c4de1c
* Thu Apr 28 2016 John Dulaney <jdulaney@fedoraproject.org> - 1.6.0-3
c4de1c
- Switch Source0 to using pypi.io
c4de1c
c4de1c
* Thu Apr 28 2016 John Dulaney <jdulaney@fedoraproject.org> - 1.6.0-2
c4de1c
- Update Source0 URL to account for pypi change
c4de1c
c4de1c
* Thu Apr 21 2016 John Dulaney <jdulaney@fedoraproject.org> - 1.6.0-1
c4de1c
- Update to 1.6.0 (#1329203)
c4de1c
c4de1c
* Mon Feb 15 2016 John Dulaney <jdulaney@fedoraproject.org> - 1.5.2-1
c4de1c
- Update to 1.5.2 (#1299272)
c4de1c
c4de1c
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.0-2
c4de1c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
c4de1c
c4de1c
* Mon Jan 18 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.5.0-1
c4de1c
- Update to 1.5.0 (#1299272)
c4de1c
c4de1c
* Mon Jan 11 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.4.2-2
c4de1c
- Move python-cffi => python2-cffi
c4de1c
c4de1c
* Tue Dec 22 2015 John Dulaney <jdulaney@fedoraproject.org> - 1.4.2-1
c4de1c
- Update to 1.4.2 (#1293504)
c4de1c
c4de1c
* Thu Dec 17 2015 John Dulaney <jdulaney@fedoraproject.org> - 1.4.1-1
c4de1c
- Update to latest upstream release
c4de1c
c4de1c
* Fri Dec 11 2015 John Dulaney <jdulaney@fedoraproject.org> - 1.3.1-1
c4de1c
- Update to latest upstream release
c4de1c
c4de1c
* Tue Oct 13 2015 Robert Kuska <rkuska@redhat.com> - 1.1.2-4
c4de1c
- Rebuilt for Python3.5 rebuild
c4de1c
c4de1c
* Wed Jul 15 2015 Parag Nemade <pnemade AT redhat DOT com> - 1.1.2-3
c4de1c
- Modernize spec file
c4de1c
- add missing source
c4de1c
c4de1c
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.2-2
c4de1c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
c4de1c
c4de1c
* Tue Jun 16 2015 Nathaniel McCallum <npmccallum@redhat.com> - 1.1.2-2
c4de1c
- Update to 1.1.2
c4de1c
- Fix license
c4de1c
c4de1c
* Tue Aug 19 2014 Eric Smith <spacewar@gmail.com> 0.8.6-1
c4de1c
- Update to latest upstream.
c4de1c
- No python3 in el7.
c4de1c
c4de1c
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.1-4
c4de1c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
c4de1c
c4de1c
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.1-3
c4de1c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
c4de1c
c4de1c
* Mon May 12 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.8.1-2
c4de1c
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
c4de1c
c4de1c
* Wed Feb 26 2014 Eric Smith <spacewar@gmail.com> 0.8.1-1
c4de1c
- Update to latest upstream.
c4de1c
c4de1c
* Tue Aug 13 2013 Eric Smith <spacewar@gmail.com> 0.6-5
c4de1c
- Add Requires of python{,3}-pycparser.
c4de1c
c4de1c
* Thu Jul 25 2013 Eric Smith <spacewar@gmail.com> 0.6-4
c4de1c
- Fix broken conditionals in spec (missing question marks), needed for el6.
c4de1c
c4de1c
* Tue Jul 23 2013 Eric Smith <spacewar@gmail.com> 0.6-3
c4de1c
- Add Python3 support.
c4de1c
c4de1c
* Mon Jul 22 2013 Eric Smith <spacewar@gmail.com> 0.6-2
c4de1c
- Better URL, and use version macro in Source0.
c4de1c
c4de1c
* Sun Jul 21 2013 Eric Smith <spacewar@gmail.com> 0.6-1
c4de1c
- initial version