]>
Commit | Line | Data |
---|---|---|
11808d00 MM |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
3dd42d7e ER |
6 | %define module sh |
7 | %define egg_name sh | |
8 | %define pypi_name sh | |
9 | Summary: Python subprocess interface | |
11808d00 | 10 | Name: python-%{module} |
3dd42d7e | 11 | Version: 1.11 |
86cfb248 | 12 | Release: 3 |
3dd42d7e | 13 | License: MIT |
11808d00 | 14 | Group: Libraries/Python |
3dd42d7e ER |
15 | Source0: https://files.pythonhosted.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz |
16 | # Source0-md5: 7af8df6c92d29ff927b6db0146bddec3 | |
11808d00 | 17 | URL: https://amoffat.github.io/sh/ |
11808d00 | 18 | BuildRequires: rpm-pythonprov |
e1e12f09 | 19 | BuildRequires: rpmbuild(macros) >= 1.710 |
11808d00 | 20 | %if %{with python2} |
3dd42d7e ER |
21 | BuildRequires: python-modules >= 1:2.6 |
22 | BuildRequires: python-setuptools | |
11808d00 MM |
23 | %endif |
24 | %if %{with python3} | |
11808d00 | 25 | BuildRequires: python3-modules |
3dd42d7e | 26 | BuildRequires: python3-setuptools |
11808d00 | 27 | %endif |
11808d00 MM |
28 | BuildArch: noarch |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
3dd42d7e ER |
32 | sh (previously pbs) is a full-fledged subprocess replacement for |
33 | Python 2.6 - 3.4 that allows you to call any program as if it were a | |
34 | function | |
11808d00 MM |
35 | |
36 | %package -n python3-%{module} | |
37 | Summary: SH module for python 3 | |
38 | Summary(pl.UTF-8): Moduł sh dla pythona 3 | |
39 | Group: Libraries/Python | |
40 | ||
41 | %description -n python3-%{module} | |
3dd42d7e ER |
42 | sh (previously pbs) is a full-fledged subprocess replacement for |
43 | Python 2.6 - 3.4 that allows you to call any program as if it were a | |
44 | function | |
11808d00 MM |
45 | |
46 | %prep | |
47 | %setup -q -n %{module}-%{version} | |
48 | ||
49 | %build | |
50 | %if %{with python2} | |
d1116e67 | 51 | %py_build |
11808d00 MM |
52 | %endif |
53 | ||
54 | %if %{with python3} | |
d1116e67 | 55 | %py3_build |
11808d00 MM |
56 | %endif |
57 | ||
58 | %install | |
59 | rm -rf $RPM_BUILD_ROOT | |
11808d00 | 60 | %if %{with python2} |
d1116e67 | 61 | %py_install |
11808d00 MM |
62 | %py_postclean |
63 | %endif | |
64 | ||
65 | %if %{with python3} | |
d1116e67 | 66 | %py3_install |
11808d00 MM |
67 | %endif |
68 | ||
11808d00 MM |
69 | %clean |
70 | rm -rf $RPM_BUILD_ROOT | |
71 | ||
72 | %if %{with python2} | |
73 | %files | |
74 | %defattr(644,root,root,755) | |
75 | %doc AUTHORS.md CHANGELOG.md README.md | |
3dd42d7e ER |
76 | %{py_sitescriptdir}/%{module}.py[co] |
77 | %{py_sitescriptdir}/%{egg_name}-*-py*.egg-info | |
11808d00 MM |
78 | %endif |
79 | ||
80 | %if %{with python3} | |
81 | %files -n python3-%{module} | |
82 | %defattr(644,root,root,755) | |
83 | %doc AUTHORS.md CHANGELOG.md README.md | |
3dd42d7e ER |
84 | %{py3_sitescriptdir}/__pycache__/%{module}.*.pyc |
85 | %{py3_sitescriptdir}/%{module}.py | |
86 | %{py3_sitescriptdir}/%{egg_name}-*-py*.egg-info | |
11808d00 | 87 | %endif |