Rate This Document
Findability
Accuracy
Completeness
Readability

Software Package Rebuild

The tool analyzes the composition of a software package to be ported, and rebuilds a package that is compatible with the Kunpeng platform. This function is available only on the Kunpeng platform.

Prerequisites

  • You have logged in to the Kunpeng DevKit.
  • RPM packages can be executed only on a RHEL-like system. System components rpmrebuild, rpmbuild, and rpm2cpio are required for the rebuild.

    To install rpmrebuild, download and upload the rpmrebuild component to the server, and run the following command to install it:

    1
    rpm -ivh xxx.rpm
    

    To install rpmbuild, run the following commands to check for the rpmbuild package in the yum source and install rpmbuild:

    1
    2
    yum list | grep rpm-build
    yum install -y rpm-build
    

    If the yum source does not contain the rpmbuild RPM package, download the corresponding component, upload it to the server, and run the following command to install it:

    1
    rpm -ivh xxx.rpm
    
  • DEB packages can be executed only on a Debian-like system, and system components ar and dpkg-deb are required for the rebuild.
  • If an RPM or DEB package contains a JAR or EAR package, or a JAR or EAR package needs to be rebuilt, check whether JAR commands are available. If the JAR commands do not exist, install the JDK tool.
  • The Arm and AArch64 paths and dependency libraries have been added for the tool. If the path to the dependency library in the JAR and EAR packages contains architecture-related keywords, check whether the path in the source code is correct.

Procedure

  1. On the left pane of the page, choose Software Package Rebuild and click to create a task.

    The page shown in Figure 1 is displayed.

    /opt is the default installation directory of the tool. The following uses this directory as an example. Replace it with the actual directory.

    Figure 1 Software Package Rebuild
  2. Specify Package path. Use either of the following methods:
    • Click Upload to upload the software package.
      • RPM, DEB, JAR, and EAR packages can be rebuilt.
      • Only one software package can be uploaded at a time. The size of the software package must be less than the upper limit (1024 MB by default).
      • Before manually uploading a software package, check whether the target directory exists. If it does not exist, create such a directory and grant the read, write, and execute permissions to the devkit user.
    • Manually upload the software package to the specified path (for example, /opt/DevKit/workspace/devadmin/porting/packagerebuild/) on the server. Grant the read, write, and execute permissions to the devkit user. Then, click the text box to select the software package from the drop-down list. You can also manually enter the software package name.
  3. Configure dependency files.

    Only some JAR files can be automatically downloaded to the /opt/DevKit/workspace/xx/porting/data directory (xx indicates the user name). You need to manually upload other dependencies required for rebuilding the software package.

    You can upload dependency files using the following ways:

    • Click Upload and drag the dependency files to the upload box, and click Upload.
    • Choose Upload > Add File, select one or more dependency files to be uploaded, and click Upload.

      Multiple dependency files can be uploaded at a time. If a file with the same name exists in the box, the file will be overwritten by the new file. The maximum size of each file is 1024 MB by default.

    By default, Allow Access to Internet is selected.

  4. Click Rebuild. The rebuild progress dialog box is displayed.
    • During the software package rebuild process, you can perform other operations.
    • To cancel an ongoing task, click the close button on the progress bar and click OK.
    • If CentOS 7.6 is used and the uploaded RPM package is in the dependency dictionary, a message will be displayed asking you to configure the Kunpeng mirror source, as shown in Figure 2. After the configuration, rebuild the software again.
      Figure 2 Message asking you to configure the Kunpeng mirror source
    • If the OS is not CentOS 7.6 and the uploaded RPM package is in the dependency dictionary, a message will be displayed asking you to download an RPM package that can be used directly, as shown in Figure 3. Download the RPM package and proceed according to the porting guide provided.
      Figure 3 Message providing the package and porting guide
    • During JAR package rebuild, if the JAR package you upload already exists in the Kunpeng Maven repository, the system prompts you to download the JAR package from the repository or configure the Kunpeng Maven repository source. See Figure 4. In this case, no rebuild is required.
      Figure 4 Message asking you to download the JAR package or configuring the Kunpeng mirror source
    • If the RPM or JAR package uploaded does not exist in the dependency dictionary, rebuild the package.

    If the software package rebuild fails and a message indicating that the JAR file fails to be downloaded is displayed, perform the following operations:

    • Check the network configuration, proxy configuration (see Configuring a Proxy), and the size of the /opt directory.
    • Manually download the JAR file and repeat 2 to 4.

      You can view the names and download paths of the JAR files to be manually downloaded in the software package rebuild report.

    If the software package fails to be rebuilt and a message is displayed indicating that the SO, static library, JAR, or binary file is missing, obtain the file and perform 2 to 4 again.

    • You can view details in the software package rebuild report and perform operations as prompted.
    • If the SO, static library, or binary files are missing, obtain the corresponding files (for example, download and decompress the RPM or DEB package and obtain the files) and save them to the /opt/DevKit/workspace/xx/porting/data directory. xx indicates the user name.
  5. After the rebuild is successful, click Download Package Rebuilt (see Figure 5) to view the execution result.
    Figure 5 Software package rebuild report
    • By default, the software package rebuilt is saved in the /opt/DevKit/workspace/xx/porting/report/packagerebuild/task_name/ directory (xx indicates the user name and task_name indicates the task name). You can go to the directory to view the software package rebuilt. You can also click the report in the historical report list on the homepage to view the cause of the rebuild failure and rectify the fault based on the suggestions. For details about the failure report, see Rebuild Failure Description.
    • You can download or delete the software package rebuilt in the historical record area.
    • You can deploy the software package rebuilt on the Kunpeng platform for verification.

Rebuild Failure Description

Figure 6 shows a failure report.

Figure 6 Rebuild failure
Table 1 Parameters in the failure report

Parameter

Description

Dependency File Statistics

Displays the total number of files, number of updated dependency files, and number of missing dependency files.

Dependencies Updated

Displays the names and paths of the dependency files that have been updated. The files are uploaded by the user or automatically downloaded by the tool.

Dependencies Missing

Lists the dependency files that are missing during the rebuild process.

  • You can click Download to download the dynamic libraries, static library files, software packages, executable files, and JAR packages that are compatible with the Kunpeng platform. Then upload the dependency files to the server. For some non–open-source dependency files, the download URLs are not available. You need to obtain the files yourself.
  • For a file whose compatibility with the Kunpeng platform is unknown, verify its compatibility on the Kunpeng platform first. If it is not compatible with the Kunpeng platform, obtain a compatible version from the vendor, obtain the source code and compile it, or use alternative software.

For details about how to rectify common rebuild failures, see Common Problems in Software Package Rebuild.