The problem can be reproduced by 'debuild binary-arch'
with cli-common-dev package uninstalled.
The proper fix (building arch-dependent packages only when requested),
requires complicated debian/rules (attached) with many conditionals.
This complicated script is hard to read, so I'll just move mono
dependencies to Build-Depends.
It looks like there is another way [1] to solve the bug, which utilizes
dh_listpackages:
===8===
ifeq ($(shell dh_listpackages | grep -q cil echo yes),yes)
DHWITH = --with cli
endif
%:
dh $@ $(DHWITH)
===8===
But in reality it doesn't work: when running 'debuild binary-arch' the
dh_listpackages prints all packages, including ones with
'Architecture: all'.
[1] http://mail-archive.com/debian-cli@lists.debian.org/msg00103.html
24.04.2012 7:55, Aaron M. Ucko wrote:
Source: rhash
Version: 1.2.9-1
Severity: serious
Justification: fails to build from source (but built successfully in the past)
Builds of rhash in minimal environments covering only its
architecture-dependent packages (with Build-Depends but not
necessarily Build-Depends-Indep available) are failing:
fakeroot debian/rules clean
dh clean --with=python2 --with=cli
dh: unable to load addon cli: Can't locate Debian/Debhelper/Sequence/cli.pm
in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2
/usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5
/usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at (eval
4) line 2.
BEGIN failed--compilation aborted at (eval 4) line 2.
make: *** [clean] Error 2
Please either move cli-common-dev to Build-Depends or arrange to pass
--with=cli only when it is actually safe to do so.
Thanks!
#!/usr/bin/make -f
# debian/rules makefile that uses debhelper.
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
INSTALL_PROGRAM = install -p -m 755
CFLAGS = -Wall -DUSE_GETTEXT
LIBCFLAGS =
LIBLDFLAGS =
DESTDIR = $(CURDIR)/debian/tmp
LIBRHASH_INC=-I$(DESTDIR)
LIBRHASH_LD=-Wl,--as-needed -L$(DESTDIR)
JAVADOC_API_URL=/usr/share/doc/default-jdk-doc/api
# see Debian Policy Manual - source packages
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0 -DNDEBUG
else
CFLAGS += -O2 -DNDEBUG -fomit-frame-pointer
endif
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter
parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif
# by default compile RHash with openssl runtime linking
ifeq (,$(findstring nossl,$(DEB_BUILD_OPTIONS)))
LIBCFLAGS += -DUSE_OPENSSL
ifneq (,$(findstring ssldynamic,$(DEB_BUILD_OPTIONS)))
LIBLDFLAGS += -lcrypto
else
LIBCFLAGS += -DOPENSSL_RUNTIME -rdynamic
LIBLDFLAGS += -ldl
endif
endif
# using debhelper = 8 to build the package
# we use this intricate logic to allow 'debuild binary-indep' without mono
packages installed
build:
BUILDARCH=all dh $@ --with=python2 --with=cli
binary:
BUILDARCH=all dh $@ --with=python2 --with=cli
binary-arch:
BUILDARCH=arch dh $@
# only arch-independent packages really need python2 and cli
binary-indep:
BUILDARCH=indep dh $@ --with=python2 --with=cli
%:
BUILDARCH=indep dh $@
# bindings to provide
ifeq ($(BUILDARCH),all)
BINDINGS = java mono perl python ruby
else ifeq ($(BUILDARCH),arch)
BINDINGS = java perl ruby
else
BINDINGS = java mono python
endif
ifneq ($(LD_LIBRARY_PATH),)
LD_LIB=$(DESTDIR):$(LD_LIBRARY_PATH)
else
LD_LIB=$(DESTDIR)
endif
override_dh_auto_build:
# Compile the package.
$(MAKE) lib-static lib-shared LIBCFLAGS=$(CFLAGS) $(LIBCFLAGS)
LIBLDFLAGS=$(LIBLDFLAGS)
ifneq ($(BUILDARCH),indep)
$(MAKE) rhash-shared CFLAGS=$(CFLAGS) SHARED_TRG=rhash
endif
# prepare local librhash include/lib directories
mkdir -p $(DESTDIR) ln -fs $(CURDIR)/librhash $(DESTDIR)/rhash
ln -fs $(CURDIR)/librhash/librhash.so.0 $(DESTDIR)/ ln -fs
$(DESTDIR)/librhash.so.0 $(DESTDIR)/librhash.so
# Compile language bindings.
$(MAKE) -C bindings configure build
JAVADOC_API_URL=$(JAVADOC_API_URL) \
LIBRHASH_INC=$(LIBRHASH_INC) LIBRHASH_LD=$(LIBRHASH_LD)
BINDINGS=$(BINDINGS)
ifneq ($(BUILDARCH),indep)
chrpath -d bindings/perl/blib/arch/auto/Rhash/Rhash.so
endif
override_dh_auto_test:
ifneq ($(BUILDARCH),indep)
$(MAKE) test-lib test-shared CFLAGS=$(CFLAGS) \
LIBLDFLAGS=$(LIBLDFLAGS) SHARED_TRG=rhash
endif
$(MAKE) -C bindings test LD_LIBRARY_PATH=$(LD_LIB)
BINDINGS=$(BINDINGS)
override_dh_auto_install:
ifneq ($(BUILDARCH),indep)
# Install the program and its translation strings
$(MAKE) PREFIX=/usr