[python-ptrace] 0.6.4

terjeros terjeros at fedoraproject.org
Wed Dec 5 18:55:04 UTC 2012


commit d0315154b40d8ad6250d8ea81cd1e1252f51cfd0
Author: Terje Røsten <terje.rosten at ntnu.no>
Date:   Wed Dec 5 19:54:59 2012 +0100

    0.6.4
    
    - Add python 3 subpackage

 .gitignore         |    1 +
 python-ptrace.spec |   92 +++++++++++++++++++++++++++++++++++++++++++--------
 sources            |    2 +-
 3 files changed, 79 insertions(+), 16 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index f18583e..452cc35 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 python-ptrace-0.6.2.tar.gz
 /python-ptrace-0.6.3.tar.gz
+/python-ptrace-0.6.4.tar.gz
diff --git a/python-ptrace.spec b/python-ptrace.spec
index 9555b88..1fd6d8a 100644
--- a/python-ptrace.spec
+++ b/python-ptrace.spec
@@ -1,23 +1,42 @@
-%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%{!?python_sitelib_arch: %global python_sitelib_arch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
-
-%{!?pyver: %global pyver %(%{__python} -c "import sys ; print sys.version[:3]")}
+%global with_python3 1
 
 Summary:       Debugger using ptrace written in Python
 Name:          python-ptrace
-Version:       0.6.3
-Release:       2%{?dist}
+Version:       0.6.4
+Release:       1%{?dist}
 License:       GPLv2
 Group:         Development/Tools
 URL:           https://bitbucket.org/haypo/python-ptrace
 Source0:       http://pypi.python.org/packages/source/p/python-ptrace/%{name}-%{version}.tar.gz
 BuildRequires: python-devel
 BuildRequires: python-setuptools-devel
+%if 0%{?with_python3}
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+%endif
 
 %description
 python-ptrace is a debugger using ptrace written in Python.
-Fearures:
+Features:
+ o High level Python object API : PtraceDebugger and PtraceProcess
+ o Able to control multiple processes: catch fork events on Linux
+ o Read/write bytes to arbitrary address: take care of memory alignment
+   and split bytes to cpu word
+ o Execution step by step using ptrace_singlestep() 
+   or hardware interruption 3
+ o Dump registers, memory mappings, stack, etc.
+ o Syscall tracer and parser (strace.py command) 
+ o Can use distorm disassembler (if available)
+
+%if 0%{?with_python3}
+%package -n    python3-ptrace
+Summary:       Debugger using ptrace written in Python 3
+Group:         Development/Tools
+
+%description -n python3-ptrace
+python-ptrace is a debugger using ptrace written in Python.
+Features:
  o High level Python object API : PtraceDebugger and PtraceProcess
  o Able to control multiple processes: catch fork events on Linux
  o Read/write bytes to arbitrary address: take care of memory alignment
@@ -28,18 +47,44 @@ Fearures:
  o Syscall tracer and parser (strace.py command) 
  o Can use distorm disassembler (if available)
 
+This is the Python 3 version of python-ptrace.
+
+%endif # if with_python3
+
 %prep
 %setup -q
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif
 
 %build
 %{__python} setup.py build
 %{__python} setup_cptrace.py build
+%if 0%{?with_python3}
+pushd %{py3dir}
+2to3 --write --nobackups .
+%{__python3} setup.py build
+%{__python3} setup_cptrace.py build
+popd
+mv %{py3dir}/examples examples-py3
+%endif
 
 %install
 %{__rm} -rf %{buildroot}
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+%{__python3} setup_cptrace.py install -O1 --skip-build --root %{buildroot}
+for f in gdb strace ; do
+    %{__rm} -f %{buildroot}%{_bindir}/$f.{pyo,pyc}
+    mv %{buildroot}%{_bindir}/$f.py  %{buildroot}%{_bindir}/$f-python3.py 
+done
+popd
+%endif
+
 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
 %{__python} setup_cptrace.py install -O1 --skip-build --root %{buildroot}
-
 %{__chmod} 0644  examples/*.py
 %{__rm} -f %{buildroot}%{_bindir}/{gdb,strace}.{pyo,pyc}
 
@@ -49,22 +94,39 @@ Fearures:
 %check
 %{__python} ./test_doc.py
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} ./test_doc.py
+%endif
+
 %files
 %defattr(-, root, root, -)
 %doc AUTHORS ChangeLog COPYING README README.cptrace TODO
 %doc doc/* examples
-%if 0%{?fedora} < 11
-%exclude %{_bindir}/gdb.py[co]
-%exclude %{_bindir}/strace.py[co]
-%endif
 %{_bindir}/gdb.py
 %{_bindir}/strace.py
 %{python_sitelib}/ptrace/
-%{python_sitelib}/python_ptrace-*-py%{pyver}.egg-info
-%{python_sitelib_arch}/cptrace.so
-%{python_sitelib_arch}/cptrace-*-py%{pyver}.egg-info
+%{python_sitelib}/python_ptrace-*-py*.egg-info
+%{python_sitearch}/cptrace.so
+%{python_sitearch}/cptrace-*-py*.egg-info
+
+%if 0%{?with_python3}
+%files -n python3-ptrace
+%doc AUTHORS ChangeLog COPYING README README.cptrace TODO
+%doc doc/* examples-py3
+%{_bindir}/gdb-python3.py
+%{_bindir}/strace-python3.py
+%{python3_sitelib}/ptrace/
+%{python3_sitelib}/python_ptrace-*-py*.egg-info
+%{python3_sitearch}/cptrace.cpython-*.so
+%{python3_sitearch}/cptrace-*-py*.egg-info
+%endif
 
 %changelog
+* Wed Dec 05 2012 Terje Rosten <terje.rosten at ntnu.no> - 0.6.4-1
+- 0.6.4
+- Add python 3 subpackage
+
 * Sat Jul 21 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.6.3-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 
diff --git a/sources b/sources
index dae2d6f..2bc37c2 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-55b710e5c2a86862a092b2d0de9f7c59  python-ptrace-0.6.3.tar.gz
+d02900a25ceae695134a3ad4ec4c10d9  python-ptrace-0.6.4.tar.gz


More information about the scm-commits mailing list