%global srcname aexpect %if ! 0%{?commit0:1} %global commit0 aca459d332c90c8d2db521819a4e2f83fa0b7614 %endif %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) %global checkout 20161110git%{shortcommit0} # Selftests are provided but skipped because they use unsupported tooling. %global with_tests 0 %if 0%{?rhel} %global with_python3 0 %else %global with_python3 1 %endif Name: python-%{srcname} Version: 1.2.0 Release: 5.%{checkout}%{?dist} Summary: A python library to control interactive applications Group: Development/Tools License: GPLv2 URL: https://github.com/autotest/aexpect # NOTE: revert Source0 URL with the next official upstream release #Source0: https://github.com/autotest/%{srcname}/archive/%{version}.tar.gz#/%{srcname}-%{version}.tar.gz Source0: https://github.com/autotest/%{srcname}/archive/%{commit0}.tar.gz#/%{srcname}-%{shortcommit0}.tar.gz BuildArch: noarch Requires: python BuildRequires: python2-devel %if %{with_python3} Requires: python3 BuildRequires: python3-devel %endif %if 0%{?rhel} BuildRequires: python-setuptools %endif %description Aexpect is a python library used to control interactive applications, very similar to pexpect. You can use it to control applications such as ssh, scp sftp, telnet, among others. %package -n python2-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} Aexpect is a python library used to control interactive applications, very similar to pexpect. You can use it to control applications such as ssh, scp sftp, telnet, among others. %if %{with_python3} %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} %description -n python%{python3_pkgversion}-%{srcname} Aexpect is a python library used to control interactive applications, very similar to pexpect. You can use it to control applications such as ssh, scp sftp, telnet, among others. PYTHON 3 SUPPORT IS CURRENTLY EXPERIMENTAL %endif %prep # NOTE: revert autosetup name with the next official upstream release #autosetup -n %{srcname}-%{version} %autosetup -n %{srcname}-%{commit0} %build %py2_build %if %{with_python3} %py3_build %endif %install %if %{with_python3} %py3_install # install Python 2 version last since Python 3 support is currently experimental # remove Python 3 aexpect-helper as it will not be overwritten by the install rm %{buildroot}%{_bindir}/aexpect-helper %endif %py2_install %check %if %{with_tests} selftests/checkall %endif %files -n python2-%{srcname} %license LICENSE %doc README.rst %{python2_sitelib}/aexpect/ %{python2_sitelib}/aexpect-%{version}-py%{python2_version}.egg-info %{_bindir}/aexpect-helper %if %{with_python3} %files -n python%{python3_pkgversion}-%{srcname} %license LICENSE %doc README.rst %{python3_sitelib}/aexpect/ %{python3_sitelib}/aexpect-%{version}-py%{python3_version}.egg-info %endif %changelog * Mon Jan 09 2017 Merlin Mathesius - 1.2.0-5 - Updates to build for EPEL. * Mon Dec 19 2016 Miro HronĨok - 1.2.0-4.20161110gitaca459d - Rebuild for Python 3.6 * Thu Nov 10 2016 Merlin Mathesius - 1.2.0-3 - Initial packaging for Fedora.