cfcdf55
%global srcname aexpect
61c0294
61c0294
# Conditional for release vs. snapshot builds. Set to 1 for release build.
61c0294
%global rel_build 1
61c0294
61c0294
# Settings used for build from snapshots.
61c0294
%if 0%{?rel_build}
61c0294
%global gittar		%{srcname}-%{version}.tar.gz
61c0294
%else
61c0294
%if ! 0%{?commit:1}
61c0294
%global commit		aca459d332c90c8d2db521819a4e2f83fa0b7614
61c0294
%endif
61c0294
%if ! 0%{?commit_date:1}
61c0294
%global commit_date	20161110
61c0294
%endif
61c0294
%global shortcommit	%(c=%{commit};echo ${c:0:7})
61c0294
%global gitrel		.%{commit_date}git%{shortcommit}
61c0294
%global gittar		%{srcname}-%{shortcommit}.tar.gz
cfcdf55
%endif
cfcdf55
64580bb
# Selftests are provided but skipped because they use unsupported tooling.
64580bb
%global with_tests 0
64580bb
64580bb
%if 0%{?rhel}
64580bb
%global with_python3 0
64580bb
%else
64580bb
%global with_python3 1
64580bb
%endif
64580bb
cfcdf55
Name: python-%{srcname}
a4632a7
Version: 1.4.0
61c0294
Release: 1%{?gitrel}%{?dist}
cfcdf55
Summary: A python library to control interactive applications
cfcdf55
Group: Development/Tools
cfcdf55
cfcdf55
License: GPLv2
a4632a7
URL: https://github.com/avocado-framework/aexpect
61c0294
61c0294
%if 0%{?rel_build}
a4632a7
Source0: https://github.com/avocado-framework/%{srcname}/archive/%{version}.tar.gz#/%{gittar}
61c0294
%else
a4632a7
Source0: https://github.com/avocado-framework/%{srcname}/archive/%{commit}.tar.gz#/%{gittar}
61c0294
%endif
cfcdf55
cfcdf55
BuildArch: noarch
cfcdf55
Requires: python
cfcdf55
BuildRequires: python2-devel
64580bb
64580bb
%if %{with_python3}
64580bb
Requires: python3
cfcdf55
BuildRequires: python3-devel
64580bb
%endif
64580bb
64580bb
%if 0%{?rhel}
64580bb
BuildRequires: python-setuptools
64580bb
%endif
cfcdf55
cfcdf55
%description
cfcdf55
Aexpect is a python library used to control interactive applications, very
cfcdf55
similar to pexpect. You can use it to control applications such as ssh, scp
cfcdf55
sftp, telnet, among others.
cfcdf55
cfcdf55
%package -n python2-%{srcname}
cfcdf55
Summary: %{summary}
cfcdf55
%{?python_provide:%python_provide python2-%{srcname}}
cfcdf55
cfcdf55
%description -n python2-%{srcname}
cfcdf55
Aexpect is a python library used to control interactive applications, very
cfcdf55
similar to pexpect. You can use it to control applications such as ssh, scp
cfcdf55
sftp, telnet, among others.
cfcdf55
64580bb
%if %{with_python3}
64580bb
%package -n python%{python3_pkgversion}-%{srcname}
cfcdf55
Summary: %{summary}
64580bb
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
cfcdf55
64580bb
%description -n python%{python3_pkgversion}-%{srcname}
cfcdf55
Aexpect is a python library used to control interactive applications, very
cfcdf55
similar to pexpect. You can use it to control applications such as ssh, scp
cfcdf55
sftp, telnet, among others.
cfcdf55
PYTHON 3 SUPPORT IS CURRENTLY EXPERIMENTAL
64580bb
%endif
cfcdf55
cfcdf55
cfcdf55
%prep
61c0294
%if 0%{?rel_build}
61c0294
%autosetup -n %{srcname}-%{version}
61c0294
%else
61c0294
%autosetup -n %{srcname}-%{commit}
61c0294
%endif
cfcdf55
cfcdf55
%build
cfcdf55
%py2_build
64580bb
64580bb
%if %{with_python3}
cfcdf55
%py3_build
64580bb
%endif
cfcdf55
cfcdf55
%install
a4632a7
%py2_install
a4632a7
# move and symlink python2 version-specific executables
a4632a7
mv %{buildroot}%{_bindir}/aexpect-helper %{buildroot}%{_bindir}/aexpect-helper-%{python2_version}
a4632a7
ln -s aexpect-helper-%{python2_version} %{buildroot}%{_bindir}/aexpect-helper-2
a4632a7
64580bb
%if %{with_python3}
cfcdf55
%py3_install
a4632a7
# python3 aexpect-helper does not currently work; remove it
cfcdf55
rm %{buildroot}%{_bindir}/aexpect-helper
64580bb
%endif
64580bb
a4632a7
# use python2 for unversioned executable
a4632a7
ln -s aexpect-helper-%{python2_version} %{buildroot}%{_bindir}/aexpect-helper
cfcdf55
cfcdf55
%check
64580bb
%if %{with_tests}
cfcdf55
selftests/checkall
cfcdf55
%endif
cfcdf55
cfcdf55
%files -n python2-%{srcname}
cfcdf55
%license LICENSE
cfcdf55
%doc README.rst
cfcdf55
%{python2_sitelib}/aexpect/
cfcdf55
%{python2_sitelib}/aexpect-%{version}-py%{python2_version}.egg-info
cfcdf55
%{_bindir}/aexpect-helper
a4632a7
%{_bindir}/aexpect-helper-2*
cfcdf55
64580bb
%if %{with_python3}
64580bb
%files -n python%{python3_pkgversion}-%{srcname}
cfcdf55
%license LICENSE
cfcdf55
%doc README.rst
cfcdf55
%{python3_sitelib}/aexpect/
cfcdf55
%{python3_sitelib}/aexpect-%{version}-py%{python3_version}.egg-info
64580bb
%endif
cfcdf55
cfcdf55
%changelog
a4632a7
* Tue Apr 04 2017 Merlin Mathesius <mmathesi@redhat.com> - 1.4.0-1
a4632a7
- Sync with upstream release 1.4.0 (BZ#1438782).
a4632a7
- Update source location to refer to new home.
a4632a7
- Provide python2 version-specific executables.
a4632a7
e5e28e7
* Mon Feb 20 2017 Merlin Mathesius <mmathesi@redhat.com> - 1.3.1-1
e5e28e7
- Sync with upstream release 1.3.1 (BZ#1425027).
e5e28e7
61c0294
* Tue Feb 14 2017 Merlin Mathesius <mmathesi@redhat.com> - 1.3.0-1
61c0294
- Sync with upstream release 1.3.0.
61c0294
- SPEC updates to easily switch between release and snapshot builds.
61c0294
a02e104
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-6.20161110gitaca459d
a02e104
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
a02e104
64580bb
* Tue Jan 10 2017 Merlin Mathesius <mmathesi@redhat.com> - 1.2.0-5
64580bb
- SPEC updates to build and install for EPEL.
64580bb
ccd8003
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 1.2.0-4.20161110gitaca459d
ccd8003
- Rebuild for Python 3.6
ccd8003
cfcdf55
* Thu Nov 10 2016 Merlin Mathesius <mmathesi@redhat.com> - 1.2.0-3
cfcdf55
- Initial packaging for Fedora.