]>
Commit | Line | Data |
---|---|---|
cf76c9b6 ER |
1 | # |
2 | # Conditional build: | |
3b2560da ER |
3 | %bcond_without apidocs # do not build and package API docs |
4 | %bcond_with tests # do not perform "make test" | |
cf76c9b6 ER |
5 | |
6 | %define module sleekxmpp | |
7 | Summary: Flexible XMPP client/component/server library for Python | |
8 | Name: python-%{module} | |
9 | Version: 1.1.11 | |
a6e852f4 | 10 | Release: 8 |
cf76c9b6 ER |
11 | License: MIT |
12 | Group: Libraries/Python | |
13 | Source0: http://pypi.python.org/packages/source/s/sleekxmpp/%{module}-%{version}.tar.gz | |
14 | # Source0-md5: 95f847b64fb84483acfadce425fe42cf | |
15 | URL: https://github.com/fritzy/SleekXMPP | |
3157a83c ER |
16 | BuildRequires: python-distribute |
17 | BuildRequires: python-modules | |
18 | BuildRequires: python3-modules | |
19 | BuildRequires: rpm-pythonprov | |
cc10fcf6 | 20 | BuildRequires: rpmbuild(macros) >= 1.710 |
3b2560da ER |
21 | %if %{with apidocs} |
22 | BuildRequires: sphinx-pdg | |
23 | %endif | |
cf76c9b6 ER |
24 | %if %{with tests} |
25 | BuildRequires: gnupg | |
26 | %endif | |
27 | Requires: python-dns | |
28 | Requires: python-pyasn1 | |
29 | Requires: python-pyasn1_modules | |
30 | BuildArch: noarch | |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | SleekXMPP is a flexible XMPP library for python that allows you to | |
35 | create clients, components or servers for the XMPP protocol. Plug-ins | |
36 | can be create to cover every current or future XEP. | |
37 | ||
38 | %package -n python3-sleekxmpp | |
39 | Summary: Flexible XMPP client/component/server library for Python | |
40 | Group: Libraries/Python | |
41 | Requires: python3-dns | |
42 | ||
43 | %description -n python3-sleekxmpp | |
44 | SleekXMPP is a flexible XMPP library for python that allows you to | |
45 | create clients, components or servers for the XMPP protocol. Plug-ins | |
46 | can be create to cover every current or future XEP. | |
47 | ||
3b2560da ER |
48 | %package apidoc |
49 | Summary: %{module} API documentation | |
50 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
51 | Group: Documentation | |
52 | ||
53 | %description apidoc | |
54 | API documentation for %{module}. | |
55 | ||
56 | %description apidoc -l pl.UTF-8 | |
57 | Dokumentacja API %{module}. | |
58 | ||
cf76c9b6 ER |
59 | %prep |
60 | %setup -q -n %{module}-%{version} | |
cf76c9b6 ER |
61 | |
62 | %build | |
d258c253 JK |
63 | %py_build %{?with_tests:test} |
64 | %py3_build %{?with_tests:test} | |
3b2560da ER |
65 | |
66 | %if %{with apidocs} | |
67 | %{__make} -C docs html | |
68 | # remove the sphinx-build leftovers | |
69 | %{__rm} docs/_build/html/.buildinfo | |
cf76c9b6 ER |
70 | %endif |
71 | ||
72 | %install | |
73 | rm -rf $RPM_BUILD_ROOT | |
d258c253 | 74 | %py_install |
cf76c9b6 | 75 | |
4f2b45ce | 76 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/sleekxmpp/test |
cf76c9b6 ER |
77 | %py_postclean |
78 | ||
4f2b45ce ER |
79 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} |
80 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} | |
47a0afac JR |
81 | %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python}\1,' \ |
82 | $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}/*/*.py \ | |
83 | $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}/*.py | |
4f2b45ce | 84 | |
d258c253 | 85 | %py3_install |
cf76c9b6 | 86 | |
cf76c9b6 ER |
87 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/sleekxmpp/test |
88 | ||
4f2b45ce ER |
89 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} |
90 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
47a0afac JR |
91 | %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python3}\1,' \ |
92 | $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/*/*.py \ | |
93 | $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/*.py | |
4f2b45ce | 94 | |
cf76c9b6 ER |
95 | %clean |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
98 | %files | |
99 | %defattr(644,root,root,755) | |
100 | %doc LICENSE README.rst | |
101 | %dir %{py_sitescriptdir}/sleekxmpp | |
102 | %{py_sitescriptdir}/sleekxmpp/*.py[co] | |
103 | %{py_sitescriptdir}/sleekxmpp-%{version}-*.egg-info | |
104 | %{py_sitescriptdir}/sleekxmpp/features | |
105 | %{py_sitescriptdir}/sleekxmpp/plugins | |
106 | %{py_sitescriptdir}/sleekxmpp/roster | |
107 | %{py_sitescriptdir}/sleekxmpp/stanza | |
108 | %{py_sitescriptdir}/sleekxmpp/thirdparty | |
109 | %{py_sitescriptdir}/sleekxmpp/util | |
110 | %{py_sitescriptdir}/sleekxmpp/xmlstream | |
4f2b45ce | 111 | %{_examplesdir}/python-%{module}-%{version} |
cf76c9b6 ER |
112 | |
113 | %files -n python3-sleekxmpp | |
114 | %defattr(644,root,root,755) | |
115 | %doc LICENSE README.rst | |
116 | %dir %{py3_sitescriptdir}/sleekxmpp | |
117 | %{py3_sitescriptdir}/sleekxmpp/*.py | |
118 | %{py3_sitescriptdir}/sleekxmpp/__pycache__ | |
119 | %{py3_sitescriptdir}/sleekxmpp/features | |
120 | %{py3_sitescriptdir}/sleekxmpp/plugins | |
121 | %{py3_sitescriptdir}/sleekxmpp/roster | |
122 | %{py3_sitescriptdir}/sleekxmpp/stanza | |
123 | %{py3_sitescriptdir}/sleekxmpp/thirdparty | |
124 | %{py3_sitescriptdir}/sleekxmpp/util | |
125 | %{py3_sitescriptdir}/sleekxmpp/xmlstream | |
126 | %{py3_sitescriptdir}/sleekxmpp-%{version}-*.egg-info | |
4f2b45ce | 127 | %{_examplesdir}/python3-%{module}-%{version} |
3b2560da ER |
128 | |
129 | %files apidoc | |
130 | %defattr(644,root,root,755) | |
131 | %doc docs/_build/html/* |