Modernize spec

This commit is contained in:
Orion Poplawski 2017-01-06 15:39:00 -07:00
parent cf9b704139
commit d24ef7a182

View File

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