From 567c4cb1c3170e7fddc6bd1650d67d98d1c68d96 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Oct 18 2017 15:20:09 +0000 Subject: Modernize the specfile - Remove code for old unsupported EL/Fedora versions - Use standard macros for calling Python's setup.py - Remove BuildRoot declaration --- diff --git a/python-urwid.spec b/python-urwid.spec index d02e258..565defd 100644 --- a/python-urwid.spec +++ b/python-urwid.spec @@ -2,11 +2,6 @@ %global with_python3 1 %endif -%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} -%endif - Name: python-urwid Version: 1.3.0 Release: 11%{?dist} @@ -23,12 +18,11 @@ Source0: http://excess.org/urwid/urwid-%{version}.tar.gz Patch0: py2-skip-tests-interrupted-syscall.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) BuildRequires: python2-devel -BuildRequires: python-setuptools -BuildRequires: python-twisted-core +BuildRequires: python2-setuptools +BuildRequires: python2-twisted BuildRequires: pygobject2 -BuildRequires: python-test +BuildRequires: python2-test # needed by selftest suite for test.support %if 0%{?with_python3} @@ -83,11 +77,11 @@ cp -a . %{py3dir} %endif # with_python3 %build -CFLAGS="%{optflags}" %{__python} setup.py build +%py2_build %if 0%{?with_python3} pushd %{py3dir} -%{__python3} setup.py build +%py3_build popd %endif # with_python3 @@ -98,14 +92,14 @@ rm -rf %{buildroot} %if 0%{?with_python3} pushd %{py3dir} -%{__python3} setup.py install --skip-build --root %{buildroot} +%py3_install popd %endif # with_python3 -%{__python} setup.py install --skip-build --no-compile --root %{buildroot} +%py2_install %check -python setup.py test +%{__python2} setup.py test %if 0%{?with_python3} pushd %{py3dir}