SPEC file cleanup and updated package to use only Python 3

This commit is contained in:
Charalampos Stratakis 2016-03-12 12:53:11 +01:00 committed by Miro Hrončok
parent eec1e9d7d0
commit dd2c08f496
2 changed files with 61 additions and 30 deletions

32
iotop-python3build.patch Normal file
View File

@ -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.4.10.GIT

View File

@ -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
# 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
%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
%build
%py3_build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --root=${RPM_BUILD_ROOT}
%py3_install
%clean
rm -rf $RPM_BUILD_ROOT
%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 <cstratak@redhat.com> - 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 <releng@fedoraproject.org> - 0.6-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild