tags 798401 + patch
thanks

On Tue, Sep 08, 2015 at 12:59:06PM -0700, Ben Longbons wrote:
> The gdb-python2 package does not actually contain a version of gdb
> linked to python2. Rather, it is a byte-for-byte identical copy of the
> /usr/bin/gdb shipped in the gdb package, which links to python3.
> 
> I noticed that gdb-python2 has "Depends: libpython3.4", I presume this
> is automatic from the list of linked shared libs.

I have verified on snapshot.debian.org that gdb-python2 has been broken
since it was introduced. Basically the python2 linked version gets built
and then ignored. There were more problems such as files missing in
gdb-python2.

I have fixed these in the attached patch and will shortly upload a NMU
with this fix to DELAYED/5-day.
>From 1e932c1100e1e5af7310f88d9399a8a1839872ea Mon Sep 17 00:00:00 2001
From: Andreas Bombe <a...@debian.org>
Date: Sat, 28 May 2016 16:50:01 +0200
Subject: [PATCH] Fix build of gdb-python2 package

Remove the installation of the python3 gdb from gdb-python2.install and
install the gdb linked against python2 in debian/rules instead. Add the
installation of gcore in gdb-python2.install.

Duplicate the section installing gdbinit in /etc and in /usr/bin
gdb-add-index and gdbtui back to the gdb post-install target and modify
the section in gdb-python2 post-install to actually install into
gdb-python2.

Don't install the testsuite logs of the python3 build into gdb-python2.

Do the installation of the run binary and man page with install instead
of mv so that the second package to be built also has them available.

Closes: #798401

Signed-off-by: Andreas Bombe <a...@debian.org>
---
 debian/gdb-python2.install |  2 +-
 debian/rules               | 36 ++++++++++++++++++++++--------------
 2 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/debian/gdb-python2.install b/debian/gdb-python2.install
index 9f20418..6747d0d 100644
--- a/debian/gdb-python2.install
+++ b/debian/gdb-python2.install
@@ -1,2 +1,2 @@
-usr/bin/gdb
+usr/bin/gcore
 usr/share/gdb
diff --git a/debian/rules b/debian/rules
index 55bb258..ebde65e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -236,9 +236,9 @@ clean::
 
 binary-post-install/gdb$(TS) ::
 	if [ -x debian/tmp/usr/bin/run ]; then				\
-		mv debian/tmp/usr/bin/run					\
+		install -m 755 debian/tmp/usr/bin/run					\
 		  debian/gdb$(TS)/usr/bin/$(DEB_TARGET_ALIAS)-run;		\
-		mv debian/tmp/usr/share/man/man1/run.1			\
+		install -m 644 debian/tmp/usr/share/man/man1/run.1			\
 		  debian/gdb$(TS)/usr/share/man/man1/$(DEB_TARGET_ALIAS)-run.1;	\
 	fi
 ifeq ($(run_tests),yes)
@@ -247,29 +247,37 @@ ifeq ($(run_tests),yes)
 		debian/gdb$(TS)/usr/share/doc/gdb/check.log
 endif
 
+ifneq ($(DEB_CROSS),yes)
+	# Only ship a global gdbinit for the native GDB.
+	install -d debian/gdb$(TS)/etc/gdb
+	install -m 644 debian/gdbinit debian/gdb$(TS)/etc/gdb/
+	# Likewise gdb-add-index
+	install -m 755 gdb/contrib/gdb-add-index.sh debian/gdb$(TS)/usr/bin/gdb-add-index
+endif
+
+	rm -f debian/gdb$(TS)/usr/bin/$(TP)gdbtui
+	install -m 755 debian/gdbtui debian/gdb$(TS)/usr/bin/$(TP)gdbtui
+
 binary-post-install/gdb-python2$(TS) ::
+	install -d debian/gdb-python24$(TS)/usr/bin
+	install -s -m 755 $(BUILDDIRPYTHON2)/gdb/gdb debian/gdb-python2$(TS)/usr/bin/gdb
 	if [ -x debian/tmp/usr/bin/run ]; then				\
-		mv debian/tmp/usr/bin/run					\
+		install -m 755 debian/tmp/usr/bin/run					\
 		  debian/gdb-python2$(TS)/usr/bin/$(DEB_TARGET_ALIAS)-run;		\
-		mv debian/tmp/usr/share/man/man1/run.1			\
+		install -m 644 debian/tmp/usr/share/man/man1/run.1			\
 		  debian/gdb-python2$(TS)/usr/share/man/man1/$(DEB_TARGET_ALIAS)-run.1;	\
 	fi
-ifeq ($(run_tests),yes)
-	install -d debian/gdb-python2$(TS)/usr/share/doc/gdb
-	install -m 644 $(DEB_BUILDDIR)/gdb/testsuite/gdb.sum \
-		debian/gdb-python2$(TS)/usr/share/doc/gdb/check.log
-endif
 
 ifneq ($(DEB_CROSS),yes)
 	# Only ship a global gdbinit for the native GDB.
-	install -d debian/gdb$(TS)/etc/gdb
-	install -m 644 debian/gdbinit debian/gdb$(TS)/etc/gdb/
+	install -d debian/gdb-python2$(TS)/etc/gdb
+	install -m 644 debian/gdbinit debian/gdb-python2$(TS)/etc/gdb/
 	# Likewise gdb-add-index
-	install -m 755 gdb/contrib/gdb-add-index.sh debian/gdb$(TS)/usr/bin/gdb-add-index
+	install -m 755 gdb/contrib/gdb-add-index.sh debian/gdb-python2$(TS)/usr/bin/gdb-add-index
 endif
 
-	rm -f debian/gdb$(TS)/usr/bin/$(TP)gdbtui
-	install -m 755 debian/gdbtui debian/gdb$(TS)/usr/bin/$(TP)gdbtui
+	rm -f debian/gdb-python2$(TS)/usr/bin/$(TP)gdbtui
+	install -m 755 debian/gdbtui debian/gdb-python2$(TS)/usr/bin/$(TP)gdbtui
 
 binary-post-install/gdb-multiarch ::
 	install -d debian/gdb-multiarch/usr/bin
-- 
2.8.1

Reply via email to