control: retitle 737520 dh-make: Update debian/rules (dh7) for dpkg (>=1.16.1)
thanks
Hi,
As I checked recent Debian packaging situation more, I realize dpkg had
a big change in 2011 with version 1.16.1. Since we have newer than this
version for all old-bpo/stable/testing/unstable, we should consider the
fact dpkg-buildpackage does not set build flags.
I overlooked this since I set compiler flags manually in debian/rules
in my packages and exported them when customizing the default
debian/rules to multi-arch+fortified build.
So the inclusion of /usr/share/dpkg/buildflags.mk (or indirectly via
/usr/share/dpkg/default.mk) is a good idea as default while setting
DPKG_EXPORT_BUILDFLAGS = 1 as described in the dpkg-buildflags manpage.
This ensures proper environment is set no matter how build is invoked
* debian/rules
* dpkg-buildpackage
* debuild
* pdebuild
* gbp buildpackage
* ...
Also the inclusion of default.mk makes it easy for developer to customize
build system for
* multi-arch (amd64, ...)
* kernel dependent (linux-any)
* distribution dependent (Debian, Ubuntu,...)
* ...
Here is the updated replacement template rules.dh7 (MIT License)
If you agree to update dh-make with this, then updating maint-guide is
much easier. As for jessie, I intend to use dh-make in the
documentation. So this is important for me.
Regards,
Osamu
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1
# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
# main packaging script based on dh7 syntax
%:
dh $@
# debmake generated override targets
# This is example for Cmake (See http://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- \
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)