Community Services

Version: 24.03 LTS SP2

Overview

This feature allows users to modify, customize, and iterate build files of software packages to manage macro definition differences between build files of different versions and packages.

Installation and Uninstallation

Installation

shell
pip install merge_configs-0.0.6-py3-none-any.whl

Uninstallation

shell
pip uninstall merge-configs

Usage

Command Options

shell
merge-configs --help
-p PACKAGES, --packages PACKAGES: Specifies the software packages to be merged. Separate multiple software packages by spaces.
-The c CONFIG_FILE, --config_file CONFIG_FILE: Sets the hierarchical root directory file config.yaml.
-o OUTPUT, --output OUTPUT: Sets the output file path.
-d --debug: Indicates whether to set the log mode to debug.
-l LIST_FEATURES, --list-features LIST_FEATURES: If not empty, displays the user configuration information and sets the software packages in the value of -p. Use commas (,) to separate multiple software packages.
-a TARGET_ARCH, --arch TARGET_ARCH: Sets the target architecture for merge, for example, x86_64 or aarch64.

Frequently used command:

shell
merge-configs -p \${package} -c \${config_path}/config.yaml -o \${output_path} -a \${target_arch_name} -l \${package}

The common YAML structure is as follows:

After the conversion:

Software Package Tailoring

The software package compilation information is stored separately in a hierarchical architecture, including the main YAML configuration, files.yaml file configuration, compilation execution script, runtime execution script, and changelog. The customized content in each file is parsed and converted by merge-configs and takes effect during compilation.

Parameter Customization

  1. Parameter name customization: The parameter name can be modified. Generally, change only the source and patch numbers. A random parameter name may conflict with the SPEC file syntax.

  2. Parameter value customization: The customization scope of parameter values is large. You can modify the content as required. However, do not change the value type. For example, if the value type is changed from string to list, conversion errors may occur.

Patch number and value modification:

After the conversion:

Conditional Customization

Add when conditions to the keys at the YAML configuration layer to add conditional customization.

text
Source:
    0: http://ftp.gnu.org/gnu/libtool/libtool-%{version}.tar.xz
source when arch in aarch64:
    100: libtool-aarch-%{version}.tar.xz

There are three customization modes:

  1. Architecture customization

    text
    buildRequires:
        - "gcc"
    buildRequires when arch in x86_64:
        - "gcc-c++"
    buildRequires when arch not in x86_64:
        - "gzip"
  2. Flag customization:

    The defineFlags field will be converted to bcond_with or bcond_without.

    text
    defineFlags:
        +auto_compile: ""
    patchset when +auto_compile:
        1001: libtool-0.0.1-auto_compile.patch
  3. Macro customization:

    %%{rpmGlobal.} indicates the macro defined in the package information, and %%%{rpmGlobal.} indicates the macro defined in the RPM system.

    text
    rpmGloal:
        posttest: 0
    source when %%{rpmGlobal.posttest}:
        1: posttest.sh
    source when %%%{rpmGlobal._debugsource_packages}:
        2: openEuler_setup.py

After customization:

After customization and conversion:

Conversion

Currently, EulerMaker supports only conversion YAML to SPEC and supports only RPM package build using rpmbuild.