2013-02-10 10:02:31 +00:00
#
# spec file for package python-cffi
#
2016-05-19 09:44:00 +00:00
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
2013-02-10 10:02:31 +00:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
2013-09-30 08:50:15 +00:00
#
2013-02-10 10:02:31 +00:00
Name : python-cffi
2016-05-27 09:26:18 +00:00
Version : 1.6.0
2013-02-10 10:02:31 +00:00
Release : 0
Summary : Foreign Function Interface for Python calling C code
2013-09-30 08:50:15 +00:00
License : MIT
2013-02-10 10:02:31 +00:00
Group : Development/Languages/Python
2013-09-30 08:50:15 +00:00
Url : http://cffi.readthedocs.org
2016-05-27 09:26:18 +00:00
Source0 : https://pypi.io/packages/source/c/cffi/cffi-%{version} .tar.gz
2015-06-02 17:47:58 +00:00
Source1 : python-cffi-rpmlintrc
2016-05-30 07:26:32 +00:00
# PATCH-FIX-UPSTREAM python-cffi-avoid-bitshifting-negative-int.patch boo#981848 badshah400@gmail.com -- Use bitwise AND instead of bitshifts to test for integer types; patch submitted upstream
Patch0 : python-cffi-avoid-bitshifting-negative-int.patch
2015-06-02 17:47:58 +00:00
BuildRequires : gcc-c++
2013-02-10 10:02:31 +00:00
BuildRequires : python-devel
2013-10-24 10:59:46 +00:00
BuildRequires : python-setuptools
2013-02-10 10:02:31 +00:00
# Documentation requirements:
BuildRequires : python-Sphinx
BuildRequires : python-pycparser
2014-02-24 15:15:49 +00:00
BuildRequires : python-pytest
2013-02-10 10:02:31 +00:00
Requires : python-pycparser
BuildRoot : %{_tmppath} /%{name} -%{version} -build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c " f r o m d i s t u t i l s . s y s c o n f i g i m p o r t g e t _ p y t h o n _ l i b ; p r i n t g e t _ p y t h o n _ l i b ( 1 ) " )}
2014-03-31 14:19:07 +00:00
BuildRequires : libffi43-devel
%else
BuildRequires : pkgconfig(libffi)
2013-02-10 10:02:31 +00:00
%endif
%description
Foreign Function Interface for Python calling C code. The aim of this project
is to provide a convenient and reliable way of calling C code from Python.
%prep
%setup -q -n cffi-%{version}
2016-05-27 13:52:37 +00:00
%patch0 -p1
2013-02-10 10:02:31 +00:00
%build
CFLAGS=" %{optflags} " python setup.py build
python setup.py build_sphinx && rm build/sphinx/html/.buildinfo
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
2015-06-02 17:47:58 +00:00
# tests fail on SLE11 i586, so skip them
# TODO recheck with version > 1.1.0
%if 0%{?suse_version} > 1110
2014-04-02 08:15:41 +00:00
%check
PYTHONPATH=%{buildroot} %{python_sitearch} py.test
2015-06-02 17:47:58 +00:00
%endif
2013-02-10 10:02:31 +00:00
%files
%defattr (-,root,root,-)
%doc LICENSE build/sphinx/html/
%{python_sitearch} /*
%changelog