]>
Commit | Line | Data |
---|---|---|
cf76c9b6 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | ||
5 | %define module sleekxmpp | |
6 | Summary: Flexible XMPP client/component/server library for Python | |
7 | Name: python-%{module} | |
8 | Version: 1.1.11 | |
9 | Release: 1 | |
10 | License: MIT | |
11 | Group: Libraries/Python | |
12 | Source0: http://pypi.python.org/packages/source/s/sleekxmpp/%{module}-%{version}.tar.gz | |
13 | # Source0-md5: 95f847b64fb84483acfadce425fe42cf | |
14 | URL: https://github.com/fritzy/SleekXMPP | |
15 | BuildRequires: python-devel | |
16 | BuildRequires: python3-devel | |
17 | BuildRequires: rpmbuild(macros) >= 1.219 | |
18 | %if %{with tests} | |
19 | BuildRequires: gnupg | |
20 | %endif | |
21 | Requires: python-dns | |
22 | Requires: python-pyasn1 | |
23 | Requires: python-pyasn1_modules | |
24 | BuildArch: noarch | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %description | |
28 | SleekXMPP is a flexible XMPP library for python that allows you to | |
29 | create clients, components or servers for the XMPP protocol. Plug-ins | |
30 | can be create to cover every current or future XEP. | |
31 | ||
32 | %package -n python3-sleekxmpp | |
33 | Summary: Flexible XMPP client/component/server library for Python | |
34 | Group: Libraries/Python | |
35 | Requires: python3-dns | |
36 | ||
37 | %description -n python3-sleekxmpp | |
38 | SleekXMPP is a flexible XMPP library for python that allows you to | |
39 | create clients, components or servers for the XMPP protocol. Plug-ins | |
40 | can be create to cover every current or future XEP. | |
41 | ||
42 | %prep | |
43 | %setup -q -n %{module}-%{version} | |
44 | set -- * | |
45 | install -d py3 | |
46 | cp -a "$@" py3 | |
47 | ||
48 | %build | |
49 | %{__python} setup.py build | |
50 | cd py3 | |
51 | %{__python3} setup.py build | |
52 | cd .. | |
53 | ||
54 | %if %{with tests} | |
55 | %{__python} testall.py | |
56 | cd py3 | |
57 | %{__python3} testall.py | |
58 | %endif | |
59 | ||
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | %{__python} setup.py install \ | |
63 | --optimize=2 \ | |
64 | --skip-build \ | |
65 | --root $RPM_BUILD_ROOT | |
66 | ||
4f2b45ce | 67 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/sleekxmpp/test |
cf76c9b6 ER |
68 | %py_postclean |
69 | ||
4f2b45ce ER |
70 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} |
71 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} | |
72 | ||
cf76c9b6 ER |
73 | cd py3 |
74 | %{__python3} setup.py install \ | |
75 | --optimize=2 \ | |
76 | --skip-build \ | |
77 | --root $RPM_BUILD_ROOT | |
78 | ||
cf76c9b6 ER |
79 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/sleekxmpp/test |
80 | ||
4f2b45ce ER |
81 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} |
82 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
83 | ||
cf76c9b6 ER |
84 | %clean |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | ||
87 | %files | |
88 | %defattr(644,root,root,755) | |
89 | %doc LICENSE README.rst | |
90 | %dir %{py_sitescriptdir}/sleekxmpp | |
91 | %{py_sitescriptdir}/sleekxmpp/*.py[co] | |
92 | %{py_sitescriptdir}/sleekxmpp-%{version}-*.egg-info | |
93 | %{py_sitescriptdir}/sleekxmpp/features | |
94 | %{py_sitescriptdir}/sleekxmpp/plugins | |
95 | %{py_sitescriptdir}/sleekxmpp/roster | |
96 | %{py_sitescriptdir}/sleekxmpp/stanza | |
97 | %{py_sitescriptdir}/sleekxmpp/thirdparty | |
98 | %{py_sitescriptdir}/sleekxmpp/util | |
99 | %{py_sitescriptdir}/sleekxmpp/xmlstream | |
4f2b45ce | 100 | %{_examplesdir}/python-%{module}-%{version} |
cf76c9b6 ER |
101 | |
102 | %files -n python3-sleekxmpp | |
103 | %defattr(644,root,root,755) | |
104 | %doc LICENSE README.rst | |
105 | %dir %{py3_sitescriptdir}/sleekxmpp | |
106 | %{py3_sitescriptdir}/sleekxmpp/*.py | |
107 | %{py3_sitescriptdir}/sleekxmpp/__pycache__ | |
108 | %{py3_sitescriptdir}/sleekxmpp/features | |
109 | %{py3_sitescriptdir}/sleekxmpp/plugins | |
110 | %{py3_sitescriptdir}/sleekxmpp/roster | |
111 | %{py3_sitescriptdir}/sleekxmpp/stanza | |
112 | %{py3_sitescriptdir}/sleekxmpp/thirdparty | |
113 | %{py3_sitescriptdir}/sleekxmpp/util | |
114 | %{py3_sitescriptdir}/sleekxmpp/xmlstream | |
115 | %{py3_sitescriptdir}/sleekxmpp-%{version}-*.egg-info | |
4f2b45ce | 116 | %{_examplesdir}/python3-%{module}-%{version} |