commit 41986f4696d8a9eaaeead0056d670be40c068b7d Author: dogsheng <960055655@qq.com> Date: Tue Nov 19 11:54:48 2019 +0800 Package init diff --git a/pexpect-4.6.tar.gz b/pexpect-4.6.tar.gz new file mode 100644 index 0000000..acfd7db Binary files /dev/null and b/pexpect-4.6.tar.gz differ diff --git a/python-pexpect.spec b/python-pexpect.spec new file mode 100644 index 0000000..36b3d43 --- /dev/null +++ b/python-pexpect.spec @@ -0,0 +1,98 @@ +%bcond_with check + +Name: python-pexpect +Version: 4.6 +Release: 2 +Summary: Pure Python Expect-like module +License: MIT +URL: https://github.com/pexpect/pexpect +Source0: %{url}/archive/%{version}/pexpect-%{version}.tar.gz +BuildRequires: man +BuildArch: noarch + +%description +Pexpect is a pure Python module for spawning child applications; controlling +them; and responding to expected patterns in their output. Pexpect works like +Don Libes' Expect. Pexpect allows your script to spawn a child application and +control it as if a human were typing commands. + +%package -n python2-pexpect +Summary: Unicode-aware Pure Python Expect-like module +%{?python_provide:%python_provide python2-pexpect} +BuildRequires: python2-devel python2-pytest python2-ptyprocess +Requires: python2-ptyprocess +Provides: pexpect = %{version}-%{release} +Obsoletes: pexpect <= 2.3-20 + +%description -n python2-pexpect +The python2-pexpect package contains the python2 version of Pexpect that allows your +script to spawn a child application and control it as if a human were typing commands. + +%package -n python3-pexpect +Summary: Unicode-aware Pure Python Expect-like module +%{?python_provide:%python_provide python3-pexpect} +BuildRequires: python3-devel python3-pytest python3-ptyprocess +Requires: python3-ptyprocess + +%description -n python3-pexpect +The python3-pexpect package contains the python3 version of Pexpect that allows your +script to spawn a child application and control it as if a human were typing commands. + +%prep +%autosetup -c -p1 +mv pexpect-%{version} python2 +chmod +x python2/tools/* +chmod a-x python2/examples/* +cp -pr python2 python3 + +find python2 -type f -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python2}|' +find python3 -type f -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python3}|' + +%build +cd python2 + %py2_build +cd ../python3 + %py3_build + + +%install +cd python2 + %py2_install + rm -rf ${buildroot}%{python2_sitelib}/setuptools/tests + rm -f %{buildroot}%{python2_sitelib}/pexpect/_async.py +cd ../python3 + %py3_install + rm -rf %{buildroot}%{python3_sitelib}/pexpect/tests + +%if %{with check} +%check +export PYTHONIOENCODING=UTF-8 +export LC_ALL="en_US.UTF-8" + +cd python2 + %{__python2} ./tools/display-sighandlers.py + %{__python2} ./tools/display-terminalinfo.py + PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} ./tools/display-maxcanon.py + py.test-2 --verbose +cd ../python3 + %{__python3} ./tools/display-sighandlers.py + %{__python3} ./tools/display-terminalinfo.py + PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} ./tools/display-maxcanon.py + py.test-3 --verbose +%endif + +%files -n python2-pexpect +%license python2/LICENSE +%doc python2/doc python2/examples +%{python2_sitelib}/pexpect/ +%{python2_sitelib}/pexpect-*.egg-info + +%files -n python3-pexpect +%license python3/LICENSE +%doc python3/doc python3/examples +%{python3_sitelib}/pexpect/ +%{python3_sitelib}/pexpect-*.egg-info + +%changelog +* Thu Oct 17 2019 Lijin Yang - 4.6-2 +- Package init