[pkg-opensc-maint] Bug#953533: opensc: Fails to build due to missing bash_completion files

Ludovic Rousseau ludovic.rousseau at free.fr
Sat Aug 29 22:12:45 BST 2020

severity 953533 normal

On Tue, 10 Mar 2020 08:10:06 +0000 "Cirujano Cuesta, Silvano" <silvano.cirujano-cuesta at siemens.com> wrote:
> Package: opensc
> Version: 0.20.0-3
> Severity: serious
> Justification: fails to build from source (but built successfully in the past)
> Tags: ftbfs
> Trying to build fails. I've tried following two ways.
> I've tried
> 	apt-get source opensc ; debuild -b -uc -us
> and
> 	apt-get --build source opensc
> The error message is:
> 	dh_install: warning: Cannot find (any matches for) "debian/tmp/etc/bash_completion.d/*"
> (tried in ., debian/tmp)
> 	dh_install: warning: opensc missing files: debian/tmp/etc/bash_completion.d/*
> 	dh_install: error: missing files,aborting
> 	make: *** [debian/rules:4: binary] Error 25

I can reproduce your problem using "debuild" in testing.
But I can't reproduce it using "gbp buildpackage" and cowbuilder

When the package is built with debuild I have:
" OpenSC has been configured with the following options:

Bash completion:         /usr/share/bash-completion/completions
[...] "

But when the package is built with gbp (or the Debian builders) I find:
" OpenSC has been configured with the following options:

Bash completion:         /etc/bash_completion.d
[...] "

The problem is this piece of code in configure.ac:
if test "${completiondir}" = "detect"; then
	echo completion ${completiondir}
	PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
		[completiondir="`pkg-config --variable=completionsdir bash-completion`"],

If bash-completion package is installed then the scipt uses:
$ pkg-config --variable=completionsdir bash-completion
that returns:

But if bash-completion is NOT installed then
${sysconfdir}/bash_completion.d i.e. /etc/bash_completion.d is used instead.

If you remove the package bash-completion then the build will succeed.

I changed the priority of this bug since it fails to build only in some

I wanted to push my patch to https://salsa.debian.org/opensc-team/opensc
but I am not a member of the "opensc-team" group on Salsa.

My patch is attached so Eric can apply it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-Fails-to-build-due-to-missing-bash_completion-fi.patch
Type: text/x-diff
Size: 1876 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-opensc-maint/attachments/20200829/2a3c2431/attachment.patch>

More information about the pkg-opensc-maint mailing list