Package: cdbs
Version: 0.4.50
Severity: minor
Tags: patch

While packaging libvncserver, I ran into the problem of the upstream source 
having multiple different changelogs for several components.  While most of 
the packages use the changelog specified in the default 
DEB_INSTALL_CHANGELOGS_ALL (which is ChangeLog), for some packages I define 
DEB_INSTALL_CHANGELOGS_foo = foo/ChangeLog.  However, the resulting 
package "foo" does not seem to respect DEB_INSTALL_CHANGELOGS_foo and 
contains changelog from DEB_INSTALL_CHANGELOGS_ALL.

Attached is a patch against rules/debhelper.mk that makes it install 
DEB_INSTALL_CHANGELOGS_foo for packages that define it, and 
DEB_INSTALL_CHANGELOGS_ALL for the rest.  The patch also makes it not assign 
the default changelog files to DEB_INSTALL_CHANGELOGS_ALL if it was already 
defined in debian/rules.

To make your lives easier, I've also included a version of the patch that 
doesn't conflict with the patch from #451226.

--- System information. ---
Architecture: i386
Kernel:       Linux 2.6.22-2-k7

Debian Release: lenny/sid
  800 testing         security.debian.org 
  800 testing         ftp.us.debian.org 
  700 unstable        ftp.us.debian.org 

--- Package information. ---
Depends         (Version) | Installed
=========================-+-============
debhelper     (>= 5.0.30) | 5.0.60

--- debhelper.mk.orig	2007-11-16 02:48:07.987481414 -0500
+++ debhelper.mk	2007-11-16 02:53:30.497892025 -0500
@@ -97,7 +97,7 @@
 is_debug_package=$(if $(patsubst %-dbg,,$(cdbs_curpkg)),,yes)
 
 DEB_INSTALL_DIRS_ALL =
-DEB_INSTALL_CHANGELOGS_ALL = $(if $(DEB_ISNATIVE),,$(shell for f in ChangeLog Changelog Changes CHANGES changelog; do if test -s $(DEB_SRCDIR)/$$f; then echo $(DEB_SRCDIR)/$$f; break; fi; done))
+DEB_INSTALL_CHANGELOGS_ALL ?= $(if $(DEB_ISNATIVE),,$(shell for f in ChangeLog Changelog Changes CHANGES changelog; do if test -s $(DEB_SRCDIR)/$$f; then echo $(DEB_SRCDIR)/$$f; break; fi; done))
 DEB_INSTALL_DOCS_ALL = $(filter-out $(DEB_INSTALL_CHANGELOGS_ALL),$(shell for f in README NEWS TODO BUGS AUTHORS THANKS; do if test -s $(DEB_SRCDIR)/$$f; then echo $(DEB_SRCDIR)/$$f; fi; done))
 
 cdbs_add_dashx = $(foreach i,$(1),$(patsubst %,-X %,$(i)))
@@ -168,7 +168,11 @@
 	dh_installlogrotate -p$(cdbs_curpkg) $(DEB_DH_INSTALLLOGROTATE_ARGS)
 	dh_installlogcheck -p$(cdbs_curpkg) $(DEB_DH_INSTALLLOGCHECK_ARGS)
 	dh_installmime -p$(cdbs_curpkg) $(DEB_DH_INSTALLMIME_ARGS)
-	dh_installchangelogs -p$(cdbs_curpkg) $(DEB_DH_INSTALLCHANGELOGS_ARGS) $(DEB_INSTALL_CHANGELOGS_ALL) $(DEB_INSTALL_CHANGELOGS_$(cdbs_curpkg))
+	ifdef DEB_INSTALL_CHANGELOGS_$(cdbs_curpkg)
+	dh_installchangelogs -p$(cdbs_curpkg) $(DEB_DH_INSTALLCHANGELOGS_ARGS) $(DEB_INSTALL_CHANGELOGS_$(cdbs_curpkg))
+	else
+	dh_installchangelogs -p$(cdbs_curpkg) $(DEB_DH_INSTALLCHANGELOGS_ARGS) $(DEB_INSTALL_CHANGELOGS_ALL)
+	endif
 	$(if $(wildcard /usr/bin/dh_installudev),dh_installudev -p$(cdbs_curpkg) $(DEB_DH_INSTALLUDEV_ARGS))
 	dh_install -p$(cdbs_curpkg) $(if $(DEB_DH_INSTALL_SOURCEDIR),--sourcedir=$(DEB_DH_INSTALL_SOURCEDIR)) $(DEB_DH_INSTALL_ARGS)
 	dh_link -p$(cdbs_curpkg) $(DEB_DH_LINK_ARGS) $(DEB_DH_LINK_$(cdbs_curpkg))
--- debhelper.mk.orig	2007-11-16 02:57:09.504961000 -0500
+++ debhelper.mk	2007-11-16 02:59:36.509707794 -0500
@@ -97,7 +97,7 @@
 is_debug_package=$(if $(patsubst %-dbg,,$(cdbs_curpkg)),,yes)
 
 DEB_INSTALL_DIRS_ALL =
-DEB_INSTALL_CHANGELOGS_ALL = $(if $(DEB_ISNATIVE),,$(shell for d in $(DEB_SRCDIR) .; do for f in ChangeLog Changelog Changes CHANGES changelog; do if test -s $$d/$$f; then echo $$d/$$f; break 2; fi; done; done))
+DEB_INSTALL_CHANGELOGS_ALL ?= $(if $(DEB_ISNATIVE),,$(shell for d in $(DEB_SRCDIR) .; do for f in ChangeLog Changelog Changes CHANGES changelog; do if test -s $$d/$$f; then echo $$d/$$f; break 2; fi; done; done))
 DEB_INSTALL_DOCS_ALL = $(filter-out $(DEB_INSTALL_CHANGELOGS_ALL),$(shell for f in README NEWS TODO BUGS AUTHORS THANKS; do if test -s $(DEB_SRCDIR)/$$f; then echo $(DEB_SRCDIR)/$$f; elif test -s ./$$f; then echo ./$$f; fi; done))
 
 cdbs_add_dashx = $(foreach i,$(1),$(patsubst %,-X %,$(i)))
@@ -168,7 +168,11 @@
 	dh_installlogrotate -p$(cdbs_curpkg) $(DEB_DH_INSTALLLOGROTATE_ARGS)
 	dh_installlogcheck -p$(cdbs_curpkg) $(DEB_DH_INSTALLLOGCHECK_ARGS)
 	dh_installmime -p$(cdbs_curpkg) $(DEB_DH_INSTALLMIME_ARGS)
-	dh_installchangelogs -p$(cdbs_curpkg) $(DEB_DH_INSTALLCHANGELOGS_ARGS) $(DEB_INSTALL_CHANGELOGS_ALL) $(DEB_INSTALL_CHANGELOGS_$(cdbs_curpkg))
+	ifdef DEB_INSTALL_CHANGELOGS_$(cdbs_curpkg)
+	dh_installchangelogs -p$(cdbs_curpkg) $(DEB_DH_INSTALLCHANGELOGS_ARGS) $(DEB_INSTALL_CHANGELOGS_$(cdbs_curpkg))
+	else
+	dh_installchangelogs -p$(cdbs_curpkg) $(DEB_DH_INSTALLCHANGELOGS_ARGS) $(DEB_INSTALL_CHANGELOGS_ALL)
+	endif
 	$(if $(wildcard /usr/bin/dh_installudev),dh_installudev -p$(cdbs_curpkg) $(DEB_DH_INSTALLUDEV_ARGS))
 	dh_install -p$(cdbs_curpkg) $(if $(DEB_DH_INSTALL_SOURCEDIR),--sourcedir=$(DEB_DH_INSTALL_SOURCEDIR)) $(DEB_DH_INSTALL_ARGS)
 	dh_link -p$(cdbs_curpkg) $(DEB_DH_LINK_ARGS) $(DEB_DH_LINK_$(cdbs_curpkg))

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to