[Build-common-hackers] Bug#627968: cdbs ignores DEB_*PACKAGES variables set in debian/rules

Regid Ichira regid23 at yahoo.com
Wed May 25 22:06:10 UTC 2011


Package:  cdbs
Version:  0.4.93
Severity: normal

      This report is about the failaure of cdbs to honor the
    DEB_*PACKAGES variables.

      The failure is demonstrated with the nut package. nut is an
    official debain package.  Its current debian version is 2.6.0-2.
    I copied here the maintainers debian/rules file because the
    demonstration of the bug uses patches to this file.

$ cat nut-2.6.0/debian/rules
#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)


DEB_CONFIGURE_EXTRA_FLAGS := --prefix=/usr \
                             --exec-prefix=/ \
                             --sysconfdir=/etc/nut \
                             --mandir=/usr/share/man \
                             --libdir=/lib \
                             --includedir=/usr/include \
                             --without-ssl \
                             --with-hal \
                             --with-cgi \
                             --with-dev \
                             --enable-static \
                             --with-statepath=/var/run/nut \
                             --with-altpidpath=/var/run/nut \
                             --with-drvpath=/lib/nut \
                             --with-cgipath=/usr/lib/cgi-bin/nut \
                             --with-htmlpath=/usr/share/nut/www \
                             --with-pidpath=/var/run/nut \
                             --datadir=/usr/share/nut \
                             --with-pkgconfig-dir=/usr/lib/pkgconfig \
                             --with-user=nut --with-group=nut

ifeq (linux,$(DEB_HOST_ARCH_OS))
  DEB_CONFIGURE_EXTRA_FLAGS+=--with-udev-dir=/lib/udev
endif

common-install-arch::
        # install the bash completion script
        mkdir -p $(CURDIR)/debian/tmp/etc/bash_completion.d
        cp $(CURDIR)/scripts/misc/nut.bash_completion \
                $(CURDIR)/debian/tmp/etc/bash_completion.d/nut

        # install the default configuration
        for f in $(CURDIR)/debian/tmp/etc/nut/*; do           \
                nf=`basename $${f} | sed 's/\(.*\).sample/\1/'`;  \
                mv $${f} $(CURDIR)/debian/tmp/etc/nut/$${nf};  \
        done

DEB_DH_INSTALLINIT_ARGS_nut := -- start 50 2 3 4 5 . stop 50 0 1 6 .

ifeq (linux,$(DEB_HOST_ARCH_OS))
# for Debian
  DEB_DH_GENCONTROL_ARGS := -- -Vudev="udev (>= 0.124-1)"
# for Ubuntu
# DEB_DH_GENCONTROL_ARGS := -- -Vudev="udev (>= 136-1)"
endif
$

    The nut source package build 8 binary debs:

$ grep ^Package: nut-2.6.0/debian/control
Package: nut
Package: nut-cgi
Package: nut-snmp
Package: nut-hal-drivers
Package: nut-xml
Package: nut-powerman-pdu
Package: libupsclient1
Package: libupsclient1-dev
$

      Each one is Architecture: any.  From which, I tried to build,
    using cdbs DEB_*PACKAGES variables, only 2 binary debs.  Namely,
    libupsclient1 and nut.

      I patched the debian/rules with the following patch:

--- nut-2.6.0/debian/rules.orig 2011-05-08 22:34:54.000000000 +0300
+++ nut-2.6.0/debian/rules       2011-05-25 02:20:37.000000000 +0300
@@ -1,11 +1,19 @@
 #!/usr/bin/make -f

+# Most nut binary packages are not required locally.
+DEB_ALL_PACKAGES := libupsclient1 nut
+DEB_ARCH_PACKAGES := libupsclient1 nut
+DEB_INDEP_PACKAGES :=
+DEB_PACKAGES := libupsclient1 nut
+DEB_ARCH_REGULAR_PACKAGES := libupsclient1 nut
+DEB_INDEP_REGULAR_PACKAGES :=
+DEB_VERBOSE_ALL := 1
+
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/autotools.mk

 DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)

-
 DEB_CONFIGURE_EXTRA_FLAGS := --prefix=/usr \
                             --exec-prefix=/ \
                             --sysconfdir=/etc/nut \


    and, while building, got this failure:

make: *** No rule to make target `binary-post-install/nut-cgi', \
  needed by `common-binary-post-install-arch'.  Stop.
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit \
  status 2

    How can it be?

$ grep common-binary-post-install-arch cdbs-0.4.93/1/rules/debhelper.mk.in
common-binary-post-install-arch:: $(patsubst 
%,binary-post-install/%,$(DEB_ARCH_PACKAGES))
$(patsubst %,binary-strip/%,$(DEB_ARCH_PACKAGES)) :: binary-strip/%: 
common-binary-post-install-arch binary-strip-IMPL/%
common-binary-post-install:: common-binary-post-install-arch 
common-binary-post-install-indep
$

    It looks as if cdbs considers DEB_ARCH_PACKAGES to contains nut-cgi.
    Didn't I explicitly set it to exclude it?

    In addition, a dedicated directory was created under debian for
    each package.  By that I mean that the 8 dedicated directories,
    namely debian/nut, debian/nut-cgi, debian/nut-snmp, thtough
    debian/libupsclient1 and debian/libupsclient1-dev were created.
    Didn't cdbs was supposed to fully ignore 6 out of 8 binary packages?
    Why debain/nut-cgi and the other 5 directories got created?





More information about the Build-common-hackers mailing list