Using mock

Issues related to applications and software problems
Post Reply
MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Using mock

Post by MartinR » 2017/09/21 15:47:00

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.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Using mock

Post by TrevorH » 2017/09/21 18:40:37

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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: Using mock

Post by MartinR » 2017/09/22 08:36:04

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.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Using mock

Post by TrevorH » 2017/09/22 11:30:00

You mean copy the centos* mock profile files in /etc/mock/? I think that would work.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: Using mock

Post by MartinR » 2017/09/22 12:23:39

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.

Post Reply