mock icon indicating copy to clipboard operation
mock copied to clipboard

[RFE] add '--buildrpm' option

Open praiskup opened this issue 7 years ago • 8 comments

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 ..

praiskup avatar May 26 '17 08:05 praiskup

@clime FYI

praiskup avatar May 26 '17 08:05 praiskup

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 avatar Jun 06 '17 22:06 srpatcha

@srpatcha please, open another Issue with steps to reproduce and mock version.

Frodox avatar Jun 07 '17 06:06 Frodox

@srpatcha you can to add... "--resultdir=foo"

kuboosoft avatar Mar 30 '18 02:03 kuboosoft

You can close the issue, Its resolved in my repo. @Frodox @kuboosoft

srpatcha avatar Mar 30 '18 21:03 srpatcha

"--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.

nkadel avatar Dec 11 '19 05:12 nkadel

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.

praiskup avatar Aug 05 '22 15:08 praiskup

Ooohhh. I like it. It's faster than my current "build a SRPM locally to hand off'

nkadel avatar Aug 05 '22 22:08 nkadel