Browse code

Adding pexpect package, both python2 and python3 version, Bug # 1956911

Change-Id: Ib985b0cfd010e4bfc26485507782917ae22c7733
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/3744
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Kumar Kaushik <kaushikk@vmware.com>

Kumar Kaushik authored on 2017/09/12 09:26:05
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,69 @@
0
+%{!?python2_sitelib: %define python2_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
1
+%{!?python3_sitelib: %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
2
+
3
+Summary:        Pexpect is a Pure Python Expect-like module
4
+Name:           python-pexpect
5
+Version:        4.2.1
6
+Release:        1%{?dist}
7
+License:        ISC
8
+Url:            https://github.com/pexpect/pexpect
9
+Group:          Development/Languages/Python
10
+Vendor:         VMware, Inc.
11
+Distribution:   Photon
12
+Source0:        https://github.com/pexpect/pexpect/archive/pexpect-4.2.1.tar.gz
13
+%define sha1    pexpect=9941c99b7f1501c0210dbb98f8b26940a4429565
14
+
15
+BuildRequires:  python2-devel
16
+BuildRequires:  python-setuptools
17
+Requires:       python2
18
+Requires:       python2-libs
19
+
20
+BuildArch:      noarch
21
+
22
+%description
23
+Pexpect is a pure Python module for spawning child applications; controlling them;
24
+and responding to expected patterns in their output. Pexpect works like Don Libes Expect.
25
+Pexpect allows your script to spawn a child application and control it as if a human 
26
+were typing commands.
27
+
28
+%package -n python3-pexpect
29
+Summary:        Python3 package for pexpect
30
+BuildRequires:  python3-devel
31
+Requires:       python3
32
+Requires:       python3-libs
33
+
34
+%description -n python3-pexpect
35
+Python 3 version of pexpect
36
+
37
+%prep
38
+%setup -q -n pexpect-%{version}
39
+rm -rf ../p3dir
40
+cp -a . ../p3dir
41
+
42
+%build
43
+python2 setup.py build
44
+
45
+pushd ../p3dir
46
+python3 setup.py build
47
+popd
48
+
49
+
50
+%install
51
+rm -rf %{buildroot}
52
+python2 setup.py install --root=%{buildroot}
53
+
54
+pushd ../p3dir
55
+python3 setup.py install --root=%{buildroot}
56
+popd
57
+
58
+%files
59
+%defattr(-, root, root, -)
60
+%{python2_sitelib}/*
61
+
62
+%files -n python3-pexpect
63
+%{python3_sitelib}/*
64
+
65
+%changelog
66
+*   Mon Sep 11 2017 Kumar Kaushik <kaushikk@vmware.com> 4.2.1-1
67
+-   Initial packaging for Photon
68
+