Package: cdbs
Version: 0.4.50
Severity: minor
Tags: patch
Dear cdbs-developers,
I have encountered a minor issue when including rules/debhelper.mk and
having the DEB_SRCDIR variable specified:
If this variable is specified and if it is not ".", cdbs will ignore
changelogs and docs in "." and only look for them in the DEB_SRCDIR
directory.
This has happened when I tried to package the xvid library found at
http://www.xvid.org/. Both the configure script and the Makefile are in
the build/generic directory whereas the ChangeLog and all the docs
(AUTHORS README TODO) can be found in the root dir of the tarball. With
the current implementation, these files are ignored and I have to either
create 'debian/*.{changelog,docs}' files or manually specify
DEB_INSTALL_CHANGELOGS_ALL and DEB_INSTALL_DOCS_ALL in debian/rules.
Please find attached a patch that I created and that changes the
behaviour as follows:
- It now looks for possible changelog files in DEB_SRCDIR and then in
".". As soon as it finds a valid candidate, it breaks the loops. This
way it is made sure, that any changelog file in the specified source
directory is prefered over another changelog file in the tarball's root
directory.
- It now looks for doc files one by one in DEB_SRCDIR and if it does not
find the specific file there, it looks in ".". This way it is made sure,
that all docs in the specified source directory are installed and that a
doc file in the root directory of the tarball is only installed, if a
file of the same name is not found in the specified source dir.
Please consider applying this patch. I am pleased to receive feedback if
the patch isn't sufficient.
Thank you very much!
Cheers,
Fabian
--
Dipl.-Phys. Fabian Greffrath
Ruhr-Universität Bochum
Lehrstuhl für Energieanlagen und Energieprozesstechnik (LEAT)
Universitätsstr. 150, IB 3/134
D-44780 Bochum
Telefon: +49 (0)234 / 32-26334
Fax: +49 (0)234 / 32-14227
E-Mail: [EMAIL PROTECTED]
--- debhelper.mk.orig 2007-11-14 09:48:56.000000000 +0100
+++ debhelper.mk 2007-11-14 10:16:07.000000000 +0100
@@ -97,8 +97,8 @@
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_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))
+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)))
cdbs_strip_quotes = $(subst ',,$(subst ",,$(1)))