From dd2c08f49659434fddbee9942530f28e09ed41df Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mar 12 2016 11:53:46 +0000 Subject: SPEC file cleanup and updated package to use only Python 3 --- diff --git a/iotop-python3build.patch b/iotop-python3build.patch new file mode 100644 index 0000000..55b73db --- /dev/null +++ b/iotop-python3build.patch @@ -0,0 +1,32 @@ +From 99c8d7cedce81f17b851954d94bfa73787300599 Mon Sep 17 00:00:00 2001 +From: Christophe Vu-Brugier +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 +Signed-off-by: Paul Wise +--- + 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.4.10.GIT + diff --git a/iotop.spec b/iotop.spec index f0e47ff..b0c3d09 100644 --- a/iotop.spec +++ b/iotop.spec @@ -1,32 +1,21 @@ -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Name: iotop Version: 0.6 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Top like utility for I/O - -Group: Applications/System License: GPLv2+ URL: http://guichaz.free.fr/iotop/ -Source0: http://guichaz.free.fr/iotop/files/%{name}-%{version}.tar.bz2 +Source0: http://guichaz.free.fr/iotop/files/%{name}-%{version}.tar.bz2 # rhbz#1035503 -Patch1: iotop-0.6-noendcurses.patch -Patch2: iotop-0.6-python3.patch +Patch0: iotop-0.6-noendcurses.patch +Patch1: iotop-0.6-python3.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +# Fix build error with Python 3 caused by itervalues() in setup.py +# http://repo.or.cz/iotop.git/commit/99c8d7cedce81f17b851954d94bfa73787300599 +Patch2: iotop-python3build.patch BuildArch: noarch -BuildRequires: python3-devel -BuildRequires: python -Requires: python3 - -%prep -%setup -%patch1 -p1 -b .noendcurses -%patch2 -p1 -b .python3 - -%build -%{__python} setup.py build +BuildRequires: python3-devel %description Linux has always been able to show how much I/O was going on @@ -34,24 +23,34 @@ Linux has always been able to show how much I/O was going on iotop is a Python program with a top like UI used to show of behalf of which process is the I/O going on. +%prep +%setup -n %{name}-%{version} +%patch0 -p1 -b .noendcurses +%patch1 -p1 -b .python3 +%patch2 -p1 -%install -rm -rf $RPM_BUILD_ROOT -%{__python} setup.py install --root=${RPM_BUILD_ROOT} - - -%clean -rm -rf $RPM_BUILD_ROOT +%build +%py3_build +%install +%py3_install -%files -%defattr(-,root,root,-) -%doc COPYING NEWS THANKS +%files -n %{name} +%doc NEWS THANKS README ChangeLog +%license COPYING +%{python3_sitelib}/* %{_sbindir}/iotop %{_mandir}/man8/iotop.* -%{python_sitelib}/* %changelog +* Mon Feb 29 2016 Charalampos Stratakis - 0.6-10 +- SPEC file cleanup +- Added licence tag +- Removal of old and unneeded macros +- Use of newest python macros +- Removed Python 2 dependency +- Added patch for Python 3 build + * Thu Feb 04 2016 Fedora Release Engineering - 0.6-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild