[git-buildpackage] buildpackage-rpm fails to expand macros in setup

Quanah Gibson-Mount quanah at symas.com
Sat Jul 17 00:58:20 CEST 2021


I'm building a package that has a subpackage (for an SELinux policy 
module), so I have to play around with the version since the submodule 
version doesn't track with the application version.

%global _pvers 2.1.4

Name:	mypackage
Version: %{_pvers}
Release: 1%{?dist}

...

%package -n mypackage-selinux
Version: 1.0.0

...


%setup -qn %{name}-%{_pvers}

This causes buildpackage-rpm to throw a warning because it fails to expand 
%{_pvers} from the global section from this section of __init__.py:

                elif opts.name:
                    try:
                        prefix = self.macro_expand(opts.name) + '/'
                    except MacroExpandError as err:
                        gbp.log.warn("Couldn't determine prefix from 
%%setup "
                                     "macro (%s). Using filename base as a "
                                     "fallback" % err)
                        prefix = orig['filename_base'] + '/'


So it seems that the macro expansion isn't working right.

--Quanah


--

Quanah Gibson-Mount
Product Architect
Symas Corporation
Packaged, certified, and supported LDAP solutions powered by OpenLDAP:
<http://www.symas.com>


More information about the git-buildpackage mailing list