diff options
author | Ken Dreyer <kdreyer@redhat.com> | 2016-01-27 13:09:35 -0700 |
---|---|---|
committer | Ken Dreyer <kdreyer@redhat.com> | 2016-01-27 13:09:35 -0700 |
commit | b8d3ffa6b6dd2363b6b8bfe3648056cc27a0b698 (patch) | |
tree | d170ed8138307cab033129aca29ed3f74e34dcf3 /python-pexpect.spec | |
parent | 26f6636990c2121894da05b09c69ced445da307d (diff) | |
download | python-pexpect-b8d3ffa6b6dd2363b6b8bfe3648056cc27a0b698.tar.gz python-pexpect-b8d3ffa6b6dd2363b6b8bfe3648056cc27a0b698.tar.xz python-pexpect-b8d3ffa6b6dd2363b6b8bfe3648056cc27a0b698.zip |
add el7 compatibilityrhcs
Diffstat (limited to 'python-pexpect.spec')
-rw-r--r-- | python-pexpect.spec | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/python-pexpect.spec b/python-pexpect.spec index ec9a44f..4fb1c0f 100644 --- a/python-pexpect.spec +++ b/python-pexpect.spec @@ -1,9 +1,13 @@ +%if 0%{?fedora} +%global with_python3 1 +%endif + %global modname pexpect Summary: Unicode-aware Pure Python Expect-like module Name: python-%{modname} Version: 4.0.1 -Release: 5%{?dist} +Release: 5%{?dist}.rhcs1 License: MIT URL: https://github.com/%{modname}/%{modname} Source0: https://github.com/%{modname}/%{modname}/archive/%{version}/%{modname}-%{version}.tar.gz @@ -14,6 +18,7 @@ Patch2: 0002-2-new-tools-display-fpathconf.maxcanon-.py.patch BuildArch: noarch BuildRequires: git-core +BuildRequires: man %description Pexpect is a pure Python module for spawning child applications; controlling @@ -33,7 +38,7 @@ pty module. %package -n python2-%{modname} Summary: Unicode-aware Pure Python Expect-like module for Python 2 BuildRequires: python2-devel -BuildRequires: python2-pytest python-ptyprocess +BuildRequires: pytest python-ptyprocess Requires: python-ptyprocess Provides: pexpect = %{version}-%{release} Obsoletes: pexpect <= 2.3-20 @@ -55,6 +60,7 @@ does not require TCL or Expect nor does it require C extensions to be compiled. It should work on any platform that supports the standard Python pty module. +%if 0%{?with_python3} %package -n python3-%{modname} Summary: Unicode-aware Pure Python Expect-like module for Python 3 BuildRequires: python3-devel @@ -77,22 +83,27 @@ Pexpect is pure Python. Unlike other Expect-like modules for Python, Pexpect does not require TCL or Expect nor does it require C extensions to be compiled. It should work on any platform that supports the standard Python pty module. +%endif # python3 %prep %autosetup -n %{modname}-%{version} -S git chmod +x ./tools/* #sed -i "s/0.1/10.0/g" tests/test_misc.py +%if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +%endif # python3 %build %py2_build +%if 0%{?with_python3} pushd %{py3dir} %py3_build popd +%endif # python3 %install %py2_install @@ -101,12 +112,14 @@ rm -rf ${buildroot}%{python2_sitelib}/setuptools/tests find examples -type f -exec chmod a-x \{\} \; rm -f %{buildroot}%{python2_sitelib}/%{modname}/async.py +%if 0%{?with_python3} pushd %{py3dir} %py3_install # Correct some permissions find examples -type f -exec chmod a-x \{\} \; rm -rf %{buildroot}%{python3_sitelib}/pexpect/tests popd +%endif # python3 %check export PYTHONIOENCODING=UTF-8 @@ -115,26 +128,36 @@ export LC_ALL="en_US.UTF-8" %{__python2} ./tools/display-sighandlers.py %{__python2} ./tools/display-terminalinfo.py PYTHONPATH=`pwd` %{__python2} ./tools/display-maxcanon.py -py.test-2 --verbose +py.test --verbose +%if 0%{?with_python3} pushd %{py3dir} %{__python3} ./tools/display-sighandlers.py %{__python3} ./tools/display-terminalinfo.py PYTHONPATH=`pwd` %{__python3} ./tools/display-maxcanon.py py.test-3 --verbose popd +%endif # python3 %files -n python2-%{modname} %license LICENSE %doc doc examples %{python2_sitelib}/%{modname}* +%if 0%{?with_python3} %files -n python3-%{modname} %license LICENSE %doc doc examples %{python3_sitelib}/%{modname}* +%endif # python3 %changelog +* Wed Jan 27 2016 Ken Dreyer <kdreyer@redhat.com> - 4.0.1-5.rhcs1 +- Only build python3 subpackage on Fedora +- BR: pytest to be compatible with el7 +- Run "pytest" (not pytest-2) during %%check (compatible with el7) +- BR: man (not in the default el7 buildroot?) + * Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.1-5 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 |