aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Kastner <jkastner@redhat.com>2017-11-21 10:03:36 +0100
committerJiri Kastner <jkastner@redhat.com>2017-11-21 10:03:36 +0100
commit058f374c7335268c9f06558c1da2f64699b5531a (patch)
tree5d20d264fc20d57f2db93b0493f3dbee8621eef1
parentde63bbfda036018ed01c5ade588ad90fdc10c618 (diff)
downloadpython-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-xpchrt (renamed from pchrt.py)0
-rwxr-xr-xptaskset (renamed from ptaskset.py)0
-rw-r--r--rpm/SPECS/python-schedutils.spec81
-rw-r--r--setup.py2
4 files changed, 63 insertions, 20 deletions
diff --git a/pchrt.py b/pchrt
index ddb1265..ddb1265 100755
--- a/pchrt.py
+++ b/pchrt
diff --git a/ptaskset.py b/ptaskset
index 56fe7af..56fe7af 100755
--- a/ptaskset.py
+++ b/ptaskset
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
diff --git a/setup.py b/setup.py
index e3018d2..f94af10 100644
--- a/setup.py
+++ b/setup.py
@@ -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])