On Wed, 2016-10-05 at 12:17 +0200, Roger Oberholtzer wrote:
On Wed, Oct 5, 2016 at 10:53 AM, Dominique Leuenberger / DimStar
wrote: you can APPLY the patch conditionally - but please don't add it to the src.rpm conditionally.
And to do this, the Patch: directives are not conditional. So far okay.
But how to make the later %patch calls conditional without using %ifarch (which seems to be resolved when the source RPM is created)?
No; the %prep / %build / %install phases are pristine in the .spec file and are thus considered by rpmbuild; in fact, the .spec file is never modified before added to the .spec file (except the cases which Johannes listed already - but those are evil to start with) With this part of the .spec Name: FOO %ifarch x86_64 Patch0: x86_64.patch %else Patch0: i586.patch %endif [...] %prep %setup %patch0 you result in the probblem that the .src.rpm contains only ONE of the patches (depending on the arch it was built on) - but the .spec file inside the .src.rpm retains the logic to switch; result: it fails to build on the other arch for missing files
Is there is a web resource describing this? I don't mean RPM in general. But specifically how OBS is dealing with this.
OBS doesn't do anything special here - this is pure rpmbuild and users tripping over it. Cheer, Dominique