[packages/python-netifaces] - up to 0.10.5 - added python3 package

baggins baggins at pld-linux.org
Sun May 14 15:28:06 CEST 2017


commit f6b47641aca5fe71b2628df1e9ec037c20e8914c
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun May 14 15:27:30 2017 +0200

    - up to 0.10.5
    - added python3 package

 python-netifaces.spec | 64 ++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 56 insertions(+), 8 deletions(-)
---
diff --git a/python-netifaces.spec b/python-netifaces.spec
index 640a75f..a36a689 100644
--- a/python-netifaces.spec
+++ b/python-netifaces.spec
@@ -1,20 +1,28 @@
 #
 # Conditional build:
 %bcond_without	tests	# do not perform "make test"
+%bcond_without	python2 # CPython 2.x module
+%bcond_without	python3 # CPython 3.x module
 
-%define 	module	netifaces
+%define		module	netifaces
 Summary:	Python library to retrieve information about network interfaces
 Name:		python-%{module}
-Version:	0.8
-Release:	3
+Version:	0.10.5
+Release:	1
 License:	MIT
 Group:		Development/Languages/Python
-Source0:	http://alastairs-place.net/projects/netifaces/%{module}-%{version}.tar.gz
-# Source0-md5:	e57e5983f4c286fac5f8068fbfc5c873
-URL:		http://alastairs-place.net/projects/netifaces/
+Source0:	https://files.pythonhosted.org/packages/source/n/%{module}/%{module}-%{version}.tar.gz
+# Source0-md5:	5b4d1f1310ed279e6df27ef3a9b71519
+URL:		https://alastairs-place.net/projects/netifaces/
 BuildRequires:	rpmbuild(macros) >= 1.710
+%if %{with python2}
 BuildRequires:	python-devel
 BuildRequires:	python-distribute
+%endif
+%if %{with python3}
+BuildRequires:	python3-modules
+BuildRequires:	python3-setuptools
+%endif
 BuildRequires:	rpm-pythonprov
 Requires:	python-modules
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -23,25 +31,65 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 This package provides a cross platform API for getting address
 information from network interfaces.
 
+%package -n python3-%{module}
+Summary:	Python library to retrieve information about network interfaces
+Group:		Libraries/Python
+Requires:	python3-modules
+
+%description -n python3-%{module}
+This package provides a cross platform API for getting address
+information from network interfaces.
+
 %prep
 %setup -q -n %{module}-%{version}
 
 %build
+%if %{with python2}
 %py_build
-
 %{?with_tests:%{__python} setup.py test}
+%endif
+
+%if %{with python3}
+%py3_build
+%{?with_tests:%{__python3} setup.py test}
+%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
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
-%doc README
+%doc README.rst
 %attr(755,root,root) %{py_sitedir}/netifaces.so
 %if "%{py_ver}" > "2.4"
 %{py_sitedir}/netifaces-*.egg-info
 %endif
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc README.rst
+%{py3_sitedir}/netifaces*.so
+%{py3_sitedir}/%{module}-%{version}-py*.egg-info
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-netifaces.git/commitdiff/f6b47641aca5fe71b2628df1e9ec037c20e8914c



More information about the pld-cvs-commit mailing list