Package: newt
Version: 0.52.10-3
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: origin-ubuntu karmic ubuntu-patch


The attached patch adds a python-newt-dbg package that is helpful 
together with python debug interprete (python-dbg)

It also uses DH_PYCENTAL=include-links instead of nomove (that has about 
the same effect but uses less space in the package).

We thought you might be interested in doing the same. 

Cheers,
 Michael

-- System Information:
Debian Release: squeeze/sid
  APT prefers karmic-security
  APT policy: (500, 'karmic-security'), (500, 'karmic'), (300, 
'karmic-security'), (300, 'karmic')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.28-11-generic (SMP w/2 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -u newt-0.52.10/debian/rules newt-0.52.10/debian/rules
--- newt-0.52.10/debian/rules
+++ newt-0.52.10/debian/rules
@@ -29,6 +29,7 @@
 PIC_PKG=libnewt-pic
 TCL_PKG=newt-tcl
 PYTHON_PKG=python-newt
+PYTHON_DBG_PKG=python-newt-dbg
 WHIPTAIL_PKG=whiptail
 
 # the dbs rules
@@ -44,7 +45,7 @@
 
 # get the items created here.
 binarytarget=binary-devel binary-shared binary-runtime binary-tcl \
-	binary-python binary-pic 
+	binary-python binary-python-dbg binary-pic
 
 #target specific configurations come here:
 LIBCDEV=libc-dev
@@ -101,14 +102,14 @@
 	dh_testroot
 	dh_clean 
 	rm -rf $(SOURCE_DIR) $(STAMP_DIR)
-	rm -f debian/python-newt.dirs debian/python-newt.install debian/python-newt.postinst
+	rm -f debian/python-newt*.dirs debian/python-newt*.install debian/python-newt.postinst
 	# rm -rf   debian/substvars debian/*.bak debian/*~ *~ 
 
 binary: binary-indep binary-arch
 
 binary-indep:
 
-binary-arch: $(LIB_PKG) $(DEV_PKG) $(PIC_PKG) $(TCL_PKG) $(PYTHON_PKG) $(WHIPTAIL_PKG)
+binary-arch: $(LIB_PKG) $(DEV_PKG) $(PIC_PKG) $(TCL_PKG) $(PYTHON_PKG) $(PYTHON_DBG_PKG) $(WHIPTAIL_PKG)
 
 $(LIB_PKG): build
 	dh_testdir
@@ -200,16 +201,17 @@
 	dh_testdir
 	dh_testroot 
 	for v in $(PYVERS); do \
-		echo usr/lib/python$$v/site-packages >> debian/[email protected]; \
-		echo python$$v/_snackmodule.so usr/lib/python$$v/site-packages \
+		pylib=$$(python$$v -c 'from distutils import sysconfig; print sysconfig.get_python_lib()'); \
+		echo $$pylib >> debian/[email protected]; \
+		echo python$$v/_snackmodule.so $$pylib/ \
 		>> debian/[email protected]; \
-		echo snack.py usr/lib/python$$v/site-packages \
+		echo snack.py $$pylib/ \
 		>> debian/[email protected]; \
 	done
 	dh_installdirs -p $@ 
 	dh_install -p $@ --sourcedir=$(BUILD_TREE)
-	dh_strip -p $@
-	DH_PYCENTRAL=nomove dh_pycentral -p $@
+	dh_strip -p $@ --dbg-package python-newt-dbg
+	DH_PYCENTRAL=include-links dh_pycentral -p $@
 	dh_installdocs -p $@ $(BUILD_TREE)/newt.spec
 	# Currently disabled, as debian-test has been removed.
 	# chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh
@@ -223,6 +225,28 @@
 	dh_md5sums -p $@
 	dh_builddeb -p $@
 
+$(PYTHON_DBG_PKG): build $(PYTHON_PKG)
+	dh_testdir
+	dh_testroot 
+	for v in $(PYVERS); do \
+		pylib=$$(python$$v -c 'from distutils import sysconfig; print sysconfig.get_python_lib()'); \
+		echo $$pylib >> debian/[email protected]; \
+		echo python$$v/_snackmodule_d.so $$pylib/ \
+		>> debian/[email protected]; \
+	done
+	dh_installdirs -p $@ 
+	dh_install -p $@ --sourcedir=$(BUILD_TREE)
+	DH_PYCENTRAL=include-links dh_pycentral -p $@
+	mkdir -p debian/python-newt-dbg/usr/share/doc
+	ln -sf python-newt debian/python-newt-dbg/usr/share/doc/python-newt-dbg
+	dh_compress -p $@
+	dh_shlibdeps -p $@ -ldebian/$@/usr/lib
+	dh_fixperms -p $@
+	dh_installdeb -p $@
+	dh_gencontrol -p $@ 
+	dh_md5sums -p $@
+	dh_builddeb -p $@
+
 $(WHIPTAIL_PKG): build
 	dh_testdir
 	dh_testroot 
diff -u newt-0.52.10/debian/changelog newt-0.52.10/debian/changelog
diff -u newt-0.52.10/debian/control newt-0.52.10/debian/control
--- newt-0.52.10/debian/control
+++ newt-0.52.10/debian/control
@@ -6,7 +6,7 @@
 Homepage: https://fedorahosted.org/newt/
 Vcs-Git: git://git.fedorahosted.org/git/newt
 XS-Python-Version: all
-Build-Depends: dbs, sgmltools-lite, libslang2-dev  (>=2.0.4-2), libpopt-dev, debhelper (>=5.0.37.2), gettext, libfribidi-dev, tcl8.5-dev, python-all-dev (>= 2.3.5-7), python-central (>= 0.5), autoconf
+Build-Depends: dbs, sgmltools-lite, libslang2-dev  (>=2.0.4-2), libpopt-dev, debhelper (>=5.0.37.2), gettext, libfribidi-dev, tcl8.5-dev, python-all-dev (>= 2.3.5-7), python-all-dbg, python-central (>= 0.5), autoconf
 
 Package: libnewt-dev
 Architecture: any
@@ -52,6 +52,17 @@
  This module allows you to built a text UI for your Python scripts
  using newt.
 
+Package: python-newt-dbg
+Architecture: any
+Section: python
+Priority: extra
+Depends: libnewt0.52 (=${Source-Version}), python-newt (=${Source-Version}), python-dbg
+Description: A NEWT module for Python (debug extension)
+ This module allows you to built a text UI for your Python scripts
+ using newt.
+ .
+ This package contains the extension built for the python debug interpreter.
+
 Package: libnewt0.52
 Architecture: any
 Section: libs
only in patch2:
unchanged:
--- newt-0.52.10.orig/debian/patches/360_python-dbg.patch
+++ newt-0.52.10/debian/patches/360_python-dbg.patch
@@ -0,0 +1,20 @@
+diff -ruN newt-0.52.10-old/Makefile.in newt-0.52.10/Makefile.in
+--- newt-0.52.10-old/Makefile.in	2009-04-30 14:37:20.000000000 +0200
++++ newt-0.52.10/Makefile.in	2009-04-30 14:39:08.000000000 +0200
+@@ -72,6 +72,8 @@
+ 	    	mkdir -p $$ver ;\
+ 	        $(CC) $(CFLAGS) -I/usr/include/$$ver $(SHCFLAGS) -c -o $$ver/snackmodule.o snackmodule.c ;\
+ 		$(CC) --shared $(SHCFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L .  -lnewt ;\
++	        $(CC) $(subst -O2,-O0,$(CFLAGS)) -I/usr/include/$${ver}_d -fPIC -c -o $$ver/snackmodule_d.o snackmodule.c ;\
++		$(CC) --shared $(SHCFLAGS) -o $$ver/_snackmodule_d.so $$ver/snackmodule_d.o -L .  -lnewt  ;\
+ 	done
+ 	touch $@
+ 
+@@ -130,6 +132,7 @@
+ 	for ver in $(PYTHONVERS) ; do \
+ 	   [ -d $(instroot)/$(libdir)/$$ver/site-packages ] || install -m 755 -d $(instroot)/$(libdir)/$$ver/site-packages ;\
+ 	   install -m 755 $$ver/_snackmodule.so $(instroot)/$(libdir)/$$ver/site-packages ;\
++	   install -m 755 $$ver/_snackmodule_d.so $(instroot)/$(libdir)/$$ver/site-packages ;\
+ 	   install -m 644 snack.py $(instroot)/$(libdir)/$$ver/site-packages ;\
+ 	done
+ 

Reply via email to