rpms/python3/devel .cvsignore, 1.2, 1.3 python3.spec, 1.10, 1.11 sources, 1.2, 1.3

dmalcolm dmalcolm at fedoraproject.org
Mon Feb 8 20:41:07 UTC 2010


Author: dmalcolm

Update of /cvs/pkgs/rpms/python3/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv21400

Modified Files:
	.cvsignore python3.spec sources 
Log Message:
* Mon Feb  8 2010 David Malcolm <dmalcolm at redhat.com> - 3.1.1-23
- add gdb hooks for easier debugging (Source 4)



Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/python3/devel/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- .cvsignore	13 Jan 2010 21:25:18 -0000	1.2
+++ .cvsignore	8 Feb 2010 20:41:07 -0000	1.3
@@ -1 +1,2 @@
 Python-3.1.1.tar.bz2
+libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz


Index: python3.spec
===================================================================
RCS file: /cvs/pkgs/rpms/python3/devel/python3.spec,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -p -r1.10 -r1.11
--- python3.spec	28 Jan 2010 19:56:39 -0000	1.10
+++ python3.spec	8 Feb 2010 20:41:07 -0000	1.11
@@ -2,6 +2,8 @@
 %global pylibdir %{_libdir}/python%{pybasever}
 %global dynload_dir %{pylibdir}/lib-dynload
 
+%global with_gdb_hooks 1
+
 # We want to byte-compile the .py files within the packages using the new
 # python3 binary.
 # 
@@ -25,7 +27,7 @@
 Summary: Version 3 of the Python programming language aka Python 3000
 Name: python3
 Version: %{pybasever}.1
-Release: 22%{?dist}
+Release: 23%{?dist}
 License: Python
 Group: Development/Languages
 Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
@@ -45,6 +47,26 @@ Source2: macros.python3
 # with different Python runtimes as necessary:
 Source3: macros.pybytecompile
 
+# We install a collection of hooks for gdb that make it easier to debug
+# executables linked against libpython (such as /usr/lib/python itself)
+#
+# These hooks are implemented in Python itself
+#
+# We'll install them into the same path as the library, with a -gdb.py suffix
+# e.g.
+#  /usr/lib/libpython3.1.so.1.0-gdb.py
+#
+# It would be better to put them in the -debuginfo subpackage e.g. here:
+#  /usr/lib/debug/usr/lib/libpython3.1.so.1.0.debug-gdb.py
+# but unfortunately it's hard to add custom content to a debuginfo subpackage
+#
+# See https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
+# information
+#
+# Downloaded from:
+# http://fedorapeople.org/gitweb?p=dmalcolm/public_git/libpython.git;a=snapshot;h=36a517ef7848cbd0b3dcc7371f32e47ac4c87eba;sf=tgz
+Source4: libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz
+
 Patch0: python-3.1.1-config.patch
 
 
@@ -165,6 +187,12 @@ python 3 code that uses more than just u
 %setup -q -n Python-%{version}
 chmod +x %{SOURCE1}
 
+# Unpack source archive 4 into this same dir without deleting (-D; -T suppress
+# trying to unpack source 0 again):
+%if 0%{?with_gdb_hooks}
+%setup -q -n Python-%{version} -T -D -a 4
+%endif # with_gdb_hooks
+
 # Ensure that we're using the system copy of various libraries, rather than
 # copies shipped by upstream in the tarball:
 #   Remove embedded copy of expat:
@@ -347,6 +375,22 @@ ldd $RPM_BUILD_ROOT/%{dynload_dir}/_curs
     | grep curses \
     | grep libncurses.so && (echo "_curses.so linked against libncurses.so" ; exit 1)
 
+# Copy up the gdb hooks into place; the python file will be autoloaded by gdb
+# when visiting libpython.so, provided that the python file is installed to the
+# same path as the library (or its .debug file) plus a "-gdb.py" suffix, e.g:
+#  /usr/lib/libpython3.1.so.1.0-gdb.py
+#
+# Long term, this should probably go in the debuginfo subpackage, e.g:
+#  /usr/lib/debug/usr/lib/libpython3.1.so.1.0.debug-gdb.py
+#
+# We use a for loop here to avoid having the RHS of the cp command be quoted,
+# leading to a filename with a "*" character embedded in it
+%if 0%{?with_gdb_hooks}
+for lib in %{buildroot}%{_libdir}/libpython%{pybasever}.so.* ; do
+    cp libpython/libpython.py ${lib}-gdb.py
+done
+%endif # with_gdb_hooks
+
 %check
 # Run the upstream test suite, using the "runtests.sh" harness from the upstream
 # tarball.
@@ -533,6 +577,9 @@ rm -fr $RPM_BUILD_ROOT
 %files libs
 %defattr(-,root,root,-)
 %{_libdir}/libpython%{pybasever}.so.*
+%if 0%{?with_gdb_hooks}
+%{_libdir}/libpython%{pybasever}.so.*-gdb.py*
+%endif # with_gdb_hooks
 
 %files devel
 %defattr(-,root,root)
@@ -581,6 +628,9 @@ rm -fr $RPM_BUILD_ROOT
 %{pylibdir}/tkinter/test
 
 %changelog
+* Mon Feb  8 2010 David Malcolm <dmalcolm at redhat.com> - 3.1.1-23
+- add gdb hooks for easier debugging (Source 4)
+
 * Thu Jan 28 2010 David Malcolm <dmalcolm at redhat.com> - 3.1.1-22
 - update python-3.1.1-config.patch to remove downstream customization of build
 of pyexpat and elementtree modules


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/python3/devel/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- sources	13 Jan 2010 21:25:18 -0000	1.2
+++ sources	8 Feb 2010 20:41:07 -0000	1.3
@@ -1 +1,2 @@
 d1ddd9f16e3c6a51c7208f33518cd674  Python-3.1.1.tar.bz2
+e9b2198d72a406698c8de07467654204  libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz



More information about the scm-commits mailing list