]>
Commit | Line | Data |
---|---|---|
97daeaeb AM |
1 | # Conditional build: |
2 | %bcond_with tests # do not perform "make test" | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | %define module asterisk | |
7 | %define egg_name pyst2 | |
8 | Summary: A Python Interface to Asterisk | |
9 | Name: python-pyst2 | |
10 | Version: 0.5.0 | |
6df76841 | 11 | Release: 5 |
97daeaeb AM |
12 | License: PSF |
13 | Group: Libraries/Python | |
14 | Source0: https://github.com/rdegges/pyst2/archive/%{version}.tar.gz | |
15 | # Source0-md5: c1e882331d2d3f7fe8da85b3a1e11b10 | |
16 | URL: https://pypi.python.org/pypi/pyst2 | |
17 | BuildRequires: rpm-pythonprov | |
18 | BuildRequires: rpmbuild(macros) >= 1.714 | |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules | |
21 | BuildRequires: python-setuptools | |
22 | %endif | |
23 | %if %{with python3} | |
24 | BuildRequires: python3-modules | |
25 | BuildRequires: python3-setuptools | |
26 | %endif | |
27 | Requires: python-modules | |
28 | BuildArch: noarch | |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | pyst2 consists of a set of interfaces and libraries to allow | |
33 | programming of Asterisk from python. The library currently supports | |
34 | AGI, AMI, and the parsing of Asterisk configuration files. The library | |
35 | also includes debugging facilities for AGI. | |
36 | ||
37 | %package -n python3-%{egg_name} | |
38 | Summary: A Python Interface to Asterisk | |
39 | Group: Libraries/Python | |
40 | Requires: python3-modules | |
41 | ||
42 | %description -n python3-%{egg_name} | |
43 | pyst2 consists of a set of interfaces and libraries to allow | |
44 | programming of Asterisk from python. The library currently supports | |
45 | AGI, AMI, and the parsing of Asterisk configuration files. The library | |
46 | also includes debugging facilities for AGI. | |
47 | ||
48 | %prep | |
49 | %setup -q -n pyst2-%{version} | |
50 | ||
51 | %build | |
52 | %if %{with python2} | |
53 | %py_build %{?with_tests:test} | |
54 | %endif | |
55 | ||
56 | %if %{with python3} | |
57 | %py3_build %{?with_tests:test} | |
58 | %endif | |
59 | ||
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | ||
63 | %if %{with python2} | |
64 | %py_install | |
65 | ||
66 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
67 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
68 | ||
69 | %py_postclean | |
70 | %endif | |
71 | ||
72 | %if %{with python3} | |
73 | %py3_install | |
74 | %endif | |
75 | ||
76 | %clean | |
77 | rm -rf $RPM_BUILD_ROOT | |
78 | ||
79 | %if %{with python2} | |
80 | %files | |
81 | %defattr(644,root,root,755) | |
82 | %doc CHANGELOG README.rst | |
83 | %{py_sitescriptdir}/%{module} | |
84 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
85 | %endif | |
86 | ||
87 | %if %{with python3} | |
88 | %files -n python3-%{egg_name} | |
89 | %defattr(644,root,root,755) | |
90 | %doc CHANGELOG README.rst | |
91 | %{py3_sitescriptdir}/%{module} | |
92 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
93 | %endif |