mock
mock copied to clipboard
[RFE] add '--buildrpm' option
Similarly to --buildsrpm
, it would be nice if we could be able to build RPMs from source directory and spec file:
mock -r <CHROOT> --buildrpm --spec spec --sources src
Motivation:
In koji
we build SRPM only once (done by --buildsrpm
), and then we rebuild that SRPM in all chroots/architectures (done by mock --rebuild
).
In Copr though, we need to build the SRPM
for each chroot. The irony is that theoretically we actually don't need SRPM -- it would be completely enough to just (a) clone the dist-git directory, (b) download sources from lookaside cache and (c) submit mock ... --buildrpm --spec * --sources .
.
@clime FYI
mock <CHROOT> is using default path /var/lib/mock/<CONFIG>/root/ But i tired using my own folder /source/user/mock/ --rootdir=/source/user/mock creating this location still creating duplicate in default location /var/lib/mock/<CONFIG>/root/ Could you guide the best way to only use /source/user/mock/* instead of /var/lib/mock/*
@srpatcha please, open another Issue with steps to reproduce and mock version.
@srpatcha you can to add...
"--resultdir=foo"
You can close the issue, Its resolved in my repo. @Frodox @kuboosoft
"--resultdir" still requires an SRPM to work from. You can build one locally with "rpmbuild", which is what I personally do for speed's sake rather than building and copying one out from a mock generated location. But it seems an unnecessary step.
He, mock --rebuild --sources DIR --spec spec
actually works exactly the way I wanted; thank you Maxwell G for the hint (on Fedora Nest 2022, Rust workshop).
I think that we should though better document this in the manual page.
Ooohhh. I like it. It's faster than my current "build a SRPM locally to hand off'