[Build-common-hackers] Bug#272758: autogenerated debian/control

Robert Millan Robert Millan <rmh@debian.org>, 272758@bugs.debian.org
Tue, 21 Sep 2004 22:24:06 +0200


This is a multi-part MIME message sent by reportbug.

--===============1756639698==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: cdbs
Version: 0.4.22-1.5
Severity: wishlist
Tags: patch

This patch allows cdbs to be smarter and add packages to the Build-Depends
line in debian/control (possibly other lines in the future too).

I implemented support to add "debhelper (>= 4.1.0)" when debhelper.mk is
included, and "bzip" or "unzip" when tarball.mk is included and the upstream
tarball is compressed with one of these.  Also, the user can customise it and
add other build-dependencies by initialising the CDBS_BUILD_DEPENDS variable.

Note:  In the patch, replace 0.4.22-2 with whatever is the first official
version of cdbs that supports this feature.

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: kfreebsd-i386 (i386)
Kernel: GNU/kFreeBSD 5.2.1-6
Locale: LANG=C, LC_CTYPE=C (ignored: LC_ALL set to C)

-- no debconf information

--===============1756639698==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="autogen.diff"

diff -ur cdbs-0.4.22.old/1/rules/buildcore.mk.in cdbs-0.4.22/1/rules/buildcore.mk.in
--- cdbs-0.4.22.old/1/rules/buildcore.mk.in	2004-02-15 07:13:30.000000000 +0100
+++ cdbs-0.4.22/1/rules/buildcore.mk.in	2004-09-21 19:40:49.000000000 +0200
@@ -100,6 +100,11 @@
 # can also hook in other stuff here.  Many of the included rules and classes
 # add stuff to this rule.
 clean:: testdir testroot cleanbuilddir
+ifneq ($(DEB_AUTO_UPDATE_DEBIAN_CONTROL),)
+	cat debian/control.in \
+	| sed "s/@cdbs@/$(CDBS_BUILD_DEPENDS)/g" \
+	> debian/control
+endif
 
 # This rule is called before the common-install target.  It's currently only
 # used by debhelper.mk, to run dh_clean -k.
diff -ur cdbs-0.4.22.old/1/rules/buildvars.mk.in cdbs-0.4.22/1/rules/buildvars.mk.in
--- cdbs-0.4.22.old/1/rules/buildvars.mk.in	2004-08-07 04:21:09.000000000 +0200
+++ cdbs-0.4.22/1/rules/buildvars.mk.in	2004-09-21 22:13:15.000000000 +0200
@@ -74,4 +74,10 @@
 	DEB_DESTDIR = $(CURDIR)/debian/tmp/
 endif
 
+ifeq ($(CDBS_BUILD_DEPENDS), )
+CDBS_BUILD_DEPENDS	= cdbs (>= 0.4.22-2)
+else
+CDBS_BUILD_DEPENDS	:= cdbs (>= 0.4.22-2), $(CDBS_BUILD_DEPENDS)
+endif
+
 endif
diff -ur cdbs-0.4.22.old/1/rules/debhelper.mk.in cdbs-0.4.22/1/rules/debhelper.mk.in
--- cdbs-0.4.22.old/1/rules/debhelper.mk.in	2004-08-27 02:48:37.000000000 +0200
+++ cdbs-0.4.22/1/rules/debhelper.mk.in	2004-09-21 20:38:41.000000000 +0200
@@ -74,6 +74,8 @@
 
 include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
 
+CDBS_BUILD_DEPENDS	:= $(CDBS_BUILD_DEPENDS), debhelper (>= 4.1.0)
+
 DH_COMPAT=4
 
 ifeq ($(DEB_VERBOSE_ALL), yes)
diff -ur cdbs-0.4.22.old/1/rules/tarball.mk.in cdbs-0.4.22/1/rules/tarball.mk.in
--- cdbs-0.4.22.old/1/rules/tarball.mk.in	2004-08-27 02:40:59.000000000 +0200
+++ cdbs-0.4.22/1/rules/tarball.mk.in	2004-09-21 20:39:12.000000000 +0200
@@ -29,6 +29,18 @@
 
 include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
 
+# The user developper may override this variable to choose which tarballs
+# to unpack.
+
+DEB_TARBALL ?= $(wildcard *.tgz *.tar.gz *.tar.bz *.tar.bz2 *.zip)
+
+ifneq (, $(findstring .bz2, $(DEB_TARBALL)))
+CDBS_BUILD_DEPENDS    := $(CDBS_BUILD_DEPENDS), bzip2
+endif
+ifneq (, $(findstring .zip, $(DEB_TARBALL)))
+CDBS_BUILD_DEPENDS    := $(CDBS_BUILD_DEPENDS), unzip
+endif
+
 ifeq ($(DEB_TAR_SRCDIR),)
 $(error You must specify DEB_TAR_SRCDIR)
 endif
@@ -38,11 +50,6 @@
 DEB_SRCDIR = $(_cdbs_tarball_dir)/$(DEB_TAR_SRCDIR)
 DEB_BUILDDIR ?= $(DEB_SRCDIR)
 
-# The user developper may override this variable to choose which tarballs
-# to unpack.
-
-DEB_TARBALL ?= $(wildcard *.tgz *.tar.gz *.tar.bz *.tar.bz2 *.zip)
-
 # This is not my finest piece of work.
 # Essentially, it's never right to unpack a tarball more than once
 # so we have to emit stamps.  The stamps then have to be the rule

--===============1756639698==--