Wiki

Clone wiki

ipkg / Package

A package is an archive file which contains a meta data which describes the content of the archive and all the necessary information for executing the various actions on the archive (like install, update and remove). iPKG uses the RPM specification for its packages. RPM is a widely used standard for packages in the linux world and is one of the two dominating package specifications for linux distributions, see rpm.org.

Package Name

The archive name follows the following syntax:

package name-version-buildId-ppc-ibmi-osversion.rpm

Package names are always completely lower case. The software version syntax depends on the software maintainer. A package name is just a convenient way to identify a package. The data is read by the client from the metadata contained inside the package. Package versions use strictly semantic versioning, major.minor.revision. Additionally all parts of the version must be numbers.

Example: linkedlist-1.4.0-5-ppc-ibmi-7.1.rpm

The example package name is to be interpreted in the following way:

  • Software package: Linked List
  • Software version: 1.4
  • Package revision: 5
  • Target release: 7.1

With this naming schema there can be multiple packages of the same package for different target releases in the same repository at the same level.

Package Types

There are three types of packages:

  • Object packages, which contain compiled objects for the QSYS.LIB file system.
  • Stream file packages, which contain the stream files stored in the IFS. That could be text files, python scripts, Node.js applications, RPG prototypes in stream files, ...
  • Virtual packages, which are an organizational instrument to manage package dependencies.

Binary Package

Objects in the QSYS filesystem are best saved and restored when they are packaged in a savefile. The rpm package normally uses a cpio archive file format which is processed by a compressor (like gzip). With objects from the QSYS filesystem a save file is used which is also the payload format (savf) and it is not extra compressed so the value for the compressor is none.

Stream file package

Stream files are packed into a zip archive which is easy to process on the IBM i. So the payload format would be zip and the compressor none. The zip file contains the full directory structure of the content saved inside the zip file. The metadata contains the prefix header tag for relocating the stream file to a different folder (if necessary), see http://ftp.rpm.org/api/4.4.2.2/relocatable.html .

File Format

A package is built with the RPM file format as a layout. This project supports the RPM file format 4.0. As the file format version 3.0 has the same layout it should be working too.

Spec File

Spec files can be used for package creation though the payload differs from most programs creating packages.

Custom Header Tags

Tag numbers between 24576 and 32767 inclusive are for private use and their definition may vary between implementations.

  • 25000 QSYS saved library (string) : Library name which will be used during the RSTOBJ command for selecting the library previously used for saving the objects on the SAVOBJ command.
  • 25001 Data package (int) : 1 = is data package , else no data package. Content from a data package will be restored to a different library if the DTALIB parameter is used on the INSTALL action.
  • 25002 Global service programs (string array) : Lists all service programs which should be added to the global binding directory during the install process.
  • 25003 Global modules (string array) : Lists all modules which should be added to the global binding directory during the install process.
  • 25004 OS version: Version of the IBM i operating system. Syntax version.release[.modification], example 7.1 or 5.4.0.
  • 25005 File CCSIDs: CCSID of the added files (as a 4-byte Integer array)

See https://github.com/ereshetova/rpm/blob/master/lib/rpmtag.h for standard header tags.

Scripts

The package format supports scripts in various phases during different actions, f. e. pre install and post install.

The header tag entry is a single string which contains the script. The script lines are separated with a single linefeed (x'0A', keep in mind that the package meta data is in UTF-8) character. Every line will be executed with the command QCMDEXC.

The whole script cannot be longer that 10000 characters. A single line cannot be longer than 1000 character. The script will stop being executed on the first escape message thrown. If a line starts with a minus sign the execution of the line will be monitored and any escape messages caught. The script continues to run.

Updated