%global srcname aexpect %if ! 0%{?commit0:1} %global commit0 aca459d332c90c8d2db521819a4e2f83fa0b7614 %endif %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) %global checkout 20161010git%{shortcommit0} Name: python-%{srcname} Version: 1.2.0 Release: 2.%{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 Requires: python3 BuildRequires: python2-devel BuildRequires: python3-devel %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. %package -n python3-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{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 %prep # NOTE: revert autosetup name with the next official upstream release #autosetup -n %{srcname}-%{version} %autosetup -n %{srcname}-%{commit0} %build %py2_build %py3_build %install %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 %py2_install %check %if 0 # selftests are provided but skipped because they use unsupported tooling 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 %files -n python3-%{srcname} %license LICENSE %doc README.rst %{python3_sitelib}/aexpect/ %{python3_sitelib}/aexpect-%{version}-py%{python3_version}.egg-info %changelog * Thu Nov 10 2016 Merlin Mathesius - 1.2.0-2 - Initial packaging for Fedora.