The GEM (GEM Elementary Module) Package Format ============================================== This is the binary package format used in ROCK Linux 2.0. All the package files are stored in a tar.bz2 file. This tar.bz2 file is stored as record in a cdb (constant databases) file. The package meta data files from /var/adm/... are stored in the tar.bz2 file and as records in the cdb file. Extra records are used to store the package name and the config ID string generated by scripts/Config (excluding the config name). All the records from the desc file are also stored directly in the cdb file - using their name as cdb key. If the desc file contains multiple records of the same name, multiple records are also used in the cdb file (instead of e.g. on multi-line record). So the following keys are defined in the cdb file: pkg_name The name of the package pkg_version The name of the package pkg_tarbz2 The package data (as tar.bz2 file) pkg_config The config-id generated by scripts/Config packages The /var/adm/packages/ file flists The /var/adm/flists/ file md5sums The /var/adm/md5sums/ file cksums The /var/adm/cksums/ file dependencies The /var/adm/dependencies/ file descs The /var/adm/descs/ file creator ID of the application which created the GEM file [A-Z]* The records from /var/adm/descs/ Key names and other text data are stored without trailing null-byte and single-line entries also without trailing newline character. Detailed information about the internals of the cdb file format can be found at . The GEM file format is endian safe since cdb, tar, bzip2 and ASCII are endian-safe and nothing else is used in GEM. The "packages.db" File Format ============================= Often there is a "packages.db" file in a directory full of GEM files. This file is rather simple: It is a gzip compressed ASCII file holding an index of the GEM files in the directory. The "packages.db" file has a record for each package. Those records are terminated by an EOT character (\004) followed by a newline (\012). A record consist of fields which are terminated by an ETB character (\027) also followed by a newline. The following fields are defined and stored in that order in the "packages.db" file. A program reading the file should ignore all additional fields: 1. pkg_name 2. descs 3. dependencies 4. cksums Note that the package file name is not a record in the "packages.db" file. It must be constructed from the package name and the [V] tag stored in the 2. field. GEM MINE (GEM Module INstall Environment) ========================================= This is the package manager used in ROCK Linux 2.0 for installing, updating, removing and creating GEM package files. Installing and updating: ------------------------ mine -i [ -t ] [ -v ] [ -f ] [ -x glob ] [ -R root ] \ package1.gem [ .. ] (Packages are automatically updated if already installed) -t ....... Test (show what would happen) -v ....... Create some output on what is happening -f ....... Force (always overwrite existing files) -x glob .. Exclude files matchin the given pattern -R root .. Use an alternate root directory (default = "/") Removing packages: ------------------- mine -r [ -t ] [ -v ] [ -f ] [ -R root ] package1 [ package2 [ .. ] ] -t ....... Test (show what would happen) -v ....... Create some output on what is happening -f ....... Force (also remove modified files) -R root .. Use an alternate root directory (default = "/") Getting information: -------------------- mine Mode [ -h | -H ] [ package1 [ package2.gem [ .. ] ] ] (Auto detect if parameter is installed package or a package file) If no package is given, process all installed packages. Possible modes are: -q ...... Print out package name and version -p ...... Content of /var/adm/packages/ -l ...... Content of /var/adm/flists/ -m ...... Content of /var/adm/md5sums/ -c ...... Content of /var/adm/cksums/ -d ...... Content of /var/adm/dependencies/ -k key .. Print out the corresponding cdb records -h .... prefix each line with ": " (only with -k) -H .... prefix every package with "\n-- --\n" (not with -q) Creating packages: ------------------ mine -C var-adm-dir package-tar-bz2 package-name gem-file This is only used by the build scripts for creating package files. Creating package tar.bz2 files: ------------------------------- mine -T var-adm-dir root-dir package-name package-tar-bz2 This is simple executing a small shell script: ( cd root-dir cut -f2- -d' ' var-adm-dir/flists/package-name | \ tar -cf- --no-recursion --files-from=- | bzip2 ) > package-tar-bz2 The ROCK Linux build scripts do re-implement this, so they don't depend on the 'mine' application for creating package tar.bz2 files.