]> git.pld-linux.org Git - packages/python-pyxmpp2.git/commitdiff
- initial; test suite doesn't work correctly so disabled; using github tarball becaus... auto/th/python-pyxmpp2-2.0.1-1
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 1 Feb 2019 10:53:21 +0000 (11:53 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 1 Feb 2019 10:53:21 +0000 (11:53 +0100)
python-pyxmpp2.spec [new file with mode: 0644]

diff --git a/python-pyxmpp2.spec b/python-pyxmpp2.spec
new file mode 100644 (file)
index 0000000..84760bc
--- /dev/null
@@ -0,0 +1,139 @@
+# Conditional build:
+%bcond_without doc     # Sphinx documentation
+%bcond_with    tests   # unit tests
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+
+%define                module          pyxmpp2
+%define                egg_name        pyxmpp2
+%define                pypi_name       pyxmpp2
+Summary:       XMPP implementation for Python
+Name:          python-%{pypi_name}
+Version:       2.0.1
+Release:       1
+License:       LGPL v2.1+
+Group:         Libraries/Python
+#Source0:      https://github.com/Jajcus/pyxmpp2/releases/download/2.0.1/pyxmpp2-2.0.1.tar.gz
+Source0:       https://github.com/Jajcus/pyxmpp2/archive/%{version}.tar.gz
+# Source0-md5: add2c546f4473385c7222b623175e6ba
+URL:           https://github.com/Jajcus/pyxmpp2
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with python2}
+BuildRequires: python-modules
+BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-pyasn1
+%endif
+%endif
+%if %{with python3}
+BuildRequires: python3-modules
+BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-pyasn1
+%endif
+%endif
+Requires:      python-dns >= 1.16.0
+Requires:      python-modules
+BuildArch:     noarch
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+XMPP implementation for Python.
+
+%package -n python3-%{pypi_name}
+Summary:       XMPP implementation for Python
+Group:         Libraries/Python
+Requires:      python3-dns >= 1.16.0
+Requires:      python3-modules
+
+%description -n python3-%{pypi_name}
+XMPP implementation for Python.
+
+%package apidocs
+Summary:       API documentation for Python %{module} module
+Summary(pl.UTF-8):     Dokumentacja API modułu Pythona %{module}
+Group:         Documentation
+
+%description apidocs
+API documentation for Python %{module} module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona %{module}.
+
+%prep
+%setup -q -n %{pypi_name}-%{version}
+
+%build
+%if %{with python2}
+%py_build %{?with_tests:test}
+%endif
+
+%if %{with python3}
+%py3_build %{?with_tests:test}
+%endif
+
+%if %{with doc}
+cd doc
+%{__make}
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%py_install
+
+# when files are installed in other way that standard 'setup.py
+# they need to be (re-)compiled
+# change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
+%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
+%py_comp $RPM_BUILD_ROOT%{py_sitedir}
+
+%py_postclean
+%endif
+
+%if %{with python3}
+%py3_install
+%endif
+
+# in case there are examples provided
+%if %{with python2}
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version}
+cp -a examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version}
+find $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version} -name '*.py' \
+       | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
+%endif
+%if %{with python3}
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
+cp -a examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
+find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version} -name '*.py' \
+       | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc README.rst TODO
+%{py_sitescriptdir}/%{module}
+%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
+%{_examplesdir}/python-%{pypi_name}-%{version}
+%endif
+
+%if %{with python3}
+%files -n python3-%{pypi_name}
+%defattr(644,root,root,755)
+%doc README.rst TODO
+%{py3_sitescriptdir}/%{module}
+%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
+%{_examplesdir}/python3-%{pypi_name}-%{version}
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc doc/www/api/*
+%endif
This page took 0.195235 seconds and 4 git commands to generate.