Bug 1323073

Summary: libguestfs-1.33.16-2.fc25 FTBFS: libguestfs-1.33.16.tar.gz.sig: No such file or directory
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: mbooth, ptoscano, rjones, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-01 08:54:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Petr Pisar 2016-04-01 08:03:48 UTC
libguestfs-1.33.16-2.fc25 fails to build because it's not possible to create source package:

Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86
_64 --nodeps /builddir/build/SPECS/libguestfs.spec'] with env {'CCACHE_DIR': '/t
mp/ccache', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'CCACHE_UMASK': '002', 'LANG': 'en_US.UTF-8', 'PROMPT_COMMAND': 'printf "\x1b]0;<mock-chroot>\x07<mock-chroot>"', 'TERM': 'vt100', 'SHELL': '/bin/bash'} and shell False
error: Bad file: /builddir/build/SOURCES/libguestfs-1.33.16.tar.gz.sig: No such file or directory
Building target platforms: x86_64
Building for target x86_64
RPM build errors:
    Bad file: /builddir/build/SOURCES/libguestfs-1.33.16.tar.gz.sig: No such file or directory

The reason is the libguestfs-1.33.16.tar.gz.sig (and other files guarded by %{verify_tarball_signature} condition) are not tracked by git, neither by sources file.

The real bug is inhibiting verify_tarball_signature definition:

# Verify tarball signature with GPGv2 (only possible for stable branches).
#%global verify_tarball_signature 1

This spec code defines the macro because macros are evaluated even in comments. You have to escape the "%" character:

# Verify tarball signature with GPGv2 (only possible for stable branches).
#%%global verify_tarball_signature 1

Comment 1 Richard W.M. Jones 2016-04-01 08:54:09 UTC
Bleah RPM ...

Anyway, I found that using #%%... doesn't work, because you get:

error: parse error in expression
error: /home/rjones/d/fedora/libguestfs/master/libguestfs.spec:29: bad %if condition
error: query of specfile /home/rjones/d/fedora/libguestfs/master/libguestfs.spec failed, can't parse

So I did this instead which appears to work:

http://pkgs.fedoraproject.org/cgit/rpms/libguestfs.git/commit/?id=c4612fc7f6e04d5cd50a455075529d3328358518

Comment 2 Petr Pisar 2016-04-01 09:15:00 UTC
That's because you use the macro unconditionally. Rewriting

%if 0%{verify_tarball_signature}

to 

%if 0%{?verify_tarball_signature}

would be another solution.

But thanks for the quick fix.