Scripting Variables

The following is an alphabetical list of variables that are available for scripting use.

Common Variables

The following is an alphabetical list of variables that are available for all scripting use. The variables are in addition to the 'Scripting Key' variables listed with the Standard Meta keys.

Table 2.2. Common Variables

Name Description Value Type Example
BUILDHOST

The host machine from which the package was generated.

string build-machine.organization.org
CPUARCHITECTURE

The CPU architecture of the installing or installed package.

string x86
DATASIZE

Size in bytes of the package's compressed payload.

numeric 654321
DESCRIPTION

Text that describes the package contents. Typically formatted to be a fixed column width.

string The GIMP (GNU Image Manipulation Program) is a powerful image composition and editing program, which can be extremely useful for creating logos and other graphics for Web pages. The GIMP has many of the tools and filters...

Formatted to a fixed width like 69.

DISTRIBUTIONCODENAME

The distribution code name of the target machine.

string Community
DISTRIBUTIONDESCRIPTION

The distribution description of the target machine.

string Mandrakelinux
DISTRIBUTIONID

The distribution id of the target machine.

string mandrakelinux
DISTRIBUTIONMANAGER

The distribution manager of the target machine.

string urpmi
DISTRIBUTIONMANAGERGRAPHICAL

The graphic distribution manager of the target machine.

string urpmi
DISTRIBUTIONRELEASE

The distribution release of the target machine.

string 10.1
EXPANDSIZE

The size in bytes of the expanded (uncompressed) full package.

numeric 7654321
FILETOTAL

The total file count within the package.

numeric 87
LSBVERSION

The lsb version of the target machine.

numeric 2.0
METASIZE

The size in bytes of the package's compressed meta data.

numeric 4321
PACKAGELANGUAGES

The generated list of languages that are specifically supported within the package.

string de en fr nl
PREFIX

The installation prefix where the package was installed.

string /home/user/.local
TIMESTAMPBUILD

The universal coordinated time ISO-8601 date from when the package was generated.

string 2004-10-09T01:12:59Z

Build Variables

The following is an alphabetical list of variables that are available for use in BuildPrepare, BuildUnprepare, and Imports functions along with the Common Variables.

Table 2.3. Build Variables

Name Description Value Type Example
APBUILD_BOGUS_DEPS

Specify a list of whitespace-separated bogus library dependencies. These libraries will not be linked against. This option is useful when the automatic bogus dependency detector doesn't detect bogus dependencies correctly.

string X11 ICE png
APBUILD_CC

Use this compiler instead of gcc.

string Default value: "gcc" or "g++"
APBUILD_DISABLE_BOGUS_DETECTOR

Disable the automatic bogus dependency detector. This is useful when linking to libraries don't have correct DT_NEEDED entries, like GTK 1.2.

string
APBUILD_NO_STATIC_X

Do not force static linking to certain X libraries.

All the X libraries we force static linking to are X extensions. Some distributions don't come with dynamic library versions of those libraries. The static version of all those libraries are all less than 70 KB (the biggest one is libXi, which is 61 KB; everything else is around 15 KB), so rest assured that it won't bloat your application.

string
APBUILD_PATH

Use this as the include dir for the apbuild headers.

string Default value: "/usr/local/include/apbuild"
APBUILD_STATIC

Specify a list of whitespace-separated libraries to statically link to (like: popt z). A filename can be explicitly specified to the static library.

string popt=/usr/lib/libpopt.a
APKG_BUILD_ROOT

If set, the user is forcing the root (base) directory where the package will be built.

string
AUTOPACKAGE_SKELETON_DIRS

If set, the user is forcing additional directories to be included when searching for skeleton files.

string
prefix

If set, the user is forcing the path to which the software will be installed.

string

Install Variables

The following is an alphabetical list of variables that are available for use in Globals, Prepare, Install, and Uninstall functions along with the Common Variables.

Table 2.4. Install Variables

Name Description Value Type Example
BACKUP

The directory where backup files are written relative to $PREFIX.

string @autopackage.org/tests/foobar:1.2.3/backup
DATABASE

The name of the installation database either "User" or "Global".

string User
INSTALLSIZE

The size in bytes of the package's installed files.

numeric 54321
PACKAGELOCATION

The directory location of the installation which is determined when the environment file is loaded. Used to pass base installation directory information to other functions and scripts.

string /home/user/.local/autopackage-gtk
TIMESTAMPINSTALL

The universal coordinated time ISO-8601 date from when the package was installed.

string 2004-10-09T01:12:59Z