Add mock configuration for building against the local dnf repository
[utils/utils.git] / mock / host.cfg
1 # Mock configuration file to build against the local system's dnf repository
2 # configuration.
3 # https://mattmccutchen.net/utils/#rpm
4 #
5 # This file contains some settings tuned for building in Qubes OS template-based
6 # VMs, but you can easily change them for other environments.
7
8 config_opts['root'] = 'host'
9 # TODO: Can we detect this automatically?
10 config_opts['target_arch'] = 'x86_64'
11
12 # Try without root cache?
13 config_opts['plugin_conf']['root_cache_enable'] = False
14
15 # For now, we are sharing the host yum cache.  If we want a separate one, we
16 # can enable this plugin.
17 config_opts['plugin_conf']['yum_cache_enable'] = False
18
19 # We do not need the "bootstrap" feature since the host's RPM stack is the same
20 # as the target's.
21 config_opts['use_bootstrap'] = False
22
23 config_opts['dnf_common_opts'] = [
24
25   # Share the host dnf configuration.
26   '--config=/etc/dnf/dnf.conf',
27   '--setopt=reposdir=/etc/yum.repos.d',
28
29   # And the releasever.
30   '--releasever=/',
31
32   # And the cache.  Binding this with the bind_mount plugin does not work since
33   # it is considered a "user mount" and doesn't get mounted in time.
34   '--setopt=cachedir=/var/cache/dnf',
35
36   # qubes-hooks signals Qubes OS about changes to the real VM.  We don't want to
37   # run it for changes to a mock environment.
38   '--disableplugin=qubes-hooks',
39
40   # If we build the same package several times in a row on the same run of a VM
41   # (a common case if there is a problem on the first try), avoid downloading
42   # the build dependencies multiple times.  I think a real VM transaction could
43   # lose the packages, but that should be uncommon and not worth worrying about
44   # now.  VM restart provides a reasonable lifespan for us to clear the cache.
45   '--setopt=keepcache=1',
46
47   # Looks like we need this.  Fedora's mock configs put it in the generated
48   # dnf.conf.
49   '--assumeyes',
50 ]
51
52 # /var/cache/mock shouldn't be used for anything important right now, but if we
53 # want to make it persistent, the plan is to make it a symlink to /home/mock-cache .
54
55 # mock raises an error if this is not set.
56 config_opts['dnf.conf'] = 'THIS IS A SYNTAX ERROR; THIS FILE SHOULD NOT BE USED'