]> git.pld-linux.org Git - packages/iotop.git/commitdiff
switch to python3; rel 2 master auto/th/iotop-0.6-2
authorJan Palus <atler@pld-linux.org>
Tue, 13 Sep 2022 17:45:51 +0000 (19:45 +0200)
committerJan Palus <atler@pld-linux.org>
Tue, 13 Sep 2022 17:45:51 +0000 (19:45 +0200)
- upstream fix for python3
- use python macros

iotop.spec
python3.patch [new file with mode: 0644]

index 073bc10f8a05b471115bb8cae39b02eaf84aa635..566b320147c903d7a7ba21bfca804ad20f634b31 100644 (file)
@@ -3,18 +3,19 @@ Summary(hu.UTF-8):    Top-szerű program I/O-hoz
 Summary(pl.UTF-8):     Narzędzie podobne do topa dla I/O
 Name:          iotop
 Version:       0.6
-Release:       1
+Release:       2
 License:       GPL v2
 Group:         Applications/System
 Source0:       http://guichaz.free.fr/iotop/files/%{name}-%{version}.tar.bz2
 # Source0-md5: 5ef9456b26d7694abf3101a72e1e0d1d
 Patch0:                status-value-error.patch
+Patch1:                python3.patch
 URL:           http://guichaz.free.fr/iotop/
-BuildRequires: python-devel >= 1:2.7
+BuildRequires: python3-devel
 BuildRequires: rpm-pythonprov
 BuildRequires: rpmbuild(macros) >= 1.219
-Requires:      python >= 1:2.7
-Requires:      python-modules >= 1:2.7
+Requires:      python3
+Requires:      python3-modules
 Requires:      uname(release) >= 2.6.20
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -40,19 +41,19 @@ wyświetlającym, dla których procesów wykonywane są operacje we/wy.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
-%{__python} setup.py build
+%py3_build
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install \
-        --optimize 2 \
-        --root=$RPM_BUILD_ROOT
 
-%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
-%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
-%py_postclean
+install -d $RPM_BUILD_ROOT%{_sbindir}
+
+%py3_install
+
+%{__mv} $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/iotop
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -62,5 +63,5 @@ rm -rf $RPM_BUILD_ROOT
 %doc NEWS THANKS
 %attr(755,root,root) %{_sbindir}/iotop
 %{_mandir}/man8/iotop.8*
-%{py_sitescriptdir}/iotop
-%{py_sitescriptdir}/iotop-%{version}-py*.egg-info
+%{py3_sitescriptdir}/iotop
+%{py3_sitescriptdir}/iotop-%{version}-py*.egg-info
diff --git a/python3.patch b/python3.patch
new file mode 100644 (file)
index 0000000..fe7a9e0
--- /dev/null
@@ -0,0 +1,32 @@
+From 99c8d7cedce81f17b851954d94bfa73787300599 Mon Sep 17 00:00:00 2001
+From: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
+Date: Fri, 17 Oct 2014 13:49:31 +0200
+Subject: [PATCH] Fix build error with Python 3 caused by itervalues() in
+ setup.py
+
+The itervalues() method is not available in Python 3. As a
+consequence, this patch replaces the call to itervalues() in setup.py
+with a call to values() which works on both Python 2 and Python 3.
+
+Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
+Signed-off-by: Paul Wise <pabs3@bonedaddy.net>
+---
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 7150102..9de6068 100755
+--- a/setup.py
++++ b/setup.py
+@@ -7,7 +7,7 @@ from iotop.version import VERSION
+ # Dirty hack to make setup.py install the iotop script to sbin/ instead of bin/
+ # while still honoring the choice of installing into local/ or not.
+ if hasattr(distutils_install, 'INSTALL_SCHEMES'):
+-    for d in distutils_install.INSTALL_SCHEMES.itervalues():
++    for d in distutils_install.INSTALL_SCHEMES.values():
+         if d.get('scripts', '').endswith('/bin'):
+             d['scripts'] = d['scripts'][:-len('/bin')] + '/sbin'
+-- 
+2.11.4.GIT
+
This page took 0.154882 seconds and 4 git commands to generate.