]>
Commit | Line | Data |
---|---|---|
434a0079 JK |
1 | # |
2 | # Conditional build: | |
343939f1 | 3 | %bcond_with tests # unit tests (not included in sdist) |
434a0079 JK |
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 | |
343939f1 | 9 | Summary(pl.UTF-8): Moduł pomocniczy do testowania skryptów linii poleceń |
434a0079 JK |
10 | Name: python-%{module} |
11 | Version: 1.3 | |
242928e8 | 12 | Release: 9 |
434a0079 JK |
13 | License: MIT |
14 | Group: Libraries/Python | |
343939f1 | 15 | Source0: https://files.pythonhosted.org/packages/source/s/scripttest/%{module}-%{version}.tar.gz |
434a0079 | 16 | # Source0-md5: 1d1c5117ccfc7b5961cae6c1020c0848 |
343939f1 | 17 | URL: https://pypi.org/project/scripttest/ |
434a0079 | 18 | %if %{with python2} |
343939f1 | 19 | BuildRequires: python-modules >= 1:2.5 |
434a0079 JK |
20 | BuildRequires: python-setuptools |
21 | %if %{with tests} | |
22 | BuildRequires: python-pytest | |
23 | %endif | |
24 | %endif | |
25 | %if %{with python3} | |
343939f1 | 26 | BuildRequires: python3-modules >= 1:3.2 |
434a0079 JK |
27 | BuildRequires: python3-setuptools |
28 | %if %{with tests} | |
29 | BuildRequires: python-pytest | |
30 | %endif | |
31 | %endif | |
343939f1 JB |
32 | BuildRequires: rpm-pythonprov |
33 | BuildRequires: rpmbuild(macros) >= 1.714 | |
34 | Requires: python-modules >= 1:2.5 | |
434a0079 JK |
35 | BuildArch: noarch |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
38 | %description | |
39 | scripttest is a library to help you test your interactive command-line | |
40 | applications. | |
41 | ||
42 | With it you can easily run the command (in a subprocess) and see the | |
43 | output (stdout, stderr) and any file modifications. | |
44 | ||
343939f1 JB |
45 | %description -l pl.UTF-8 |
46 | scripttest to biblioteka pomagająca testować interaktywne aplikacje | |
47 | linii poleceń. | |
48 | ||
49 | Przy jej użyciu mozna łatwo uruchamiać polecenia (w podprocesie) i | |
50 | sprawdzać wyjście (stdout, stderr) oraz zmiany dowolnych plików. | |
51 | ||
434a0079 JK |
52 | %package -n python3-%{module} |
53 | Summary: Helper to test command-line scripts | |
343939f1 | 54 | Summary(pl.UTF-8): Moduł pomocniczy do testowania skryptów linii poleceń |
434a0079 | 55 | Group: Libraries/Python |
343939f1 | 56 | Requires: python3-modules >= 1:3.2 |
434a0079 JK |
57 | |
58 | %description -n python3-%{module} | |
59 | scripttest is a library to help you test your interactive command-line | |
60 | applications. | |
61 | ||
62 | With it you can easily run the command (in a subprocess) and see the | |
63 | output (stdout, stderr) and any file modifications. | |
64 | ||
343939f1 JB |
65 | %description -n python3-%{module} -l pl.UTF-8 |
66 | scripttest to biblioteka pomagająca testować interaktywne aplikacje | |
67 | linii poleceń. | |
68 | ||
69 | Przy jej użyciu mozna łatwo uruchamiać polecenia (w podprocesie) i | |
70 | sprawdzać wyjście (stdout, stderr) oraz zmiany dowolnych plików. | |
71 | ||
434a0079 JK |
72 | %prep |
73 | %setup -q -n %{module}-%{version} | |
74 | ||
75 | %build | |
76 | %if %{with python2} | |
77 | %py_build %{?with_tests:test} | |
78 | %endif | |
79 | ||
80 | %if %{with python3} | |
81 | %py3_build %{?with_tests:test} | |
82 | %endif | |
83 | ||
84 | %install | |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | ||
87 | %if %{with python2} | |
88 | %py_install | |
343939f1 JB |
89 | |
90 | %py_postclean | |
434a0079 JK |
91 | %endif |
92 | ||
93 | %if %{with python3} | |
94 | %py3_install | |
95 | %endif | |
96 | ||
97 | %clean | |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | ||
100 | %if %{with python2} | |
101 | %files | |
102 | %defattr(644,root,root,755) | |
103 | %doc README.rst | |
343939f1 JB |
104 | %{py_sitescriptdir}/scripttest.py[co] |
105 | %{py_sitescriptdir}/scripttest-%{version}-py*.egg-info | |
434a0079 JK |
106 | %endif |
107 | ||
108 | %if %{with python3} | |
109 | %files -n python3-%{module} | |
110 | %defattr(644,root,root,755) | |
111 | %doc README.rst | |
343939f1 JB |
112 | %{py3_sitescriptdir}/scripttest.py |
113 | %{py3_sitescriptdir}/__pycache__/scripttest.cpython-*.py[co] | |
114 | %{py3_sitescriptdir}/scripttest-%{version}-py*.egg-info | |
434a0079 | 115 | %endif |