%global with_python3 1 Summary: Debugger using ptrace written in Python Name: python-ptrace Version: 0.6.4 Release: 2%{?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 Patch0: python-ptrace-0.6.4-py3.3.patch BuildRequires: python-devel BuildRequires: python-tools 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. 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 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) This is the Python 3 version of python-ptrace. %endif # if with_python3 %prep %setup -q %patch0 -p1 %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} %clean %{__rm} -rf %{buildroot} %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 %{_bindir}/gdb.py %{_bindir}/strace.py %{python_sitelib}/ptrace/ %{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@ntnu.no> - 0.6.4-2 - Add patch to build with Python 3.3 * Wed Dec 05 2012 Terje Rosten <terje.rosten@ntnu.no> - 0.6.4-1 - 0.6.4 - Add python 3 subpackage * Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Wed Feb 01 2012 Terje Rosten <terje.rosten@ntnu.no> - 0.6.3-1 - 0.6.3 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Fri Feb 11 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.2-2 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild * Sat Dec 05 2009 Terje Rosten <terje.rosten@ntnu.no> - 0.6.2-1 - 0.6.2 * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Sun Mar 8 2009 Terje Rosten <terje.rosten@ntnu.no> - 0.6-4 - Build with all rpm versions * Sun Mar 8 2009 Terje Rosten <terje.rosten@ntnu.no> - 0.6-3 - Remove %%exclude * Thu Mar 5 2009 Terje Rosten <terje.rosten@ntnu.no> - 0.6-2 - switch to %%global, fix files listing, remove comments * Wed Mar 4 2009 Terje Rosten <terje.rosten@ntnu.no> - 0.6-1 - 0.6 * Sat Sep 13 2008 Terje Rosten <terje.rosten@ntnu.no> - 0.5-1 - 0.5