Antomic's binary package format is clean and easily understandable. Let's take the GNU bash
package - bash-2.05_2.pkg as an example.
bash-2.05_2.pkg: This is really a simple tar archive. The filename consists of four
distinct parts. "bash", "2.05", "2" and "pkg". Here "bash" is the package name, other package
names would be glibc-dev, libxml2, libart_lgpl, etc. "2.05" is the upstream version of
the software. "2" is the package release number also known as the Antomic version of the package and "pkg"
is the file extension.
<packagename>-<upstream version>_<antomic version>.pkg
bash-2.05_2.pkg consists of the following:
bash-2.05.tar.gz
apkg/
apkg/bash-2.05_2.files
apkg/bash-2.05_2.checksum
apkg/bash-2.05_2.header
Here, bash-2.05.tar.gz is a gzip compressed tar archive consisting of the actual content of the package,
namely /bin/bash, documentation in /usr/doc/bash-2.05/, symbolic links like /bin/sh, etc.
The apkg/ directory contains the metadata of the package. The three files in apkg/, bash-2.05_2.files,
bash-2.05_2.checksum and bash-2.05_2.header are essential and cannot be left out. The file naming format
of these files is the same as the package filename(bash-2.05_2.pkg) except for the file extensions, which
reflects the contents of that file.
bash-2.05_2.files: As mentioned earlier this is an essential file. It contains a list of files and
directories in the bash-2.05.tar.gz file. For example:
/usr/
/usr/doc/
/usr/doc/bash-2.05/
/usr/doc/bash-2.05/NOTES
/usr/doc/bash-2.05/README
/usr/man/
/usr/man/man1/
/usr/man/man1/bash.1.gz
/bin/
/bin/bash
/bin/sh
Note that here the above is an incomplete bash-2.05_2.files file and serves only as an example.
bash-2.05_2.checksum: This file contains the md5 checksum of the bash-2.05.tar.gz file. Simply, the
output of the 'md5sum bash-2.05.tar.gz' command is saved in this file. The contents of this file look like
this:
81a8587130321961c2a2152c200de950 bash-2.05.tar.gz
bash-2.05_2.header: This file contains a lot of information about the package. Following
is what a header file looks like:
Name: bash
Version: 2.05
Release: 2
Depends: glibc(>= 2.2.5_2),ncurses(>= 5.2_2)
Description: The GNU Bourne-Again Shell. A command interpreter and console interface.
Every field has it's own line. The Depends field consists of other packages that
are needed for the proper functioning of the bash package, here they are glibc and ncurses. The
Depends field along with the package name and it's version also contains the relation between bash
and it's dependency. Allowed relations are >=, <=, >, < and = for newer or equal,
older or equal, strictly newer, strictly older and exactly equal respectively. Round brackets seperate
the package name from the relation and version. Every dependency is seperated by a comma(,).
bash-2.05_2.postinst: This is an optional file. It's a script run just after the contents
of a package are unpacked onto the disk. This script is run during a install and an upgrade. This
is strictly a shell script, perl, python, awk, etc. is not allowed.
bash-2.05_2.preinst: Similar to the postinst script, this one is optional. But run before the
contents of the package are unpacked. Run before a install and upgrade. Other conditions are similar
to the postinst file.
bash-2.05_2.postrm: It's just like the earlier two files. This script is run after a package
is removed.
bash-2.05_2.prerm: Ditto. Run before a package is removed.
Note: The postinst, preinst, postrm and prerm shouldn't be executable scripts but should start with
a shebang, like this !#/bin/bash.