Blame SPECS/python-pexpect.spec

c83b34
%bcond_with check
c83b34
c83b34
%if 0%{?rhel} > 7
c83b34
# Disable python2 build by default
c83b34
%bcond_with python2
c83b34
%else
c83b34
%bcond_without python2
c83b34
%endif
c83b34
c83b34
%global modname pexpect
c83b34
c83b34
Name:           python-%{modname}
c83b34
Summary:        Unicode-aware Pure Python Expect-like module
c83b34
Version:        4.3.1
c83b34
Release:        3%{?dist}
c83b34
c83b34
License:        MIT
c83b34
URL:            https://github.com/pexpect/pexpect
c83b34
Source0:        %{url}/archive/%{version}/%{modname}-%{version}.tar.gz
c83b34
c83b34
BuildRequires:  %{_bindir}/man
c83b34
BuildRequires:  coreutils
c83b34
c83b34
BuildArch:      noarch
c83b34
c83b34
%description
c83b34
Pexpect is a pure Python module for spawning child applications; controlling
c83b34
them; and responding to expected patterns in their output. Pexpect works like
c83b34
Don Libes' Expect. Pexpect allows your script to spawn a child application and
c83b34
control it as if a human were typing commands.
c83b34
c83b34
Pexpect can be used for automating interactive applications such as ssh, ftp,
c83b34
passwd, telnet, etc. It can be used to automate setup scripts for duplicating
c83b34
software package installations on different servers. And it can be used for
c83b34
automated software testing. Pexpect is in the spirit of Don Libes' Expect, but
c83b34
Pexpect is pure Python. Unlike other Expect-like modules for Python, Pexpect
c83b34
does not require TCL or Expect nor does it require C extensions to be
c83b34
compiled.  It should work on any platform that supports the standard Python
c83b34
pty module.
c83b34
c83b34
%if %{with python2}
c83b34
%package -n python2-%{modname}
c83b34
Summary:        %{summary}
c83b34
%{?python_provide:%python_provide python2-%{modname}}
c83b34
BuildRequires:  python2-devel
c83b34
BuildRequires:  python2-pytest
c83b34
BuildRequires:  python2-ptyprocess
c83b34
Requires:       python2-ptyprocess
c83b34
Provides:       pexpect = %{version}-%{release}
c83b34
Obsoletes:      pexpect <= 2.3-20
c83b34
c83b34
%description -n python2-pexpect
c83b34
Pexpect is a pure Python module for spawning child applications; controlling
c83b34
them; and responding to expected patterns in their output. Pexpect works like
c83b34
Don Libes' Expect. Pexpect allows your script to spawn a child application and
c83b34
control it as if a human were typing commands. This package contains the
c83b34
python2 version of this module.
c83b34
c83b34
Pexpect can be used for automating interactive applications such as ssh, ftp,
c83b34
passwd, telnet, etc. It can be used to automate setup scripts for duplicating
c83b34
software package installations on different servers. And it can be used for
c83b34
automated software testing. Pexpect is in the spirit of Don Libes' Expect, but
c83b34
Pexpect is pure Python. Unlike other Expect-like modules for Python, Pexpect
c83b34
does not require TCL or Expect nor does it require C extensions to be
c83b34
compiled.  It should work on any platform that supports the standard Python
c83b34
pty module.
c83b34
%endif # with python2
c83b34
c83b34
%package -n python3-%{modname}
c83b34
Summary:        %{summary}
c83b34
%{?python_provide:%python_provide python3-%{modname}}
c83b34
BuildRequires:  python3-devel
c83b34
BuildRequires:  python3-pytest
c83b34
BuildRequires:  python3-ptyprocess
c83b34
Requires:       python3-ptyprocess
c83b34
c83b34
%description -n python3-%{modname}
c83b34
Pexpect is a pure Python module for spawning child applications; controlling
c83b34
them; and responding to expected patterns in their output. Pexpect works like
c83b34
Don Libes' Expect. Pexpect allows your script to spawn a child application and
c83b34
control it as if a human were typing commands. This package contains the
c83b34
python3 version of this module.
c83b34
c83b34
Pexpect can be used for automating interactive applications such as ssh, ftp,
c83b34
passwd, telnet, etc. It can be used to automate setup scripts for duplicating
c83b34
software package installations on different servers. And it can be used for
c83b34
automated software testing. Pexpect is in the spirit of Don Libes' Expect, but
c83b34
Pexpect is pure Python. Unlike other Expect-like modules for Python, Pexpect
c83b34
does not require TCL or Expect nor does it require C extensions to be
c83b34
compiled.  It should work on any platform that supports the standard Python
c83b34
pty module.
c83b34
c83b34
%prep
c83b34
%autosetup -c
c83b34
c83b34
%if %{with python2}
c83b34
cp-pr %{modname}-%{version} python2
c83b34
chmod +x python2/tools/*
c83b34
find python2/examples -type f | xargs chmod a-x
c83b34
%endif # with python2
c83b34
cp -pr %{modname}-%{version} python3
c83b34
chmod +x python3/tools/*
c83b34
find python3/examples -type f | xargs chmod a-x
c83b34
c83b34
%if %{with python2}
c83b34
find python2 -type f -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python2}|'
c83b34
%endif # with python2
c83b34
find python3 -type f -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python3}|'
c83b34
c83b34
%build
c83b34
%if %{with python2}
c83b34
pushd python2
c83b34
  %py2_build
c83b34
popd
c83b34
%endif # with python2
c83b34
c83b34
pushd python3
c83b34
  %py3_build
c83b34
popd
c83b34
c83b34
%install
c83b34
%if %{with python2}
c83b34
pushd python2
c83b34
  %py2_install
c83b34
  rm -rf ${buildroot}%{python2_sitelib}/setuptools/tests
c83b34
  # Drop asyncio stuff from py2
c83b34
  rm -f %{buildroot}%{python2_sitelib}/%{modname}/_async.py
c83b34
popd
c83b34
%endif # with python2
c83b34
c83b34
pushd python3
c83b34
  %py3_install
c83b34
  rm -rf %{buildroot}%{python3_sitelib}/pexpect/tests
c83b34
popd
c83b34
c83b34
%if %{with check}
c83b34
%check
c83b34
export PYTHONIOENCODING=UTF-8
c83b34
export LC_ALL="en_US.UTF-8"
c83b34
c83b34
%if %{with python2}
c83b34
pushd python2
c83b34
  %{__python2} ./tools/display-sighandlers.py
c83b34
  %{__python2} ./tools/display-terminalinfo.py
c83b34
  PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} ./tools/display-maxcanon.py
c83b34
  py.test-2 --verbose
c83b34
popd
c83b34
%endif # with python2
c83b34
c83b34
pushd python3
c83b34
  %{__python3} ./tools/display-sighandlers.py
c83b34
  %{__python3} ./tools/display-terminalinfo.py
c83b34
  PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} ./tools/display-maxcanon.py
c83b34
  py.test-3 --verbose
c83b34
popd
c83b34
%endif
c83b34
c83b34
%if %{with python2}
c83b34
%files -n python2-%{modname}
c83b34
%license python2/LICENSE
c83b34
%doc python2/doc python2/examples
c83b34
%{python2_sitelib}/%{modname}/
c83b34
%{python2_sitelib}/%{modname}-*.egg-info
c83b34
%endif # with python2
c83b34
c83b34
%files -n python3-%{modname}
c83b34
%license python3/LICENSE
c83b34
%doc python3/doc python3/examples
c83b34
%{python3_sitelib}/%{modname}/
c83b34
%{python3_sitelib}/%{modname}-*.egg-info
c83b34
c83b34
%changelog
c83b34
* Tue Jun 19 2018 Charalampos Stratakis <cstratak@redhat.com> - 4.3.1-3
c83b34
- Conditionalize the python2 subpackage
c83b34
c83b34
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.3.1-2
c83b34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c83b34
c83b34
* Fri Dec 22 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4.3.1-1
c83b34
- Update to 4.3.1
c83b34
c83b34
* Fri Nov 10 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4.3-1
c83b34
- Update to 4.3
c83b34
c83b34
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.1-2
c83b34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
c83b34
c83b34
* Tue Feb 14 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4.2.1-1
c83b34
- Update to 4.2.1
c83b34
c83b34
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-4
c83b34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
c83b34
c83b34
* Tue Dec 13 2016 Stratakis Charalampos <cstratak@redhat.com> - 4.1.0-3
c83b34
- Rebuild for Python 3.6
c83b34
c83b34
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.0-2
c83b34
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
c83b34
c83b34
* Thu Jun 30 2016 Igor Gnatenko <ignatenko@redhat.com> - 4.1.0-1
c83b34
- Update to 4.1.0
c83b34
- Improve packaging
c83b34
c83b34
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-6
c83b34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
c83b34
c83b34
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.1-5
c83b34
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
c83b34
c83b34
* Sun Oct 18 2015 Kalev Lember <klember@redhat.com> - 4.0.1-4
c83b34
- Move pexpect provides to the right subpackage
c83b34
c83b34
* Tue Oct 13 2015 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4.0.1-3
c83b34
- Fix asyncio issue (3.4.3+)
c83b34
c83b34
* Thu Oct 08 2015 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4.0.1-2
c83b34
- Fix RPM macroses
c83b34
c83b34
* Tue Oct 06 2015 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4.0.1-1
c83b34
- Update to 4.0.1
c83b34
c83b34
* Mon Oct 05 2015 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4.0-1
c83b34
- Update to 4.0
c83b34
- Follow modern RPM Packaging guidelines
c83b34
c83b34
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1-4
c83b34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
c83b34
c83b34
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1-3
c83b34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
c83b34
c83b34
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 3.1-2
c83b34
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
c83b34
c83b34
* Tue Apr 08 2014 Fabian Deutsch <fabiand@fedoraproject.org> - 3.1-1
c83b34
- Update to 3.1
c83b34
c83b34
* Tue Nov 12 2013 Thomas Spura <tomspur@fedoraproject.org> - 3.0-1
c83b34
- update to 3.0
c83b34
c83b34
* Wed Oct 30 2013 Thomas Spura <tomspur@fedoraproject.org> - 3.0-0.1
c83b34
- new upstream is github/pexpect/pexpect
c83b34
- update to rc3
c83b34
- build on noarch again
c83b34
- consistently use %%{buildroot} everywhere
c83b34
- be more explicit in %%files
c83b34
- remove CFLAGS
c83b34
c83b34
* Thu Sep 05 2013 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5.1-11
c83b34
- Fix the name of the arm architecture in ExcludeArch
c83b34
c83b34
* Thu Sep 05 2013 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5.1-10
c83b34
- Remove noarch because of arm build problems (bug #999174)
c83b34
c83b34
* Tue Aug 20 2013 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5.1-9
c83b34
- Exclude the arm architecture (bug #999174)
c83b34
c83b34
* Tue Aug 20 2013 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5.1-8
c83b34
- Bump the obsoletes version
c83b34
c83b34
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.1-7
c83b34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
c83b34
c83b34
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.1-6
c83b34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
c83b34
c83b34
* Tue Nov 20 2012 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5.1-5
c83b34
- Exclude test scripts from the files list
c83b34
c83b34
* Tue Nov 20 2012 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5.1-4
c83b34
- Moved unit tests to a check section
c83b34
c83b34
* Tue Nov 20 2012 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5.1-3
c83b34
- Added unit tests and fixed metadata fields
c83b34
c83b34
* Tue Nov 20 2012 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5.1-2
c83b34
- Added versions to the obsoletes and provides fields
c83b34
c83b34
* Tue Nov 20 2012 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5.1-1
c83b34
- Updated to version 2.5.1 (pexpect-u fork) and added support for Python 3
c83b34
c83b34
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3-6
c83b34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
c83b34
c83b34
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 2.3-5
c83b34
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
c83b34
c83b34
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3-4
c83b34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
c83b34
c83b34
* Mon Feb 23 2009 Robert Scheck <robert@fedoraproject.org> 2.3-3
c83b34
- Rebuild for gcc 4.4 and rpm 4.6
c83b34
c83b34
* Fri Dec  5 2008 Jeremy Katz <katzj@redhat.com> - 2.3-2
c83b34
- Rebuild for python 2.6
c83b34
c83b34
* Tue Jan 08 2008 Robert Scheck <robert@fedoraproject.org> 2.3-1
c83b34
- Upgrade to 2.3
c83b34
- Updated the source URL to match with the guidelines
c83b34
c83b34
* Wed Aug 29 2007 Robert Scheck <robert@fedoraproject.org> 2.1-5
c83b34
- Rebuilt (and some minor spec file tweaks)
c83b34
c83b34
* Sat Dec 09 2006 Toshio Kuratomi <toshio@tiki-lounge.com> - 2.1-4
c83b34
- Bump and rebuild because I forgot to cvs up before the last build.
c83b34
c83b34
* Sat Dec 09 2006 Toshio Kuratomi <toshio@tiki-lounge.com> - 2.1-3
c83b34
- Bump and rebuild for python 2.5 on devel.
c83b34
- Add BR: python-devel as it provides a header necessary for python modules
c83b34
  on python 2.5.
c83b34
c83b34
* Fri Sep 01 2006 Toshio Kuratomi <toshio@tiki-lounge.com> - 2.1-2
c83b34
- Remove pyver define as it's not needed with the automatic python(abi).
c83b34
- Stop ghosting .pyos.
c83b34
- Let automatic python compilation take care of creating pyos.
c83b34
- Rebuild for FC6.
c83b34
c83b34
* Mon Jul 17 2006 Toshio Kuratomi <toshio@tiki-lounge.com> - 2.1-1
c83b34
- Update to 2.1.
c83b34
c83b34
* Thu Feb 16 2006 Toshio Kuratomi <toshio@tiki-lounge.com> - 2.0-2
c83b34
- Bump and rebuild for FC5.
c83b34
- Convert from python-abi to python(abi) requires.
c83b34
c83b34
* Thu Nov 17 2005 Toshio Kuratomi <toshio@tiki-lounge.com> - 2.0-1
c83b34
- Update to 2.0.
c83b34
c83b34
* Sat Sep 3 2005 Toshio Kuratomi <toshio@tiki-lounge.com> 0.99999b-2
c83b34
- Add LICENSE File.
c83b34
- Make noarch.
c83b34
- Remove executable permissions from the modules copied to examples.
c83b34
c83b34
* Fri Sep  2 2005 Toshio Kuratomi <toshio@tiki-lounge.com> 0.99999b
c83b34
- Update to version 0.99999b.
c83b34
- Add dist tag.
c83b34
c83b34
* Thu Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
c83b34
- rebuilt
c83b34
c83b34
* Thu Feb 03 2005 Toshio Kuratomi <toshio@tiki-lounge.com> 0.999-2
c83b34
- Use python_sitelib macro to resolve build issues on x86_64.
c83b34
- %%ghost *.pyo
c83b34
- Install ANSI.py, screen.py, and FSM.py into the examples.  These are intended
c83b34
  to suplement pexpect eventually but they are currently much less robust and
c83b34
  not installed to by default.  But they are needed by some examples.
c83b34
- Use __python macro in build/install for consistency.
c83b34
- Add --skip-build to the invocation of setup.py in install.
c83b34
c83b34
* Mon May 31 2004 Panu Matilainen <pmatilai@welho.com> 0.999-0.fdr.1
c83b34
- get rid of distrel munging, buildsys does that...
c83b34
- update to 0.999
c83b34
- update doc and example tarballs
c83b34
- fix build on python <> 2.2
c83b34
- use -O1 in install to generate .pyo files instead of manually creating the files
c83b34
- require python-abi = pyver to get dependencies right
c83b34
c83b34
* Sun Jul 27 2003 Panu Matilainen <pmatilai@welho.com> 0.98-0.fdr.3
c83b34
- own .pyo files too as suggested by Ville (#517)
c83b34
c83b34
* Sat Jul 26 2003 Panu Matilainen <pmatilai@welho.com> 0.98-0.fdr.2
c83b34
- fixes by Ville (bug #517) applied
c83b34
c83b34
* Sat Jul 26 2003 Panu Matilainen <pmatilai@welho.com>
c83b34
- Initial Fedora packaging
c83b34