Page 1 of 1

Using mock

Posted: 2017/09/21 15:47:00
by MartinR
I have to build a package from a tarball which needs to end up as an RPM for installation on multipl headless compute nodes. I have been attempting to use mock but am frustrated by the lack of basic documentation. After a couple of days trying to determine why mock was crashing complaining that it couldn't find useradd (and noting the absence of the usr directory in the root), I realised that the Fedora packages had the line

Code: Select all

config_opts['chroot_setup_cmd'] = 'install @buildsys_build'
whereas the custom packages had

Code: Select all

config_opts['chroot_setup_cmd'] = ''
. Obvious when you know but as helpful as turning on the lights for a blind man until then.

Now I'm chasing around for exactly what to load as the initial basics. @buildsys_build as a group does not appear to exist in CentOS. Specifying basesystem still doesn't do enough. I am pulling my hair out trying to get either install @Buildsystem building group or else groupinstall Buildsystem building group to work.

Can anyone help with the appropriate line please? Alternatively is there any decent documentation for a first time mock builder? Thanks.

Re: Using mock

Posted: 2017/09/21 18:40:37
by TrevorH
I'd uninstall the PoS that EPEL considers production ready and install the copy of mock from CentOS extras instead. The EPEL maintainer has no interest in making it work correctly on EL and it regularly breaks. CentOS itself is built using the copy from extras. Either exclude it from EPEL or adjust your priorities to prefer extras over EPEL.

Re: Using mock

Posted: 2017/09/22 08:36:04
by MartinR
Thanks, that looks much better. Of course I was building on a C6 machine and it is not in updates! I'll try on a C7 machine using centos-6-x86_64. BTW, if I were to copy the centos* packages from the C7 machine to the C6 one would that still work? Not a biggie if it wouldn't.

Re: Using mock

Posted: 2017/09/22 11:30:00
by TrevorH
You mean copy the centos* mock profile files in /etc/mock/? I think that would work.

Re: Using mock

Posted: 2017/09/22 12:23:39
by MartinR
Yes, that's just what I did mean. I'll give it a go and report back. It means that I get builds off my private workstation into the official build area.