]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_without tests # unit tests | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | Summary: Run a subprocess in a pseudo terminal | |
9 | Summary(pl.UTF-8): Uruchamianie podprocesu w pseudoterminalu | |
10 | Name: python-ptyprocess | |
11 | Version: 0.5.1 | |
12 | Release: 1 | |
13 | License: ISC | |
14 | Group: Libraries/Python | |
15 | Source0: https://pypi.python.org/packages/source/p/ptyprocess/ptyprocess-%{version}.tar.gz | |
16 | # Source0-md5: 94e537122914cc9ec9c1eadcd36e73a1 | |
17 | URL: https://github.com/pexpect/ptyprocess | |
18 | %if %{with python2} | |
19 | BuildRequires: python-modules >= 1:2.7 | |
20 | %endif | |
21 | %if %{with python3} | |
22 | BuildRequires: python3-modules >= 1:3.2 | |
23 | %endif | |
24 | %{?with_doc:BuildRequires: sphinx-pdg} | |
25 | BuildRequires: rpm-pythonprov | |
26 | BuildRequires: rpmbuild(macros) >= 1.714 | |
27 | Requires: python-modules >= 1:2.7 | |
28 | BuildArch: noarch | |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | Python 2 module to launch a subprocess in a pseudo terminal (pty), and | |
33 | interact with both the process and its pty. | |
34 | ||
35 | Sometimes, piping stdin and stdout is not enough. There might be a | |
36 | password prompt that doesn't read from stdin, output that changes when | |
37 | it's going to a pipe rather than a terminal, or curses-style | |
38 | interfaces that rely on a terminal. If you need to automate these | |
39 | things, running the process in a pseudo terminal (pty) is the answer. | |
40 | ||
41 | %description -l pl.UTF-8 | |
42 | Moduł Pythona 2 do uruchamiania podprocesu w pseudoterminalu (pty) i | |
43 | interakcji zarówno z procesem, jak i jego terminalem. | |
44 | ||
45 | Czasem przekazywanie stdin i stdout przez potoki nie wystarcza. Może | |
46 | tak być w przypadku zapytania o hasło nie czytającego ze standardowego | |
47 | wejścia, a i wyjście czasem się zmienia, jeśli jest potokiem, a nie | |
48 | terminalem, lub interfejsem w stylu curses zależnym od terminala. | |
49 | Aby zautomatyzować takie sytuacje, rozwiązaniem jest uruchomienie | |
50 | procesu w pseudoterminalu (pty). | |
51 | ||
52 | %package -n python3-ptyprocess | |
53 | Summary: Run a subprocess in a pseudo terminal | |
54 | Summary(pl.UTF-8): Uruchamianie podprocesu w pseudoterminalu | |
55 | Group: Libraries/Python | |
56 | Requires: python3-modules >= 1:3.2 | |
57 | ||
58 | %description -n python3-ptyprocess | |
59 | Python 3 module to launch a subprocess in a pseudo terminal (pty), and | |
60 | interact with both the process and its pty. | |
61 | ||
62 | Sometimes, piping stdin and stdout is not enough. There might be a | |
63 | password prompt that doesn't read from stdin, output that changes when | |
64 | it's going to a pipe rather than a terminal, or curses-style | |
65 | interfaces that rely on a terminal. If you need to automate these | |
66 | things, running the process in a pseudo terminal (pty) is the answer. | |
67 | ||
68 | %description -n python3-ptyprocess -l pl.UTF-8 | |
69 | Moduł Pythona 3 do uruchamiania podprocesu w pseudoterminalu (pty) i | |
70 | interakcji zarówno z procesem, jak i jego terminalem. | |
71 | ||
72 | Czasem przekazywanie stdin i stdout przez potoki nie wystarcza. Może | |
73 | tak być w przypadku zapytania o hasło nie czytającego ze standardowego | |
74 | wejścia, a i wyjście czasem się zmienia, jeśli jest potokiem, a nie | |
75 | terminalem, lub interfejsem w stylu curses zależnym od terminala. | |
76 | Aby zautomatyzować takie sytuacje, rozwiązaniem jest uruchomienie | |
77 | procesu w pseudoterminalu (pty). | |
78 | ||
79 | %package apidocs | |
80 | Summary: ptyprocess API documentation | |
81 | Summary(pl.UTF-8): Dokumentacja API ptyprocess | |
82 | Group: Documentation | |
83 | ||
84 | %description apidocs | |
85 | API documentation for ptyprocess. | |
86 | ||
87 | %description apidocs -l pl.UTF-8 | |
88 | Dokumentacja API ptyprocess. | |
89 | ||
90 | %prep | |
91 | %setup -q -n ptyprocess-%{version} | |
92 | ||
93 | %build | |
94 | %if %{with python2} | |
95 | %py_build | |
96 | ||
97 | %{?with_tests:%{__python} -m unittest discover -s tests} | |
98 | %endif | |
99 | ||
100 | %if %{with python3} | |
101 | %py3_build | |
102 | ||
103 | %{?with_tests:%{__python3} -m unittest discover -s tests} | |
104 | %endif | |
105 | ||
106 | %if %{with doc} | |
107 | PYTHONPATH=$(pwd) \ | |
108 | %{__make} -C docs html | |
109 | %endif | |
110 | ||
111 | %install | |
112 | rm -rf $RPM_BUILD_ROOT | |
113 | ||
114 | %if %{with python2} | |
115 | %py_install | |
116 | ||
117 | %py_postclean | |
118 | %endif | |
119 | ||
120 | %if %{with python3} | |
121 | %py3_install | |
122 | %endif | |
123 | ||
124 | %clean | |
125 | rm -rf $RPM_BUILD_ROOT | |
126 | ||
127 | %if %{with python2} | |
128 | %files | |
129 | %defattr(644,root,root,755) | |
130 | %doc LICENSE README.rst | |
131 | %{py_sitescriptdir}/ptyprocess | |
132 | %{py_sitescriptdir}/ptyprocess-%{version}-py*.egg-info | |
133 | %endif | |
134 | ||
135 | %if %{with python3} | |
136 | %files -n python3-ptyprocess | |
137 | %defattr(644,root,root,755) | |
138 | %doc LICENSE README.rst | |
139 | %{py3_sitescriptdir}/ptyprocess | |
140 | %{py3_sitescriptdir}/ptyprocess-%{version}-py*.egg-info | |
141 | %endif | |
142 | ||
143 | %if %{with doc} | |
144 | %files apidocs | |
145 | %defattr(644,root,root,755) | |
146 | %doc docs/_build/html/{_images,_static,*.html,*.js} | |
147 | %endif |