Skip to main content

Python library for using the Mock chroot-based build tool

Project description

# python-mockchroot
Python library for using Mock (the chroot-based build tool, not the mockup library)

## How do I use this?

Here is a quick example for building an EPEL7 RPM packge from a sources
dircetory and a spec file, where the build configuration comes from
Fedora Koji:

out_dir = '/tmp/results'
mock = MockChroot(config=mock_config.compose(
mock_config.from_koji(target='epel7-build', koji_profile='koji'),
mock_config.to['resultdir'].set(out_dir),
mock_config.to['root_cache_enable'].set(True),
mock_config.to['yum_cache_enable'].set(True)
))
print('Building SRPM in Mock')
mock.buildsrpm(
spec='/path/to/package.spec',
sources='/path/to/package/sources'
)
srpms = glob('{0}/*.src.rpm'.format(out_dir))
if len(srpms) == 0:
raise RuntimeError('no srpms found in {0}'.format(out_dir))
elif len(srpms) > 1:
raise RuntimeError('multiple srpms found in {0}'.format(out_dir))
else:
srpm = srpms[0]
print('Building RPM in Mock')
mock.rebuild(src_rpm=srpm, no_clean=True)

## Tell me more!

Please see the comprehensive documentation at [readthedocs][1]

[1]: http://python-mockchroot.readthedocs.org/

## How do I install this?

You can use *pip*:

pip install mock-chroot

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mock_chroot-0.0.1.dev4.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

mock_chroot-0.0.1.dev4-py2-none-any.whl (11.0 kB view details)

Uploaded Python 2

File details

Details for the file mock_chroot-0.0.1.dev4.tar.gz.

File metadata

File hashes

Hashes for mock_chroot-0.0.1.dev4.tar.gz
Algorithm Hash digest
SHA256 093d6542b2cc8301a78ceb471b8dd64c57c75abb5c29a2bf21e79f525caa3232
MD5 d2a093aa5b271b4c042f51cd750e6a39
BLAKE2b-256 d3ed13cabd835e0cdbe0dfa3619cfb81c8bbf75a6237a5b0960b9010d371eb23

See more details on using hashes here.

File details

Details for the file mock_chroot-0.0.1.dev4-py2-none-any.whl.

File metadata

File hashes

Hashes for mock_chroot-0.0.1.dev4-py2-none-any.whl
Algorithm Hash digest
SHA256 9123dff6000bb9ac65a45e2529d02ea584832979a2043799c9302ad6e537db41
MD5 875a1d11534393d71fd043506e83fb9f
BLAKE2b-256 ff403fffc03b1f83c6c3df16e871ade553c0ba9c77c981da5628e69db65b2f2e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page