diff options
author | Jiri Kastner <jkastner@redhat.com> | 2017-11-21 10:03:36 +0100 |
---|---|---|
committer | Jiri Kastner <jkastner@redhat.com> | 2017-11-21 10:03:36 +0100 |
commit | 058f374c7335268c9f06558c1da2f64699b5531a (patch) | |
tree | 5d20d264fc20d57f2db93b0493f3dbee8621eef1 | |
parent | de63bbfda036018ed01c5ade588ad90fdc10c618 (diff) | |
download | python-schedutils-058f374c7335268c9f06558c1da2f64699b5531a.tar.gz |
setup.py: added data_dirs and scripts
added data_dirs and scripts with pchrt and ptaskset
and corresponding man pages
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
-rwxr-xr-x | pchrt (renamed from pchrt.py) | 0 | ||||
-rwxr-xr-x | ptaskset (renamed from ptaskset.py) | 0 | ||||
-rw-r--r-- | rpm/SPECS/python-schedutils.spec | 81 | ||||
-rw-r--r-- | setup.py | 2 |
4 files changed, 63 insertions, 20 deletions
diff --git a/rpm/SPECS/python-schedutils.spec b/rpm/SPECS/python-schedutils.spec index 3a5f21c..9d7f361 100644 --- a/rpm/SPECS/python-schedutils.spec +++ b/rpm/SPECS/python-schedutils.spec @@ -1,5 +1,8 @@ -%{!?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 @@ -9,43 +12,81 @@ 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) -%description +%global _description\ Python interface for the Linux scheduler sched_{get,set}{affinity,scheduler} functions and friends. +%description %_description + +%package -n python2-schedutils +Summary: %summary +%{?python_provide:%python_provide python2-schedutils} + +%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 -mkdir -p %{buildroot}%{_mandir}/man1 -gzip -c pchrt.1 > %{buildroot}%{_mandir}/man1/pchrt.1.gz -gzip -c ptaskset.1 > %{buildroot}%{_mandir}/man1/ptaskset.1.gz +%py2_install +%if 0%{?with_python3} +%py3_install +%endif %clean rm -rf %{buildroot} -%files +%files -n python2-schedutils +%defattr(-,root,root) +%license COPYING +%{python2_sitearch}/schedutils.so +%license COPYING +%if 0%{?without_python3} +%{_bindir}/pchrt +%{_bindir}/ptaskset +%{_mandir}/man1/pchrt.1* +%{_mandir}/man1/ptaskset.1* +%endif +%{python2_sitearch}/*.egg-info + +%if 0%{?with_python3} +%files -n python3-schedutils %defattr(-,root,root) -%doc COPYING README +%license COPYING %{_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* +%{python3_sitearch}/schedutils*.so +%{python3_sitearch}/*.egg-info %endif -%{_mandir}/man1/pchrt.1.gz -%{_mandir}/man1/ptaskset.1.gz + + %changelog * Thu Dec 22 2016 Jiri Kastner <jkastner@redhat.com> - 0.5-1 @@ -12,4 +12,6 @@ setup(name='schedutils', author='Arnaldo Carvalho de Melo', author_email='acme@redhat.com', url='http://fedoraproject.org/wiki/python-schedutils', + scripts=['pchrt', 'ptaskset'], + data_files=[('share/man/man1', ['pchrt.1','ptaskset.1'])], ext_modules=[schedutils]) |