cfg = Configuration( python_venv=Namespace( description='Generate RPMs from Python virtualenv.', cmd=StringOption( description='The executable to use for creating a venv.', default='virtualenv', ), flags=ListOption( description='Flags to pass to the venv during creation.', option=StringOption(), default=('--always-copy',), ), name=StringOption( description='The name of the installed venv.', required=True, ), path=StringOption( description='The path in which to install the venv.', default='/usr/share/python', ), python=StringOption( description='The python executable to use in the venv.', required=False, ), require_setup_py=BoolOption( description='Whether to build the rpm with the use of setup.py. ' 'When false can be used to repackage a wheel', required=False, default=True, ), requirements=ListOption( description='Names of requirements files to install in the venv.', option=StringOption(), default=('requirements.txt',) ), pip_flags=ListOption( description='Flags to pass to pip during pip install calls.', option=StringOption(), default=(), ), strip_binaries=BoolOption( description='Whether to strip native modules of debug information ' 'that often contains the buildroot paths', required=False, default=True, ) ), )
from confpy.api import BoolOption from confpy.api import Configuration from confpy.api import Namespace from confpy.api import StringOption from .. import interface cfg = Configuration(file_permissions=Namespace( description='Add default file permissions to files in buildroot.', user=StringOption( description='The owner user.', required=True, ), create_user=BoolOption( description='Create the user if it does not exist.', default=False, ), group=StringOption( description='The owner group.', required=True, ), create_group=BoolOption( description='Create the group if it does not exist.', default=False), ), ) class Extension(interface.Extension): """Extension which adds default file permissions.""" name = 'file_permissions' description = 'Set default file permissions to a user and group.'
from __future__ import print_function from __future__ import unicode_literals from confpy.api import Configuration from confpy.api import ListOption from confpy.api import Namespace from confpy.api import PatternOption from .. import interface cfg = Configuration( file_extras=Namespace( description='Add default file permissions to files in buildroot.', files=ListOption( description='Files to move as src:dest. Relative to the root.', option=PatternOption(pattern='.*:.*'), default=(), ), ), ) class Extension(interface.Extension): """Extension which adds packaging of extra files.""" name = 'file_extras' description = 'Package files not in the buildroot.' version = '1.0.0' requirements = { 'file_permissions': ('>=1.0.0', '<2.0.0'),
cfg = Configuration(python_venv=Namespace( description='Generate RPMs from Python virtualenv.', cmd=StringOption( description='The executable to use for creating a venv.', default='virtualenv', ), flags=ListOption( description='Flags to pass to the venv during creation.', option=StringOption(), default=('--always-copy', ), ), name=StringOption( description='The name of the installed venv.', required=True, ), path=StringOption( description='The path in which to install the venv.', default='/usr/share/python', ), python=StringOption( description='The python executable to use in the venv.', required=False, ), requirements=ListOption( description='Names of requirements files to install in the venv.', option=StringOption(), default=('requirements.txt', )), pip_flags=ListOption( description='Flags to pass to pip during pip install calls.', option=StringOption(), default=(), ), ), )
'prep', 'build', 'install', 'clean', 'desc', 'files', ) OPTIONS = dict((block, ListOption( description='Lines to add to %{0}.'.format(block), option=StringOption(), default=(), )) for block in BLOCKS) cfg = Configuration(blocks=Namespace( description='Add custom lines to any RPM block.', **OPTIONS), ) class Extension(interface.Extension): """Extension which adds generic block additions.""" name = 'blocks' description = 'Add custom lines to an RPM block.' version = '1.0.0' requirements = {} @staticmethod def generate(config, spec): """Produce block segments from input.""" for block in BLOCKS:
cfg = Configuration(core=Namespace( description='Common core RPM metadata fields.', name=StringOption( description='The name of the RPM file which is generated.', required=True, ), version=StringOption( description='The RPM version to build.', required=True, ), release=StringOption( description=( 'The release number for the RPM. Default is 1. ' 'Supports strings to let free usage of, for example, %{?dist}.'), default='1', ), summary=StringOption( description='The short package summary.', required=False, ), group=StringOption( description='The RPM package group in which this package belongs.', required=False, ), license=StringOption( description='The license under which the package is distributed.', required=False, ), url=StringOption( description='The URL of the package source.', required=False, ), source=StringOption( description='The path to the package source.', required=False, ), buildroot=StringOption( description='The name of the buildroot directory to use.', default=('%(mktemp -ud %{_tmppath}/%{SOURCE0}-%{version}' '-%{release}-XXXXXX)'), ), buildarch=StringOption(description='The build architecture to use.', required=False), requires=ListOption(option=StringOption(), default=(), description='Dependencies', required=False), provides=ListOption(option=StringOption(), default=(), description='Virtual package', required=False), ), )
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from confpy.api import Configuration from confpy.api import ListOption from confpy.api import Namespace from .option import FileOption from .. import interface cfg = Configuration(file_extras=Namespace( description='Package files not in the Python package.', files=ListOption( description='Extra files to include. Paths are relative to' 'buildroot.', option=FileOption(), default=(), ), ), ) class Extension(interface.Extension): """Extension which adds packaging of extra files.""" name = 'file_extras' description = 'Package files not in the buildroot.' version = '1.1.0' requirements = { 'file_permissions': ('>=1.0.0', '<2.0.0'), }
cfg = Configuration(core=Namespace( description='Common core RPM metadata fields.', name=StringOption( description='The name of the RPM file which is generated.', required=True, ), version=StringOption( description='The RPM version to build.', required=True, ), release=IntegerOption( description='The release number for the RPM. Default is 1.', default=1, ), summary=StringOption( description='The short package summary.', required=False, ), group=StringOption( description='The RPM package group in which this package belongs.', required=False, ), license=StringOption( description='The license under which the package is distributed.', required=False, ), url=StringOption( description='The URL of the package source.', required=False, ), source=StringOption( description='The path to the package source.', required=False, ), buildroot=StringOption( description='The name of the buildroot directory to use.', default=('%(mktemp -ud %{_tmppath}/%{SOURCE0}-%{version}' '-%{release}-XXXXXX)'), ), ), )
cfg = Configuration(python_centos_venv=Namespace( description='Generate RPMs from Python virtualenv.', source_venv=StringOption( description='Optional path for source virtualenv', required=False, ), cmd=StringOption( description='The executable to use for creating a venv.', default='virtualenv', ), flags=ListOption( description='Flags to pass to the venv during creation.', option=StringOption(), default=(), ), name=StringOption( description='The name of the installed venv.', required=True, ), path=StringOption( description='The path in which to install the venv.', default='/usr/share/python', ), python=StringOption( description='The python executable to use in the venv.', required=False, ), requirements=ListOption( description='Names of requirements files to install in the venv.', option=StringOption(), default=('requirements.txt', )), pip_flags=ListOption( description='Flags to pass to pip during pip install calls.', option=StringOption(), default=(), ), strip_binaries=BoolOption( description='Whether to strip native modules of debug information ' 'that often contains the buildroot paths', required=False, default=True, )), )