Some time ago my package linuxinfo aquired a bug (#1047898) whereas
dpkg-buildpackage ; dpkg-buildpackage -S
does not work. And if fact, it does not.
The reporter informed me that this is a potential violation of Debian
Policy section 4.9 (clean target), but that this was under discussion
at the time of the reporting.
I first checked (my) upstream build system. Except for one stamp file
(which is *much* less than done by debhelper) the build is idempotent,
i.e.:
./configure && make && make clean
returns the sources into the state as shipped.
In the past I had an explicit debian/rules, but to ensure compliance
with the ever evolving Debian Policy I made it on purpose very simple:
include /usr/share/dpkg/architecture.mk
ifeq ($(DEB_HOST_ARCH),amd64)
confflags += --with-pcre
else ifeq ($(DEB_HOST_ARCH),i386)
confflags += --with-pcre
else ifeq ($(DEB_HOST_ARCH),x32)
confflags += --with-pcre
endif
%:
dh $@
override_dh_auto_configure:
dh_auto_configure -- $(confflags)
As you can see, I only add (architecture dependend) configuration flags
for linking with pcre.
dh seems to delete quite a few files shipped in the package.
For me, this is a clear bug in dh, as linuxinfo just uses it plain and
there is no "manipulation" of build files happening (on purpose).
I checked dh_clean(1) and dh(1), but could not find any mention of how
to modify this (which I would not have expected anyhow).
If the severity of 1047898 is changed, then I will change this one (as
it is the root cause). In linuxinfo I probably could work around this,
by backing up all affected files before clean and restoring them after
clean (using an override). But this is a band aid, not a solution.