diff --git a/python-module-psutil.spec b/python-module-psutil.spec index 02cf87a..9cd8ef2 100644 --- a/python-module-psutil.spec +++ b/python-module-psutil.spec @@ -1,4 +1,5 @@ %define oname psutil +%def_with python3 Name: python-module-%oname Version: 0.7.1 @@ -16,11 +17,19 @@ Source: %oname-%version.tar %add_python_req_skip _psutil_bsd _psutil_mswindows _psutil_osx pywintypes win32com +%if_with python3 +%add_python3_req_skip _psutil_bsd _psutil_mswindows _psutil_osx pywintypes win32com +%endif + # Automatically added by buildreq on Wed Sep 08 2010 BuildRequires: python-devel BuildPreReq: rpm-build-python +%if_with python3 +BuildRequires(pre): rpm-build-python3 +BuildRequires: python3-devel +%endif %setup_python_module %oname @@ -30,14 +39,43 @@ processes and system utilization (CPU, memory) in a portable way by using Python, implementing many functionalities offered by tools like ps, top and Windows task manager. +%if_with python3 +%package -n python3-module-%oname +Summary: A process utilities module for Python 3 +Group: Development/Python3 + +%description -n python3-module-%oname +psutil is a module providing an interface for retrieving information on running +processes and system utilization (CPU, memory) in a portable way by using +Python, implementing many functionalities offered by tools like ps, top and +Windows task manager. +This is a Python3 module. +%endif + + %prep %setup -n %oname-%version +sed -i '1d' psutil/*.py +%if_with python3 +rm -rf ../python3 +cp -a . ../python3 +%endif %build %python_build +%if_with python3 +pushd ../python3 +%python3_build +popd +%endif %install %python_install +%if_with python3 +pushd ../python3 +%python3_install +popd +%endif %files %doc README LICENSE @@ -45,6 +83,14 @@ Windows task manager. %python_sitelibdir/_*.so %python_sitelibdir/*.egg-info +%if_with python3 +%files -n python3-module-%oname +%doc README LICENSE +%python3_sitelibdir/%oname/ +%python3_sitelibdir/_*.so +%python3_sitelibdir/*.egg-info +%endif + %changelog * Sun Aug 04 2013 Vitaly Lipatov 0.7.1-alt1 - new version 0.7.1 (with rpmrb script)