]> git.pld-linux.org Git - packages/python-pyxmpp2.git/blame - python-pyxmpp2.spec
Rel 7; some python 3.9+ fixes; use newer TLS version; workaround newer setuptools...
[packages/python-pyxmpp2.git] / python-pyxmpp2.spec
CommitLineData
8455c690
AM
1# Conditional build:
2%bcond_without doc # Sphinx documentation
3%bcond_with tests # unit tests
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6
7%define module pyxmpp2
8%define egg_name pyxmpp2
9%define pypi_name pyxmpp2
10Summary: XMPP implementation for Python
11Name: python-%{pypi_name}
12Version: 2.0.1
875c7828 13Release: 7
8455c690
AM
14License: LGPL v2.1+
15Group: Libraries/Python
16#Source0: https://github.com/Jajcus/pyxmpp2/releases/download/2.0.1/pyxmpp2-2.0.1.tar.gz
17Source0: https://github.com/Jajcus/pyxmpp2/archive/%{version}.tar.gz
18# Source0-md5: add2c546f4473385c7222b623175e6ba
875c7828
AM
19Patch0: py.patch
20Patch1: tls.patch
21Patch2: newer-setuptools.patch
8455c690
AM
22URL: https://github.com/Jajcus/pyxmpp2
23BuildRequires: rpm-pythonprov
24BuildRequires: rpmbuild(macros) >= 1.714
25%if %{with python2}
26BuildRequires: python-modules
27BuildRequires: python-setuptools
28%if %{with tests}
29BuildRequires: python-pyasn1
30%endif
31%endif
32%if %{with python3}
875c7828 33BuildRequires: python3-2to3
8455c690
AM
34BuildRequires: python3-modules
35BuildRequires: python3-setuptools
36%if %{with tests}
37BuildRequires: python3-pyasn1
38%endif
39%endif
875c7828
AM
40%if %{with doc}
41BuildRequires: epydoc
42%endif
8455c690
AM
43Requires: python-dns >= 1.16.0
44Requires: python-modules
45BuildArch: noarch
46BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48%description
49XMPP implementation for Python.
50
51%package -n python3-%{pypi_name}
52Summary: XMPP implementation for Python
53Group: Libraries/Python
54Requires: python3-dns >= 1.16.0
55Requires: python3-modules
56
57%description -n python3-%{pypi_name}
58XMPP implementation for Python.
59
60%package apidocs
61Summary: API documentation for Python %{module} module
62Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module}
63Group: Documentation
64
65%description apidocs
66API documentation for Python %{module} module.
67
68%description apidocs -l pl.UTF-8
69Dokumentacja API modułu Pythona %{module}.
70
71%prep
72%setup -q -n %{pypi_name}-%{version}
875c7828
AM
73%patch0 -p1
74%patch1 -p1
75%patch2 -p1
76
77install -d orgsrc
78mv !(orgsrc) orgsrc
79%if %{with python2}
80cp -a orgsrc python2-src
81%endif
82
83%if %{with python3}
84cp -a orgsrc python3-src
852to3-%{py3_ver} -w --no-diffs python3-src
86%endif
8455c690
AM
87
88%build
89%if %{with python2}
875c7828 90cd python2-src
8455c690 91%py_build %{?with_tests:test}
875c7828 92cd ..
8455c690
AM
93%endif
94
95%if %{with python3}
875c7828 96cd python3-src
8455c690 97%py3_build %{?with_tests:test}
875c7828 98cd ..
8455c690
AM
99%endif
100
101%if %{with doc}
875c7828 102cd orgsrc/doc
8455c690 103%{__make}
875c7828 104cd ..
8455c690
AM
105%endif
106
107%install
108rm -rf $RPM_BUILD_ROOT
109
110%if %{with python2}
875c7828 111cd python2-src
8455c690
AM
112%py_install
113
114# when files are installed in other way that standard 'setup.py
115# they need to be (re-)compiled
116# change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
117%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
118%py_comp $RPM_BUILD_ROOT%{py_sitedir}
119
120%py_postclean
875c7828 121cd ..
8455c690
AM
122%endif
123
124%if %{with python3}
875c7828 125cd python3-src
8455c690 126%py3_install
875c7828 127cd ..
8455c690
AM
128%endif
129
130# in case there are examples provided
131%if %{with python2}
875c7828 132cd python2-src
8455c690
AM
133install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version}
134cp -a examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version}
135find $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version} -name '*.py' \
136 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
875c7828 137cd ..
8455c690
AM
138%endif
139%if %{with python3}
875c7828 140cd python3-src
8455c690
AM
141install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
142cp -a examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
143find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version} -name '*.py' \
144 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
875c7828 145cd ..
8455c690
AM
146%endif
147
148%clean
149rm -rf $RPM_BUILD_ROOT
150
151%if %{with python2}
152%files
153%defattr(644,root,root,755)
875c7828 154%doc orgsrc/{README.rst,TODO}
8455c690
AM
155%{py_sitescriptdir}/%{module}
156%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
157%{_examplesdir}/python-%{pypi_name}-%{version}
158%endif
159
160%if %{with python3}
161%files -n python3-%{pypi_name}
162%defattr(644,root,root,755)
875c7828 163%doc orgsrc/{README.rst,TODO}
8455c690
AM
164%{py3_sitescriptdir}/%{module}
165%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
166%{_examplesdir}/python3-%{pypi_name}-%{version}
167%endif
168
169%if %{with doc}
170%files apidocs
171%defattr(644,root,root,755)
875c7828 172%doc orgsrc/doc/www/api/*
8455c690 173%endif
This page took 0.130964 seconds and 4 git commands to generate.