From d24ef7a1826c260da2fdf92a5a3842e0bd816000 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Fri, 6 Jan 2017 15:39:00 -0700 Subject: [PATCH] Modernize spec --- python-cffi.spec | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/python-cffi.spec b/python-cffi.spec index 369448d..158088d 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -1,12 +1,10 @@ -%if 0%{?fedora} > 12 +%if 0%{?fedora} %global with_python3 1 -%else -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} %endif Name: python-cffi Version: 1.8.3 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Foreign Function Interface for Python to call C code License: MIT URL: http://cffi.readthedocs.org/ @@ -62,19 +60,12 @@ Documentation for CFFI, the Foreign Function Interface for Python. %prep %setup -q -n cffi-%{version} -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -%endif # with_python3 - %build %if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py build -popd +%py3_build %endif # with_python3 -%{__python} setup.py build +%py2_build cd doc make html rm build/html/.buildinfo @@ -86,20 +77,16 @@ rm build/html/.buildinfo %install %if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install \ - --skip-build --prefix=%{_prefix} --root %{buildroot} \ +%py3_install \ --record %{buildroot}%{python3_sitearch}/cffi-%{version}-py%{python3_version}.egg-info/installed-files.txt -popd %endif # with_python3 -%{__python} setup.py install \ - --skip-build --prefix=%{_prefix} --root %{buildroot} \ +%py2_install \ --record %{buildroot}%{python2_sitearch}/cffi-%{version}-py%{python2_version}.egg-info/installed-files.txt %files -n python2-cffi %doc PKG-INFO %license LICENSE -%{python_sitearch}/* +%{python2_sitearch}/* %if 0%{?with_python3} %files -n python3-cffi @@ -112,6 +99,9 @@ popd %doc doc/build/html %changelog +* Fri Jan 6 2017 Orion Poplawski - 1.8.3-4 +- Modernize spec + * Mon Dec 12 2016 Charalampos Stratakis - 1.8.3-3 - Rebuild for Python 3.6 - Disable test dependencies