pass "%global" definitions to mock?

Matthias Leopold matthias at leopold.priv.at
Mon Apr 11 08:07:19 UTC 2016



Am 2016-04-10 um 18:32 schrieb Orion Poplawski:
> On 04/10/2016 10:11 AM, Matthias Leopold wrote:
>> hi,
>>
>> i want to rebuild IUS PHP SRPMs with mock. in the spec file is a
>> "%global php_bootstrap   0" definition. how can i pass a different value
>> for "php_bootstrap" to the mock build process? i tried the following:
>>
>> mock --rebuild --define="php_bootstrap 1" php56u-5.6.20-1.ius.el7.src.rpm
>>
>> mock --rebuild --define="global php_bootstrap 1"
>> php56u-5.6.20-1.ius.el7.src.rpm
>>
>> mock --rebuild php56u-5.6.20-1.ius.el7.src.rpm -r ./test.cfg
>> test.cfg contains "config_opts['macros']['php_bootstrap'] = "1""
>>
>> mock --rebuild php56u-5.6.20-1.ius.el7.src.rpm --macro-file=my-macro.txt
>> my-macro.txt contains "%global php_bootstrap   1"
>>
>> none of these worked
>
> I don't believe you can.  You must edit the spec file.  An alternative
> method would be to do something like
>
> http://fedoraproject.org/wiki/Packaging:Guidelines#Bootstrapping
>
> which I believe allows you to pass "--with bootstrap"
>
>

ok, thanks. finally i resorted to modifying the spec file and using the 
modified srpm. for reasons unknown i thought reassembling a srpm file 
was "hard"... read "man rpmbuild" more carefully...

matthias


More information about the Rpm-list mailing list