From 28d23060dba2d6c691cd0739e401f4fe448af97a Mon Sep 17 00:00:00 2001 From: Jiri Kastner Date: Nov 21 2017 11:39:59 +0000 Subject: added python 3 support Signed-off-by: Jiri Kastner --- diff --git a/.gitignore b/.gitignore index f12ce62..bdda66e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ python-schedutils-0.2.tar.bz2 /python-schedutils-0.4.tar.bz2 /python-schedutils-0.4.tar.xz /python-schedutils-0.5.tar.xz +/python-schedutils-0.6.tar.xz diff --git a/python-schedutils.spec b/python-schedutils.spec index d0886fd..861efe0 100644 --- a/python-schedutils.spec +++ b/python-schedutils.spec @@ -1,15 +1,23 @@ -%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} -%{!?python_ver: %define python_ver %(%{__python} -c "import sys ; print sys.version[:3]")} +%if 0%{?fedora} +%global with_python3 1 +%else +%global without_python3 1 +%endif Summary: Linux scheduler python bindings Name: python-schedutils -Version: 0.5 -Release: 5%{?dist} +Version: 0.6 +Release: 1%{?dist} License: GPLv2 URL: https://rt.wiki.kernel.org/index.php/Tuna Source: https://cdn.kernel.org/pub/software/libs/python/%{name}/%{name}-%{version}.tar.xz Group: System Environment/Libraries -BuildRequires: python-devel +BuildRequires: python2-devel + +%if 0%{?with_python3} +BuildRequires: python3-devel +%endif + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %global _description\ @@ -24,33 +32,64 @@ Summary: %summary %description -n python2-schedutils %_description +%if 0%{?with_python3} +%package -n python3-schedutils +Summary: %summary +%{?python_provide:%python_provide python3-schedutils} + +%description -n python3-schedutils %_description +%endif + %prep -%setup -q +%autosetup -p1 + + %build -%{__python} setup.py build +%py2_build +%if 0%{?with_python3} +%py3_build +%endif %install rm -rf %{buildroot} -%{__python} setup.py install --skip-build --root %{buildroot} -mkdir -p %{buildroot}%{_bindir} -cp -p pchrt.py %{buildroot}%{_bindir}/pchrt -cp -p ptaskset.py %{buildroot}%{_bindir}/ptaskset +%py2_install +%if 0%{?with_python3} +%py3_install +%endif %clean rm -rf %{buildroot} %files -n python2-schedutils %defattr(-,root,root) -%doc COPYING +%license COPYING +%{python2_sitearch}/schedutils.so +%license COPYING +%if 0%{?without_python3} %{_bindir}/pchrt %{_bindir}/ptaskset -%{python_sitearch}/schedutils.so -%if "%{python_ver}" >= "2.5" -%{python_sitearch}/*.egg-info +%{_mandir}/man1/pchrt.1* +%{_mandir}/man1/ptaskset.1* +%endif +%{python2_sitearch}/*.egg-info + +%if 0%{?with_python3} +%files -n python3-schedutils +%defattr(-,root,root) +%license COPYING +%{_bindir}/pchrt +%{_bindir}/ptaskset +%{_mandir}/man1/pchrt.1* +%{_mandir}/man1/ptaskset.1* +%{python3_sitearch}/schedutils*.so +%{python3_sitearch}/*.egg-info %endif %changelog +* Mon Nov 20 2017 Jiri Kastner - 0.6-1 +- added python 3 support + * Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 0.5-5 - Python 2 binary package renamed to python2-schedutils See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 diff --git a/sources b/sources index 38c7803..af7ffeb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (python-schedutils-0.5.tar.xz) = 3019b4524c823cf02c9476d34875802cb19c159a532aa28835ffd8eedb447085a16599d1a4592d2bdacf4465b0b2c3cdc47d9c74c71fefe22f90555eabb43926 +SHA512 (python-schedutils-0.6.tar.xz) = 1373eb0ae7594aeaf0ffa75abeb89424208531049f93d4bd068b0cedc603380c374361c87c09bb01acd6346dfe0de654a2112321f0b9110ec103d51549b8f4d2