]> git.pld-linux.org Git - packages/python-pyxmpp2.git/blame - python-pyxmpp2.spec
rebuild with python 3.10
[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
a194c988 13Release: 5
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
19URL: https://github.com/Jajcus/pyxmpp2
20BuildRequires: rpm-pythonprov
21BuildRequires: rpmbuild(macros) >= 1.714
22%if %{with python2}
23BuildRequires: python-modules
24BuildRequires: python-setuptools
25%if %{with tests}
26BuildRequires: python-pyasn1
27%endif
28%endif
29%if %{with python3}
30BuildRequires: python3-modules
31BuildRequires: python3-setuptools
32%if %{with tests}
33BuildRequires: python3-pyasn1
34%endif
35%endif
36Requires: python-dns >= 1.16.0
37Requires: python-modules
38BuildArch: noarch
39BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41%description
42XMPP implementation for Python.
43
44%package -n python3-%{pypi_name}
45Summary: XMPP implementation for Python
46Group: Libraries/Python
47Requires: python3-dns >= 1.16.0
48Requires: python3-modules
49
50%description -n python3-%{pypi_name}
51XMPP implementation for Python.
52
53%package apidocs
54Summary: API documentation for Python %{module} module
55Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module}
56Group: Documentation
57
58%description apidocs
59API documentation for Python %{module} module.
60
61%description apidocs -l pl.UTF-8
62Dokumentacja API modułu Pythona %{module}.
63
64%prep
65%setup -q -n %{pypi_name}-%{version}
66
67%build
68%if %{with python2}
69%py_build %{?with_tests:test}
70%endif
71
72%if %{with python3}
73%py3_build %{?with_tests:test}
74%endif
75
76%if %{with doc}
77cd doc
78%{__make}
79%endif
80
81%install
82rm -rf $RPM_BUILD_ROOT
83
84%if %{with python2}
85%py_install
86
87# when files are installed in other way that standard 'setup.py
88# they need to be (re-)compiled
89# change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
90%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
91%py_comp $RPM_BUILD_ROOT%{py_sitedir}
92
93%py_postclean
94%endif
95
96%if %{with python3}
97%py3_install
98%endif
99
100# in case there are examples provided
101%if %{with python2}
102install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version}
103cp -a examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version}
104find $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version} -name '*.py' \
105 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
106%endif
107%if %{with python3}
108install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
109cp -a examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
110find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version} -name '*.py' \
111 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
112%endif
113
114%clean
115rm -rf $RPM_BUILD_ROOT
116
117%if %{with python2}
118%files
119%defattr(644,root,root,755)
120%doc README.rst TODO
121%{py_sitescriptdir}/%{module}
122%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
123%{_examplesdir}/python-%{pypi_name}-%{version}
124%endif
125
126%if %{with python3}
127%files -n python3-%{pypi_name}
128%defattr(644,root,root,755)
129%doc README.rst TODO
130%{py3_sitescriptdir}/%{module}
131%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
132%{_examplesdir}/python3-%{pypi_name}-%{version}
133%endif
134
135%if %{with doc}
136%files apidocs
137%defattr(644,root,root,755)
138%doc doc/www/api/*
139%endif
This page took 0.099689 seconds and 4 git commands to generate.