[packages/python-enet] - added python3 module

qboosh qboosh at pld-linux.org
Thu Jul 4 21:43:35 CEST 2024


commit 95c5f4b2562a5131cb3fbb06df44093e55a6da98
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Jul 4 21:36:24 2024 +0200

    - added python3 module

 python-enet.spec | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 58 insertions(+), 1 deletion(-)
---
diff --git a/python-enet.spec b/python-enet.spec
index 7feafff..b972ec2 100644
--- a/python-enet.spec
+++ b/python-enet.spec
@@ -1,3 +1,9 @@
+#
+# Conditional build:
+%bcond_with	tests	# unit tests (test_hostname can fail on host vs FQDN mismatch)
+%bcond_without	python2 # CPython 2.x module
+%bcond_without	python3 # CPython 3.x module
+
 %define		module	pyenet
 Summary:	Python bindings for ENet
 Summary(pl.UTF-8):	Wiązania Pythona do biblioteki ENet
@@ -12,8 +18,14 @@ Source0:	https://files.pythonhosted.org/packages/source/p/pyenet/%{module}-%{ver
 Patch0:		pyenet-build-against-system-enet.patch
 URL:		https://pypi.org/project/pyenet/
 BuildRequires:	enet-devel >= 1.3.3
+%if %{with python2}
 BuildRequires:	python-Cython >= 0.13
-BuildRequires:	python-devel
+BuildRequires:	python-devel >= 1:2.5
+%endif
+%if %{with python3}
+BuildRequires:	python3-Cython >= 0.13
+BuildRequires:	python3-devel >= 1:3.2
+%endif
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -26,23 +38,68 @@ pyenet is a Python wrapper for the ENet library by Lee Salzman,
 pyenet to pythonowe obudowanie biblioteki ENet autorstwa Lee Salzmana
 <http://enet.bespin.org/>.
 
+%package -n python3-enet
+Summary:	Python bindings for ENet
+Summary(pl.UTF-8):	Wiązania Pythona do biblioteki ENet
+Group:		Libraries/Python
+
+%description -n python3-enet
+pyenet is a Python wrapper for the ENet library by Lee Salzman,
+<http://enet.bespin.org/>.
+
+%description -n python3-enet -l pl.UTF-8
+pyenet to pythonowe obudowanie biblioteki ENet autorstwa Lee Salzmana
+<http://enet.bespin.org/>.
+
 %prep
 %setup -q -n %{module}-%{version}
 %patch0 -p1
 
 %build
+%if %{with python2}
 %py_build
 
+%if %{with tests}
+PYTHONPATH=$(echo $(pwd)/build-2/lib.linux-*) \
+%{__python} test_enet.py
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+PYTHONPATH=$(echo $(pwd)/build-3/lib.linux-*) \
+%{__python3} test_enet.py
+%endif
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %py_install
+%endif
+
+%if %{with python3}
+%py3_install
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc ChangeLog LICENSE README.rst
 %attr(755,root,root) %{py_sitedir}/enet.so
 %{py_sitedir}/pyenet-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-enet
+%defattr(644,root,root,755)
+%doc ChangeLog LICENSE README.rst
+%attr(755,root,root) %{py3_sitedir}/enet.cpython-*.so
+%{py3_sitedir}/pyenet-%{version}-py*.egg-info
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-enet.git/commitdiff/95c5f4b2562a5131cb3fbb06df44093e55a6da98



More information about the pld-cvs-commit mailing list