]>
Commit | Line | Data |
---|---|---|
434a0079 JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # do perform tests (not included) | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define module scripttest | |
8 | Summary: Helper to test command-line scripts | |
9 | Name: python-%{module} | |
10 | Version: 1.3 | |
242928e8 | 11 | Release: 9 |
434a0079 JK |
12 | License: MIT |
13 | Group: Libraries/Python | |
14 | Source0: https://pypi.python.org/packages/source/s/scripttest/%{module}-%{version}.tar.gz | |
15 | # Source0-md5: 1d1c5117ccfc7b5961cae6c1020c0848 | |
16 | URL: http://pythonpaste.org/scripttest/ | |
17 | BuildRequires: rpm-pythonprov | |
18 | BuildRequires: rpmbuild(macros) >= 1.710 | |
19 | %if %{with python2} | |
20 | BuildRequires: python-setuptools | |
21 | %if %{with tests} | |
22 | BuildRequires: python-pytest | |
23 | %endif | |
24 | %endif | |
25 | %if %{with python3} | |
26 | BuildRequires: python3-setuptools | |
27 | %if %{with tests} | |
28 | BuildRequires: python-pytest | |
29 | %endif | |
30 | %endif | |
31 | Requires: python-modules | |
32 | BuildArch: noarch | |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | scripttest is a library to help you test your interactive command-line | |
37 | applications. | |
38 | ||
39 | With it you can easily run the command (in a subprocess) and see the | |
40 | output (stdout, stderr) and any file modifications. | |
41 | ||
42 | %package -n python3-%{module} | |
43 | Summary: Helper to test command-line scripts | |
44 | Group: Libraries/Python | |
45 | Requires: python3-modules | |
46 | ||
47 | %description -n python3-%{module} | |
48 | scripttest is a library to help you test your interactive command-line | |
49 | applications. | |
50 | ||
51 | With it you can easily run the command (in a subprocess) and see the | |
52 | output (stdout, stderr) and any file modifications. | |
53 | ||
54 | %prep | |
55 | %setup -q -n %{module}-%{version} | |
56 | ||
57 | %build | |
58 | %if %{with python2} | |
59 | %py_build %{?with_tests:test} | |
60 | %endif | |
61 | ||
62 | %if %{with python3} | |
63 | %py3_build %{?with_tests:test} | |
64 | %endif | |
65 | ||
66 | %install | |
67 | rm -rf $RPM_BUILD_ROOT | |
68 | ||
69 | %if %{with python2} | |
70 | %py_install | |
71 | %endif | |
72 | ||
73 | %if %{with python3} | |
74 | %py3_install | |
75 | %endif | |
76 | ||
77 | %clean | |
78 | rm -rf $RPM_BUILD_ROOT | |
79 | ||
80 | %if %{with python2} | |
81 | %files | |
82 | %defattr(644,root,root,755) | |
83 | %doc README.rst | |
84 | %{py_sitescriptdir}/%{module}*.py | |
85 | %{py_sitescriptdir}/%{module}*.py[co] | |
86 | %if "%{py_ver}" > "2.4" | |
87 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
88 | %endif | |
89 | %endif | |
90 | ||
91 | %if %{with python3} | |
92 | %files -n python3-%{module} | |
93 | %defattr(644,root,root,755) | |
94 | %doc README.rst | |
95 | %{py3_sitescriptdir}/%{module}.py | |
96 | %{py3_sitescriptdir}/__pycache__/%{module}.* | |
97 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
98 | %endif |