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
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
Release history Release notifications | RSS feed
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)
Built Distribution
File details
Details for the file mock_chroot-0.0.1.dev4.tar.gz
.
File metadata
- Download URL: mock_chroot-0.0.1.dev4.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 093d6542b2cc8301a78ceb471b8dd64c57c75abb5c29a2bf21e79f525caa3232 |
|
MD5 | d2a093aa5b271b4c042f51cd750e6a39 |
|
BLAKE2b-256 | d3ed13cabd835e0cdbe0dfa3619cfb81c8bbf75a6237a5b0960b9010d371eb23 |
File details
Details for the file mock_chroot-0.0.1.dev4-py2-none-any.whl
.
File metadata
- Download URL: mock_chroot-0.0.1.dev4-py2-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9123dff6000bb9ac65a45e2529d02ea584832979a2043799c9302ad6e537db41 |
|
MD5 | 875a1d11534393d71fd043506e83fb9f |
|
BLAKE2b-256 | ff403fffc03b1f83c6c3df16e871ade553c0ba9c77c981da5628e69db65b2f2e |