Hi folks,
Big thanks for mock! I'm trying to make mock use/pass smp_mflags -j1 and --with-tests (or --with-python3, etc) but no joy. So a couple of questions:
What is the differrence between -D/--define= and --rpmbuild_opts?
How do I pass smp_mflags -j1 when an SRPM does not support parallel build?
How do I pass --with-tests (%bcond) or --with-python3 (%configure)?
Thanks!
Best, Patrick
Hi,
patrick+buildsys@laimbock.com wrote:
Hi folks,
Big thanks for mock! I'm trying to make mock use/pass smp_mflags -j1 and --with-tests (or --with-python3, etc) but no joy. So a couple of questions:
What is the differrence between -D/--define= and --rpmbuild_opts?
The `--rpmbuild-opts` option allows passing options to rpmbuild; e.g.: `--shortcircuit` or options which may not have convenient corresponding macros.
How do I pass smp_mflags -j1 when an SRPM does not support parallel build?
You should be able to pass `-D '_smp_mflags 1'` to achive that. Though it's also worth fixing the package to avoid use of `_smp_mflags` if it does not support parallel make.
How do I pass --with-tests (%bcond) or --with-python3 (%configure)?
Mock has `--with` and `--without` options which you can use just like you would with rpmbuild; i.e.: `--with tests` or `--with python3`.
If the `--with-python3` in your example is a configure option and is not supported in the spec file via a `%bcond_with(out)` option, then the previous example won't work. You'd probably need to fix the spec file in that case, as it likely needs more than just adding the configure option. It would (almost surely) need a `BuildRequires: python3-devel` and/or other python3 dependencies,
Hi Todd,
On 20-07-2020 17:02, Todd Zullinger wrote: [snip]
What is the differrence between -D/--define= and --rpmbuild_opts?
The `--rpmbuild-opts` option allows passing options to rpmbuild; e.g.: `--shortcircuit` or options which may not have convenient corresponding macros.
Got it.
How do I pass smp_mflags -j1 when an SRPM does not support parallel build?
You should be able to pass `-D '_smp_mflags 1'` to achive that. Though it's also worth fixing the package to avoid use of `_smp_mflags` if it does not support parallel make.
Got it. I agree that fixing the package is preferable but that's not in my skillset.
How do I pass --with-tests (%bcond) or --with-python3 (%configure)?
Mock has `--with` and `--without` options which you can use just like you would with rpmbuild; i.e.: `--with tests` or `--with python3`.
Got it.
If the `--with-python3` in your example is a configure option and is not supported in the spec file via a `%bcond_with(out)` option, then the previous example won't work. You'd probably need to fix the spec file in that case, as it likely needs more than just adding the configure option. It would (almost surely) need a `BuildRequires: python3-devel` and/or other python3 dependencies,
Yes that makes sense.
Thank you for your elaborate answer! All clear now.
Best, Patrick
buildsys@lists.fedoraproject.org