I found this quite useful since I’ve been doing some more mock builds lately:

This will speed up mock builds on your multi-core system. Basically mock uses tar and gzip to create a cache of the buildroot contents before building so that it doesn’t need to install a fresh buildroot every time you do a mock build. Unfortunately gzip can only use one core of your multi-core processor at a time. pigz is a mutli-threaded implementation of gzip that is fully compatible. You can tell mock to use pgiz instead of gzip.

As root do:

  1. yum install pigz
  2. open /etc/mock/site-defaults.cfg in your favorite editor
  3. find the line
    # config_opts['plugin_conf']['root_cache_opts']['compress_program'] = “gzip”
    In my cfg is is at lines 65.
  4. Uncomment that line and edit it to say pigz instead of gzip
  5. You’re all set.