Subject: Bug#613046: debian-policy: please update example in 4.9.1 (debian/rules and DEB_BUILD_OPTIONS)

From: Matthijs Kooijman <[email-masked]>
Date: Fri, 27 Jan 2012 13:28:02 +0100

Hi folks,

just stumbled upon this report, and I have a small suggestion to improve
Jonathan's patch:

> --- a/policy.sgml
> +++ b/policy.sgml
> @@ -2256,18 +2256,13 @@
>  	    massage this example in order to make it work for your
>  	    package.
>  	    <example compact="compact">
> -CFLAGS = -Wall -g
>  INSTALL = install
>  INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
>  INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
>  INSTALL_SCRIPT  = $(INSTALL) -p    -o root -g root  -m  755
>  INSTALL_DIR     = $(INSTALL) -p -d -o root -g root  -m  755
>  
> -ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
> -    CFLAGS += -O0
> -else
> -    CFLAGS += -O2
> -endif
> +CFLAGS := -Wall $(shell dpkg-buildflags --get CFLAGS)
>  ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
>      INSTALL_PROGRAM += -s
>  endif

Wouldn't it be more appropriate to use

    DEB_CFLAGS_MAINT_PREPEND := -Wall

here before calling dpkg-buildflags? Possibly the rest of the example
could be modified to use DEB_CFLAGS_MAINT_APPEND as well.

Not sure if this is really needed, but it seems to me that that is what
these variables were invented for :-)

Gr.

Matthijs