[packages/python-pycares] - new, last version for python2

qboosh qboosh at pld-linux.org
Fri Jul 11 19:02:44 CEST 2025


commit 2751c218fb9c7a8e86cf204a7f2382582b774e15
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Jul 11 19:04:07 2025 +0200

    - new, last version for python2

 python-pycares.spec | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 153 insertions(+)
---
diff --git a/python-pycares.spec b/python-pycares.spec
new file mode 100644
index 0000000..02f920b
--- /dev/null
+++ b/python-pycares.spec
@@ -0,0 +1,153 @@
+# TODO: use system c-ares (currently sources are patched)
+#
+# Conditional build:
+%bcond_without	doc	# API documentation
+%bcond_with	tests	# unit tests (require network + some past state of DNS records)
+%bcond_without	python2 # CPython 2.x module
+%bcond_with	python3 # CPython 3.x module (built from python3-pycares.spec)
+
+Summary:	Python interface for c-ares
+Summary(pl.UTF-8):	Interfejs Pythona do biblioteki c-ares
+Name:		python-pycares
+# keep 2.x here for python2 support
+Version:	2.4.0
+Release:	1
+License:	MIT
+Group:		Libraries/Python
+#Source0Download: https://pypi.org/simple/pycares/
+Source0:	https://files.pythonhosted.org/packages/source/p/pycares/pycares-%{version}.tar.gz
+# Source0-md5:	816056fc321717812de706c06d767a99
+URL:		https://pypi.org/project/pycares/
+%if %{with python2}
+BuildRequires:	python-devel >= 1:2.7
+BuildRequires:	python-setuptools
+%endif
+%if %{with python3}
+BuildRequires:	python3-devel >= 1:3.3
+BuildRequires:	python3-setuptools
+%endif
+BuildRequires:	rpm-build >= 4.6
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires:	python-sphinx_rtd_theme
+BuildRequires:	sphinx-pdg-2
+%endif
+Requires:	python-modules >= 1:2.7
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+pycares is a Python module which provides an interface to c-ares.
+c-ares <https://c-ares.org/> is a C library that performs DNS requests
+and name resolutions asynchronously.
+
+%description -l pl.UTF-8
+pycares to moduł Pythona dostarczający interfejs do biblioteki c-ares.
+c-ares <https://c-ares.org/> to biblioteka C wykonująca zapytania DNS
+i rozwiązywanie nazw w sposób asynchroniczny.
+
+%package -n python3-pycares
+Summary:	Python interface for c-ares
+Summary(pl.UTF-8):	Interfejs Pythona do biblioteki c-ares
+Group:		Libraries/Python
+Requires:	python3-modules >= 1:3.3
+
+%description -n python3-pycares
+pycares is a Python module which provides an interface to c-ares.
+c-ares <https://c-ares.org/> is a C library that performs DNS requests
+and name resolutions asynchronously.
+
+%description -n python3-pycares -l pl.UTF-8
+pycares to moduł Pythona dostarczający interfejs do biblioteki c-ares.
+c-ares <https://c-ares.org/> to biblioteka C wykonująca zapytania DNS
+i rozwiązywanie nazw w sposób asynchroniczny.
+
+%package apidocs
+Summary:	API documentation for Python pycares module
+Summary(pl.UTF-8):	Dokumentacja API modułu Pythona pycares
+Group:		Documentation
+BuildArch:	noarch
+
+%description apidocs
+API documentation for Python pycares module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona pycares.
+
+%prep
+%setup -q -n pycares-%{version}
+
+%build
+%if %{with python2}
+%py_build
+
+%if %{with tests}
+PYTHONPATH=$(echo $(pwd)/build-2/lib.*) \
+%{__python} tests/tests.py
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
+%{__python3} tests/tests.py
+%endif
+%endif
+
+%if %{with doc}
+%{__make} -C docs html \
+	SPHINXBUILD=sphinx-build-2
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%py_install
+
+%py_postclean
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python-pycares-%{version}
+cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python-pycares-%{version}
+%endif
+
+%if %{with python3}
+%py3_install
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-pycares-%{version}
+cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-pycares-%{version}
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc ChangeLog LICENSE README.rst TODO
+%dir %{py_sitedir}/pycares
+%{py_sitedir}/pycares/*.py[co]
+%attr(755,root,root) %{py_sitedir}/pycares/*.so
+%{py_sitedir}/pycares-%{version}-py*.egg-info
+%{_examplesdir}/%{name}-%{version}
+%endif
+
+%if %{with python3}
+%files -n python3-pycares
+%defattr(644,root,root,755)
+%doc ChangeLog LICENSE README.rst TODO
+%dir %{py3_sitedir}/pycares
+%{py3_sitedir}/pycares/*.py
+%attr(755,root,root) %{py3_sitedir}/pycares/*.so
+%{py3_sitedir}/pycares/__pycache__
+%{py3_sitedir}/pycares-%{version}-py*.egg-info
+%{_examplesdir}/python3-pycares-%{version}
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_static,*.html,*.js}
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pycares.git/commitdiff/2751c218fb9c7a8e86cf204a7f2382582b774e15



More information about the pld-cvs-commit mailing list