added python 3 support

Signed-off-by: Jiri Kastner <jkastner@redhat.com>
This commit is contained in:
Jiri Kastner 2017-11-21 12:39:59 +01:00
parent 1b1c55aa1e
commit 28d23060db
3 changed files with 56 additions and 16 deletions

1
.gitignore vendored
View File

@ -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

View File

@ -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 <jkastner@redhat.com> - 0.6-1
- added python 3 support
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.5-5
- Python 2 binary package renamed to python2-schedutils
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

View File

@ -1 +1 @@
SHA512 (python-schedutils-0.5.tar.xz) = 3019b4524c823cf02c9476d34875802cb19c159a532aa28835ffd8eedb447085a16599d1a4592d2bdacf4465b0b2c3cdc47d9c74c71fefe22f90555eabb43926
SHA512 (python-schedutils-0.6.tar.xz) = 1373eb0ae7594aeaf0ffa75abeb89424208531049f93d4bd068b0cedc603380c374361c87c09bb01acd6346dfe0de654a2112321f0b9110ec103d51549b8f4d2