Package: cdbs Version: 0.4.90 Severity: wishlist Tags: patch
Attached patch adds support for dh_python2 via "python2" keyword in DEB_PYTHON_SYSTEM
diff -ruN cdbs-0.4.89/1/class/python-module.mk.in cdbs-0.4.90_dh_python2/1/class/python-module.mk.in --- cdbs-0.4.89/1/class/python-module.mk.in 2010-05-22 22:52:01.000000000 +0200 +++ cdbs-0.4.90_dh_python2/1/class/python-module.mk.in 2010-11-23 20:35:54.234843557 +0100 @@ -32,6 +32,10 @@ CDBS_BUILD_DEPENDS_class_python-module_pycentral ?= python-central CDBS_BUILD_DEPENDS += $(if $(cdbs_python_pycentral),$(comma) $(CDBS_BUILD_DEPENDS_class_python-module_pycentral)) +# dh_python2 comes from python package +CDBS_BUILD_DEPENDS_class_python-module_python2 ?= python +CDBS_BUILD_DEPENDS += $(if $(cdbs_python_2),$(comma) $(CDBS_BUILD_DEPENDS_class_python-module_python2)) + # Optionally use debhelper (if not then these rules are simply ignored) $(patsubst %,binary-post-install/%,$(DEB_PACKAGES)) :: binary-post-install/%: binary-install-python/% $(patsubst %,binary-install-python/%,$(DEB_PACKAGES)) :: binary-install-python/%: binary-install/% diff -ruN cdbs-0.4.89/1/class/python-vars.mk.in cdbs-0.4.90_dh_python2/1/class/python-vars.mk.in --- cdbs-0.4.89/1/class/python-vars.mk.in 2010-06-21 15:13:35.000000000 +0200 +++ cdbs-0.4.90_dh_python2/1/class/python-vars.mk.in 2010-11-23 20:36:22.806844426 +0100 @@ -50,7 +50,8 @@ # TODO: expand recursively (drop colon) when no longer used for rules expansion cdbs_python_pysupport := $(filter pysupport,$(DEB_PYTHON_SYSTEM)) cdbs_python_pycentral := $(filter pycentral,$(DEB_PYTHON_SYSTEM)) -cdbs_python_system = $(or $(cdbs_python_pysupport),$(cdbs_python_pycentral),$(error unsupported Python system: $(DEB_PYTHON_SYSTEM) (select either pysupport or pycentral))) +cdbs_python_2 := $(filter python2,$(DEB_PYTHON_SYSTEM)) +cdbs_python_system = $(or $(cdbs_python_2),$(cdbs_python_pysupport),$(cdbs_python_pycentral),$(error unsupported Python system: $(DEB_PYTHON_SYSTEM) (select either python2, pysupport or pycentral))) cdbs_python_pycompat_default_pysupport = 2 cdbs_python_pycompat_default_pycentral = 2 diff -ruN cdbs-0.4.89/debian/changelog cdbs-0.4.90_dh_python2/debian/changelog --- cdbs-0.4.89/debian/changelog 2010-09-16 11:11:03.000000000 +0200 +++ cdbs-0.4.90_dh_python2/debian/changelog 2010-11-23 20:36:55.674843156 +0100 @@ -1,3 +1,10 @@ +cdbs (0.4.90) UNRELEASED; urgency=low + + * DEB_PYTHON_SYSTEM now accepts "python2" keyword which will invoke + dh_python2; tests/distutils-9.sh added + + -- Piotr Ożarowski <pi...@debian.org> Sat, 20 Nov 2010 22:04:42 +0100 + cdbs (0.4.89) unstable; urgency=low * Stop conflicting against ancient/bogus build-common. diff -ruN cdbs-0.4.89/test/distutils-9.sh cdbs-0.4.90_dh_python2/test/distutils-9.sh --- cdbs-0.4.89/test/distutils-9.sh 1970-01-01 01:00:00.000000000 +0100 +++ cdbs-0.4.90_dh_python2/test/distutils-9.sh 2010-11-14 14:53:28.000000000 +0100 @@ -0,0 +1,59 @@ +#!/bin/bash +# -*- mode: sh; coding: utf-8 -*- +# Copyright © 2006 Peter Eisentraut <pet...@debian.org> +# Copyright © 2009 Jonas Smedegaard <d...@jones.dk> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Test distutils arch package + extra package + tarball w/ dh_python2 + +. testsuite_functions + +options $@ +setup_workdir + +cat <<EOF >$WORKDIR/debian/rules +#!/usr/bin/make -f +DEB_TAR_SRCDIR=distutils-test-0.1 +DEB_PYTHON_SYSTEM = python2 +DEB_PYTHON_MODULE_PACKAGES = python-cdbs-testsuite +include debian/testsuite.mk +include \$(_cdbs_package_root_dir)/1/rules/tarball.mk.in +include \$(_cdbs_package_root_dir)/1/rules/debhelper.mk.in +include \$(_cdbs_package_root_dir)/1/class/python-distutils.mk.in +DEB_PYTHON_DESTDIR = \$(CURDIR)/debian/\$(cdbs_curpkg) +EOF +chmod +x $WORKDIR/debian/rules + +cat >>$WORKDIR/debian/control <<EOF + +Package: python-cdbs-testsuite +Architecture: any +Description: common build system test suite + This package is part of the testsuite for the CDBS build system. If you've + managed to install this, something has gone horribly wrong. +EOF + +# Make sure tarball is in place for this test. +test_tarballs +cp tarballs/distutils-test-0.1.tar.gz $WORKDIR + +build_package + +dpkg -c $WORKDIR/../python-cdbs-testsuite_0.1_*.deb \ + | grep -q '/usr/share/pyshared/testing/foo.py' \ + || return_fail + +clean_workdir +return_pass diff -ruN cdbs-0.4.89/test/Makefile.am cdbs-0.4.90_dh_python2/test/Makefile.am --- cdbs-0.4.89/test/Makefile.am 2010-05-22 22:52:01.000000000 +0200 +++ cdbs-0.4.90_dh_python2/test/Makefile.am 2010-11-23 20:37:15.462842716 +0100 @@ -46,6 +46,7 @@ distutils-6.sh \ distutils-7.sh \ distutils-8.sh \ + distutils-9.sh \ ant-1.sh TARBALLS = tarballs/autotools-test-0.1.tar.gz \ diff -ruN cdbs-0.4.89/test/Makefile.in cdbs-0.4.90_dh_python2/test/Makefile.in --- cdbs-0.4.89/test/Makefile.in 2010-05-22 22:52:01.000000000 +0200 +++ cdbs-0.4.90_dh_python2/test/Makefile.in 2010-11-23 20:37:31.102842845 +0100 @@ -148,6 +148,7 @@ distutils-6.sh \ distutils-7.sh \ distutils-8.sh \ + distutils-9.sh \ ant-1.sh TARBALLS = tarballs/autotools-test-0.1.tar.gz \