Esempio n. 1
0
def medium(builder, name, roles, checkout, rev=None, branch=None,
	   deps = None, dep_tag = utils.LabelTag.PreConfig,
           simpleCheckout = True, config = True, perRoleMakefiles = False,
           makefileName = DEFAULT_MAKEFILE_NAME,
           usesAutoconf = False,
           rewriteAutoconf = False,
           execRelPath = None):
    """
    Build a package controlled by make, in the given roles with the
    given dependencies in each role.

    * simpleCheckout - If True, register the checkout as simple checkout too.
    * dep_tag        - The tag to depend on being installed before you'll build.
    * perRoleMakefiles - If True, we run 'make -f Makefile.<rolename>' instead
      of just make.
    """
    if (simpleCheckout):
        simple_checkouts.relative(builder, checkout, rev=rev, branch=branch)

    if deps is None:
        deps = []

    for r in roles:
        simple(builder, name, r, checkout, config = config,
               perRoleMakefiles = perRoleMakefiles,
               makefileName = makefileName,
               usesAutoconf = usesAutoconf,
               rewriteAutoconf = rewriteAutoconf,
               execRelPath = execRelPath)
        pkg.package_depends_on_packages(builder.ruleset,
                                       name, r, dep_tag,
                                       deps)
Esempio n. 2
0
def twolevel(builder, name, roles,
             co_dir = None, co_name = None, rev=None, branch=None,
             deps = None, dep_tag = utils.LabelTag.PreConfig,
             simpleCheckout = True, config = True, perRoleMakefiles = False,
             makefileName = DEFAULT_MAKEFILE_NAME,
             repo_relative=None):
    """
    Build a package controlled by our simplified C/C++ make rules, in the given
    roles with the given dependencies in each role.

    * simpleCheckout - If True, register the checkout as simple checkout too.
    * dep_tag        - The tag to depend on being installed before you'll build.
    * perRoleMakefiles - If True, we run 'make -f Makefile.<rolename>' instead
      of just make.
    """

    if (co_name is None):
        co_name = name

    if (simpleCheckout):
        twolevel_checkouts.twolevel(builder, co_dir, co_name,
                                    repo_relative=repo_relative,
                                    rev=rev, branch=branch)

    if deps is None:
        deps = []


    for r in roles:
        simple(builder, name, r, co_name, config = config,
               perRoleMakefiles = perRoleMakefiles,
               makefileName = makefileName)
        pkg.package_depends_on_packages(builder.ruleset,
                                       name, r, dep_tag,
                                       deps)
Esempio n. 3
0
def multilevel(builder,
               name,
               roles,
               co_dir=None,
               co_name=None,
               rev=None,
               branch=None,
               deps=None,
               dep_tag=utils.LabelTag.PreConfig,
               simpleCheckout=True,
               config=True,
               perRoleMakefiles=False,
               makefileName=DEFAULT_MAKEFILE_NAME,
               repo_relative=None,
               usesAutoconf=False,
               rewriteAutoconf=False,
               execRelPath=None):
    """
    Build a package controlled by make, in the given roles with the
    given dependencies in each role.

    * simpleCheckout - If True, register the checkout as simple checkout too.
    * dep_tag        - The tag to depend on being installed before you'll build.
    * perRoleMakefiles - If True, we run 'make -f Makefile.<rolename>' instead
      of just make.
    """

    if (co_name is None):
        co_name = name

    if (simpleCheckout):
        multilevel_checkouts.relative(builder,
                                      co_dir,
                                      co_name,
                                      repo_relative=repo_relative,
                                      rev=rev,
                                      branch=branch)

    if deps is None:
        deps = []

    for r in roles:
        simple(builder,
               name,
               r,
               co_name,
               config=config,
               perRoleMakefiles=perRoleMakefiles,
               makefileName=makefileName,
               usesAutoconf=usesAutoconf,
               rewriteAutoconf=rewriteAutoconf,
               execRelPath=execRelPath)
        pkg.package_depends_on_packages(builder.ruleset, name, r, dep_tag,
                                        deps)
Esempio n. 4
0
def simple(builder,
           coName,
           name,
           roles,
           depends_on=[],
           pkgFile=None,
           debName=None,
           instrFile=None,
           postInstallMakefile=None,
           isDev=False,
           nonDevCoName=None,
           nonDevPkgFile=None):
    """
    Build a package called 'name' from co_name / pkg_file with
    an instruction file called instr_file.

    'name' is the name of the muddle package and of the debian package.
    if you want them different, set deb_name to something other than
    None.

    Set isDev to True for a dev package, False for an ordinary
    binary package. Dev packages are installed into the object
    directory where MUDDLE_INC_DIRS etc. expects to look for them.
    Actual packages are installed into the installation directory
    where they will be transported to the target system.
    """
    if (debName is None):
        debName = name

    if (pkgFile is None):
        pkgFile = debName

    for r in roles:
        if isDev:
            dep = DebDevAction(name,
                               r,
                               coName,
                               debName,
                               pkgFile,
                               instrFile,
                               postInstallMakefile,
                               nonDevCoName=nonDevCoName,
                               nonDevPkgFile=nonDevPkgFile)
        else:
            dep = DebAction(name, r, coName, debName, pkgFile, instrFile,
                            postInstallMakefile)

        pkg.add_package_rules(builder.ruleset, name, r, dep)
        # We should probably depend on the checkout .. .
        pkg.package_depends_on_checkout(builder.ruleset, name, r, coName, dep)
        # .. and some other packages. Y'know, because we can ..
        pkg.package_depends_on_packages(builder.ruleset, name, r,
                                        utils.LabelTag.PreConfig, depends_on)
Esempio n. 5
0
def simple(builder, coName, name, roles,
           depends_on = [ ],
           pkgFile = None, debName = None, instrFile = None,
           postInstallMakefile = None, isDev = False,
           nonDevCoName = None,
           nonDevPkgFile = None):
    """
    Build a package called 'name' from co_name / pkg_file with
    an instruction file called instr_file.

    'name' is the name of the muddle package and of the debian package.
    if you want them different, set deb_name to something other than
    None.

    Set isDev to True for a dev package, False for an ordinary
    binary package. Dev packages are installed into the object
    directory where MUDDLE_INC_DIRS etc. expects to look for them.
    Actual packages are installed into the installation directory
    where they will be transported to the target system.
    """
    if (debName is None):
        debName = name


    if (pkgFile is None):
        pkgFile = debName

    for r in roles:
        if isDev:
            dep = DebDevAction(name, r, coName, debName,
                               pkgFile, instrFile,
                               postInstallMakefile,
                               nonDevCoName = nonDevCoName,
                               nonDevPkgFile = nonDevPkgFile)
        else:
            dep = DebAction(name, r, coName, debName,
                            pkgFile, instrFile,
                            postInstallMakefile)

        pkg.add_package_rules(builder.ruleset, name, r, dep)
        # We should probably depend on the checkout .. .
        pkg.package_depends_on_checkout(builder.ruleset,
                                        name, r, coName, dep)
        # .. and some other packages. Y'know, because we can ..
        pkg.package_depends_on_packages(builder.ruleset,
                                        name, r, utils.LabelTag.PreConfig,
                                        depends_on)